From a9ac4fe6fd5b3ee921a8eee85a715c3ef881e47e Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 16 Sep 2009 13:55:36 +0000 Subject: CWS-TOOLING: integrate CWS impressnotes01 2009-09-11 13:52:41 +0200 cl r276061 : CWS-TOOLING: rebase CWS impressnotes01 to trunk@276043 (milestone: DEV300:m58) 2009-09-10 15:44:57 +0200 cl r276039 : #i103139# continued work on the impress annotation feature 2009-09-10 14:52:31 +0200 cl r276032 : #i103139# continued work on the impress annotation feature 2009-09-10 14:50:32 +0200 cl r276031 : #i103139# continued work on the impress annotation feature 2009-09-10 14:48:29 +0200 cl r276030 : #i103139# continued work on the impress annotation feature 2009-09-10 11:36:11 +0200 cl r276027 : #i103139# continued work on the impress annotation feature 2009-09-09 20:22:41 +0200 cl r276018 : #i103139# continued work on the impress annotation feature 2009-09-09 20:21:45 +0200 cl r276017 : #i103139# continued work on the impress annotation feature 2009-09-09 19:32:29 +0200 sj r276015 : #i103139# added import of comments (ppt binary) 2009-09-09 19:31:07 +0200 sj r276014 : #i103139# added import of comments (ppt binary) 2009-09-09 19:16:41 +0200 cl r276011 : #i103139# continued work on the impress annotation feature 2009-09-09 19:15:19 +0200 cl r276010 : #i103139# continued work on the impress annotation feature 2009-09-09 16:27:19 +0200 cl r276001 : #i104579# fixed isEmptyPresObj() 2009-09-09 15:12:02 +0200 cl r275997 : #i103139# continued work on the impress annotation feature 2009-09-09 15:06:29 +0200 sj r275996 : #i103139# added import of comments (ppt binary) 2009-09-09 14:53:01 +0200 cl r275995 : #i103139# continued work on the impress annotation feature 2009-09-09 14:51:32 +0200 cl r275994 : #i103139# continued work on the impress annotation feature 2009-09-09 12:11:17 +0200 cl r275982 : #i103139# continued work on the impress annotation feature 2009-09-09 11:47:55 +0200 cl r275981 : #i103139# continued work on the impress annotation feature 2009-09-09 11:47:23 +0200 cl r275980 : #i103139# continued work on the impress annotation feature 2009-09-09 11:44:47 +0200 cl r275978 : #i104315# added missing tab pages 2009-09-08 16:04:44 +0200 cl r275936 : #i103139# continued work on the impress annotation feature 2009-09-08 16:03:28 +0200 cl r275935 : #i103139# continued work on the impress annotation feature 2009-09-08 11:45:47 +0200 cl r275920 : #i103139# continued work on the impress annotation feature 2009-09-08 11:41:51 +0200 cl r275919 : #i103139# continued work on the impress annotation feature 2009-09-07 18:30:55 +0200 cl r275910 : #i103139# continued work on the impress annotation feature 2009-09-07 18:29:37 +0200 cl r275909 : #i103139# continued work on the impress annotation feature 2009-09-07 17:25:43 +0200 cl r275905 : #i103139# continued work on the impress annotation feature 2009-09-07 12:00:28 +0200 cl r275884 : #i103139# continued work on the impress annotation feature 2009-09-06 14:14:00 +0200 cl r275859 : #i103139# continued work on the impress annotation feature 2009-09-05 20:57:24 +0200 cl r275854 : #i103139# continued work on the impress annotation feature 2009-09-05 20:56:29 +0200 cl r275853 : #i103139# continued work on the impress annotation feature 2009-09-05 20:55:27 +0200 cl r275852 : #i103139# continued work on the impress annotation feature 2009-09-05 20:11:42 +0200 cl r275851 : #i103139# continued work on the impress annotation feature 2009-09-05 20:11:09 +0200 cl r275850 : #i103139# continued work on the impress annotation feature 2009-09-05 17:43:33 +0200 cl r275845 : #i103139# continued work on the impress annotation feature 2009-09-05 17:04:41 +0200 cl r275843 : #i103139# continued work on the impress annotation feature 2009-09-05 17:03:26 +0200 cl r275842 : #i103139# continued work on the impress annotation feature 2009-09-05 17:02:53 +0200 cl r275841 : #i103139# continued work on the impress annotation feature 2009-09-05 13:15:04 +0200 pl r275839 : #i104823# WB_NEEDSFOCUS 2009-09-05 13:14:41 +0200 pl r275838 : #i104823# WB_NEEDSFOCUS 2009-09-04 17:48:21 +0200 cl r275826 : #i103139# continued work on the impress annotation feature 2009-09-04 17:35:03 +0200 cl r275825 : #i103139# continued work on the impress annotation feature 2009-09-04 17:15:46 +0200 cl r275824 : #i103139# continued work on the impress annotation feature 2009-09-04 17:12:54 +0200 cl r275823 : #i103139# continued work on the impress annotation feature 2009-09-04 17:05:23 +0200 cl r275822 : #i103139# continued work on the impress annotation feature 2009-09-04 16:48:28 +0200 cl r275820 : #i103139# continued work on the impress annotation feature 2009-09-04 16:44:02 +0200 cl r275818 : #i103139# continued work on the impress annotation feature 2009-09-04 16:43:23 +0200 cl r275817 : #i103139# continued work on the impress annotation feature 2009-09-04 16:06:04 +0200 cl r275812 : #i103139# continued work on the impress annotation feature 2009-09-04 16:05:45 +0200 cl r275811 : #i103139# continued work on the impress annotation feature 2009-09-04 15:04:33 +0200 cl r275806 : #i103139# continued work on the impress annotation feature 2009-09-04 11:43:14 +0200 cl r275795 : #i103139# continued work on the impress annotation feature 2009-09-04 11:27:10 +0200 cl r275793 : #i103139# continued work on the impress annotation feature 2009-09-04 11:10:02 +0200 cl r275792 : #i103139# continued work on the impress annotation feature 2009-09-04 11:07:05 +0200 cl r275790 : #i103139# continued work on the impress annotation feature 2009-09-04 11:05:01 +0200 cl r275789 : #i103139# continued work on the impress annotation feature 2009-09-04 10:55:51 +0200 cl r275785 : #i103139# renamed notes to comments 2009-09-04 10:54:57 +0200 cl r275784 : #i103139# renamed notes to comments 2009-09-03 20:37:35 +0200 cl r275772 : #i103139# continued work on the impress annotation feature 2009-09-03 20:35:31 +0200 cl r275771 : #i103139# continued work on the impress annotation feature 2009-09-01 18:17:55 +0200 cl r275680 : #i103139# continued work on the impress annotation feature 2009-09-01 18:15:08 +0200 cl r275678 : #i103139# continued work on the impress annotation feature 2009-09-01 18:13:38 +0200 cl r275677 : #i103139# continued work on the impress annotation feature 2009-08-18 12:35:42 +0200 cl r275089 : fixed merge error 2009-08-18 11:39:58 +0200 cl r275086 : CWS-TOOLING: rebase CWS impressnotes01 to trunk@275001 (milestone: DEV300:m55) 2009-07-30 13:45:10 +0200 cl r274481 : fixed merge errrors 2009-07-30 13:41:21 +0200 cl r274480 : fixed merge errrors 2009-07-30 13:39:40 +0200 cl r274478 : fixed merge errrors 2009-07-22 18:07:30 +0200 cl r274256 : CWS-TOOLING: rebase CWS impressnotes01 to trunk@273858 (milestone: DEV300:m52) 2009-07-21 17:21:31 +0200 cl r274208 : merging 2009-07-20 14:28:34 +0200 cl r274137 : #i103139# annotation support for impress 2009-07-20 14:28:04 +0200 cl r274136 : #i103139# annotation support for impress 2009-07-20 14:27:20 +0200 cl r274135 : #i103139# annotation support for impress 2009-07-20 14:21:17 +0200 cl r274134 : #i103139# annotation support for impress 2009-07-20 14:20:56 +0200 cl r274133 : #i103139# annotation support for impress 2009-07-20 14:20:09 +0200 cl r274132 : #i103139# annotation support for impress 2009-07-20 14:19:00 +0200 cl r274131 : #i103139# annotation support for impress 2009-07-20 14:17:50 +0200 cl r274130 : #i103139# annotation support for impress 2009-07-20 14:12:24 +0200 cl r274129 : #i103139# annotation support for impress 2009-07-20 13:52:03 +0200 cl r274128 : #i103139# annotation support for impress 2009-07-20 13:51:11 +0200 cl r274127 : #i103139# annotation support for impress 2009-07-20 13:48:59 +0200 cl r274126 : #i103139# annotation support for impress 2009-07-20 13:43:56 +0200 cl r274125 : #i103139# annotation support for impress 2009-07-20 13:31:55 +0200 cl r274123 : #i103139# annotation support for impress 2009-07-20 13:30:45 +0200 cl r274122 : #i103139# annotation support for impress --- .../data/org/openoffice/Office/Accelerators.xcu | 14 +- .../data/org/openoffice/Office/UI/CalcCommands.xcu | 16 +- .../openoffice/Office/UI/DrawImpressCommands.xcu | 55 ++++++- .../org/openoffice/Office/UI/DrawWindowState.xcu | 16 +- .../org/openoffice/Office/UI/GenericCommands.xcu | 8 +- .../openoffice/Office/UI/ImpressWindowState.xcu | 18 ++- .../org/openoffice/Office/UI/WriterCommands.xcu | 4 +- .../registry/schema/org/openoffice/Office/Calc.xcs | 4 +- .../schema/org/openoffice/Office/Common.xcs | 15 +- .../registry/schema/org/openoffice/Office/Draw.xcs | 24 ++- .../schema/org/openoffice/Office/Impress.xcs | 10 +- .../registry/schema/org/openoffice/Office/UI.xcs | 4 +- .../schema/org/openoffice/Office/Writer.xcs | 16 +- .../schema/org/openoffice/Office/WriterWeb.xcs | 8 +- sfx2/source/doc/objserv.cxx | 2 +- sfx2/source/doc/objstor.cxx | 4 +- .../svx/sdr/overlay/overlayanimatedbitmapex.hxx | 2 +- svx/inc/svx/svdfppt.hxx | 2 + svx/inc/svx/svxids.hrc | 12 +- svx/sdi/svx.sdi | 179 +++++++++++++++++++++ svx/sdi/svxitems.sdi | 1 - svx/source/cui/optsave.cxx | 6 +- svx/source/options/optsave.src | 8 +- svx/source/svdraw/svddrgv.cxx | 6 +- svx/source/svdraw/svdfppt.cxx | 95 ++++++++++- svx/source/unoedit/unoforou.cxx | 2 +- xmloff/inc/xmlnmspe.hxx | 10 +- xmloff/inc/xmloff/xmltoken.hxx | 4 + xmloff/source/core/xmlexp.cxx | 1 + xmloff/source/core/xmlimp.cxx | 4 + xmloff/source/core/xmltoken.cxx | 4 + xmloff/source/draw/sdxmlexp.cxx | 131 +++++++++++++-- xmloff/source/draw/sdxmlexp_impl.hxx | 3 + xmloff/source/draw/ximppage.cxx | 164 ++++++++++++++++++- xmloff/source/draw/ximppage.hxx | 4 +- xmloff/source/meta/MetaExportComponent.cxx | 1 + 36 files changed, 774 insertions(+), 83 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index 26143aa76407..52ecd3ddd7a9 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -1872,7 +1872,19 @@ - + + + I10N SHORTCUTS - NO TRANSLATE + .uno:NextAnnotation + + + + + I10N SHORTCUTS - NO TRANSLATE + .uno:PreviousAnnotation + + + I10N SHORTCUTS - NO TRANSLATE .uno:SpacePara1 diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 991ea9a64d10..8c76a2dadd9f 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -681,12 +681,20 @@ - Show Note - - + Show Comment + + + + + Comm~ent + + + 1 + + - Delete Note + Delete Comment diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu index 104fb106836c..f8e9d4319190 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu @@ -1743,7 +1743,12 @@ ~Slide Show - + + ~Group @@ -2061,6 +2066,54 @@ 1 + + + Comme~nt + + + 1 + + + + + Comme~nts + + + 1 + + + + + ~Delete Comment + + + 1 + + + + + Delete ~All Comments + + + 1 + + + + + Next Comment + + + 1 + + + + + Previous Comment + + + 1 + + diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu index 9e6a1be3c80e..e0db837c21a5 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu @@ -666,7 +666,21 @@ true - + + + false + + + false + + + Comments + + + false + + + false diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 9edbd84d74ce..fa69145371f4 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -1951,7 +1951,7 @@ - Not~e + Comme~nt 1 @@ -5134,17 +5134,17 @@ --> - Delete All Notes + Delete All Comments - Delete All Notes by This Author + Delete All Comments by This Author - Delete Note + Delete Comment diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu index 86bf55f3dc51..cc309efb2f59 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu @@ -196,7 +196,7 @@ false - + Text Box Formatting @@ -761,7 +761,21 @@ true - + + + false + + + false + + + Comments + + + false + + + false diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index 55365975b790..0ba86ef6b1aa 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -41,7 +41,7 @@ - Notes + Comments @@ -330,7 +330,7 @@ - ~Note + Comme~nt 1 diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index fd7c52ef4df2..1ab6b58b4d13 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -124,8 +124,8 @@ NN - Indicates whether notes are marked. - + Indicates whether comments are marked. + true diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index e6218530561c..e834f97d4df9 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -2358,14 +2358,19 @@ Dymamic border coloring means that when the mouse is hovered over a control, and ODFVER_011 - + ODFVER_012 - - 3 - + + + ODFVER_LATEST + + + + 3 + @@ -6003,7 +6008,7 @@ Dymamic border coloring means that when the mouse is hovered over a control, and mod - Specifies if search includes notes(SwPostItFields) + Specifies if search includes comments(SwPostItFields) false diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs index f29972ca7fcf..c7e4f71c677c 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs @@ -359,18 +359,26 @@ 0 - - - - + - AF - Indicates whether to show simple (true) or 3D-handles (false). - + CL + Indicates whether to show comments (true) or hide them (false). + true - + + + + + + AF + Indicates whether to show simple (true) or 3D-handles (false). + + + true + + diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs index 6cf3a7abdc68..bfa2e7dce407 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs @@ -398,7 +398,15 @@ 0 - + + + CL + Indicates whether to show comments (true) or hide them (false). + + + true + + diff --git a/officecfg/registry/schema/org/openoffice/Office/UI.xcs b/officecfg/registry/schema/org/openoffice/Office/UI.xcs index 02e90d75daef..48368c263b34 100644 --- a/officecfg/registry/schema/org/openoffice/Office/UI.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/UI.xcs @@ -418,11 +418,11 @@ - Specifies the settings used for the background of notes in Calc. + Specifies the settings used for the background of comments in Calc. - Specifies the color used for the background of notes. + Specifies the color used for the background of comments. diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index 1b21017e3f3c..cb22883eba09 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -1097,8 +1097,8 @@ OS - Specifies if notes are displayed. - + Specifies if comments are displayed. + true @@ -2145,7 +2145,7 @@ OS - Specifies if and how notes are printed. + Specifies if and how comments are printed. @@ -2155,7 +2155,7 @@ - Notes only + Comments only @@ -5659,13 +5659,13 @@ - Contains settings for notes + Contains settings for comments mod - configures if note anchor should be shown or hidden when display is off - + configures if comment anchor should be shown or hidden when display is off + false @@ -6983,7 +6983,7 @@ - Show the "notes" heading ? + Show the "comments" heading ? diff --git a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs index 6063ce1b55c9..ebb9fca30962 100644 --- a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs @@ -93,8 +93,8 @@ OS - Specifies if notes are displayed. - + Specifies if comments are displayed. + true @@ -686,7 +686,7 @@ OS - Specifies if notes are printed and how they are printed. + Specifies if comments are printed and how they are printed. @@ -696,7 +696,7 @@ - Notes only + Comments only diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index a47fc1bf4747..34a3f3159169 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1386,7 +1386,7 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent ) { // the document might need saving ( new, modified or in ODF1.1 format without signature ) - if ( nVersion == SvtSaveOptions::ODFVER_012 ) + if ( nVersion >= SvtSaveOptions::ODFVER_012 ) { if ( (bHasSign && QueryBox( NULL, SfxResId( MSG_XMLSEC_QUERY_SAVESIGNEDBEFORESIGN ) ).Execute() == RET_YES) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 5a4aed274c30..602174fb2bf9 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -370,7 +370,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto SvtSaveOptions::ODFDefaultVersion nDefVersion = aSaveOpt.GetODFDefaultVersion(); // older versions can not have this property set, it exists only starting from ODF1.2 - if ( nDefVersion == SvtSaveOptions::ODFVER_012 ) + if ( nDefVersion >= SvtSaveOptions::ODFVER_012 ) aVersion = ODFVER_012_TEXT; if ( aVersion.getLength() ) @@ -1207,7 +1207,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl bNoPreserveForOasis = ( (aODFVersion.equals( ODFVER_012_TEXT ) && nVersion == SvtSaveOptions::ODFVER_011) || - (!aODFVersion.getLength() && nVersion == SvtSaveOptions::ODFVER_012) + (!aODFVersion.getLength() && nVersion >= SvtSaveOptions::ODFVER_012) ); } } diff --git a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx index 9acc34c8dcc8..23a720467710 100644 --- a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx +++ b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx @@ -40,7 +40,7 @@ namespace sdr { namespace overlay { - class OverlayAnimatedBitmapEx : public OverlayObjectWithBasePosition + class SVX_DLLPUBLIC OverlayAnimatedBitmapEx : public OverlayObjectWithBasePosition { protected: // the Bitmaps diff --git a/svx/inc/svx/svdfppt.hxx b/svx/inc/svx/svdfppt.hxx index 5a73bea5052f..63f196876e93 100644 --- a/svx/inc/svx/svdfppt.hxx +++ b/svx/inc/svx/svdfppt.hxx @@ -1337,6 +1337,8 @@ class PPTConvertOCXControls : public SvxMSConvertOCXControls #define PPT_PST_NewlyAddedAtomByXP11008 11008 #define PPT_PST_NewlyAddedAtomByXP11010 11010 +#define PPT_PST_Comment10 12000 +#define PPT_PST_CommentAtom10 12001 #define PPT_PST_NewlyAddedAtomByXP12004 12004 #define PPT_PST_NewlyAddedAtomByXP12010 12010 #define PPT_PST_NewlyAddedAtomByXP12011 12011 diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc index 6019c3590d55..5d37c1ee87f3 100644 --- a/svx/inc/svx/svxids.hrc +++ b/svx/inc/svx/svxids.hrc @@ -377,7 +377,6 @@ #define SID_FRAME_UP (SID_SC_START + 407) #define SID_FRAME_DOWN (SID_SC_START + 408) #define SID_ENTER_STRING (SID_SC_START + 476) -#define SID_INSERT_POSTIT (SID_SC_START + 276) #define SID_ATTR_SECIALCHAR (SID_SC_START + 581) #define SID_ATTR_SPECIALCHAR (SID_SC_START + 581) @@ -1352,8 +1351,17 @@ #define SID_RECHECK_DOCUMENT (SID_SVX_START+1091) #define SID_ATTR_PARA_OUTLINE_LEVEL (SID_SVX_START+1092) +#define SID_INSERT_POSTIT (SID_SVX_START+1093) +#define SID_DELETE_POSTIT (SID_SVX_START+1094) +#define SID_NEXT_POSTIT (SID_SVX_START+1095) +#define SID_PREVIOUS_POSTIT (SID_SVX_START+1096) +#define SID_DELETEALL_POSTIT (SID_SVX_START+1097) +#define SID_SHOW_POSTIT (SID_SVX_START+1098) +#define SID_REPLYTO_POSTIT (SID_SVX_START+1099) +#define SID_DELETEALLBYAUTHOR_POSTIT (SID_SVX_START+1100) + // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE SID_ATTR_PARA_OUTLINE_LEVEL + 1 +#define SID_SVX_FIRSTFREE SID_DELETEALLBYAUTHOR_POSTIT + 1 // -------------------------------------------------------------------------- // Overflow check for slot IDs diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 3c819229ee4c..dc303bad5732 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -5981,6 +5981,185 @@ SfxVoidItem InsertAnnotation SID_INSERT_POSTIT GroupId = GID_INSERT; ] +//-------------------------------------------------------------------------- +SfxBoolItem ShowAnnotation SID_SHOW_POSTIT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_VIEW; +] + +//-------------------------------------------------------------------------- + +SfxVoidItem ReplyToAnnotation SID_REPLYTO_POSTIT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_DOCUMENT; +] + +//-------------------------------------------------------------------------- + +SfxVoidItem DeleteAnnotation SID_DELETE_POSTIT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + +//-------------------------------------------------------------------------- + +SfxVoidItem DeleteAllAnnotation SID_DELETEALL_POSTIT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + +SfxVoidItem DeleteAllAnnotationByAuthor SID_DELETEALLBYAUTHOR_POSTIT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_DOCUMENT; +] + +//-------------------------------------------------------------------------- + +SfxVoidItem NextAnnotation SID_NEXT_POSTIT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_VIEW; +] + +//-------------------------------------------------------------------------- + +SfxVoidItem PreviousAnnotation SID_PREVIOUS_POSTIT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_VIEW; +] + //-------------------------------------------------------------------------- SfxVoidItem InsertApplet SID_INSERT_APPLET (SfxStringItem Class FN_PARAM_1, diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi index 795f2aea1177..f977f24c4b0a 100644 --- a/svx/sdi/svxitems.sdi +++ b/svx/sdi/svxitems.sdi @@ -700,4 +700,3 @@ struct ZoomSlider INT16 SvxMaxZoom MID_ZOOMSLIDER_MAXZOOM; }; item ZoomSlider SvxZoomSliderItem; - diff --git a/svx/source/cui/optsave.cxx b/svx/source/cui/optsave.cxx index 67ac02536b47..294f9cd041da 100644 --- a/svx/source/cui/optsave.cxx +++ b/svx/source/cui/optsave.cxx @@ -777,7 +777,7 @@ IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) IMPL_LINK( SfxSaveTabPage, ODFVersionHdl_Impl, ListBox *, EMPTYARG ) { long nVersion = long( aODFVersionLB.GetEntryData( aODFVersionLB.GetSelectEntryPos() ) ); - bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) == SvtSaveOptions::ODFVER_012; + bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) != SvtSaveOptions::ODFVER_LATEST; if ( bShown ) { bool bHasODFFormat = false; @@ -795,8 +795,8 @@ IMPL_LINK( SfxSaveTabPage, ODFVersionHdl_Impl, ListBox *, EMPTYARG ) || ( aSaveAsLB.GetEntryData( aSaveAsLB.GetSelectEntryPos() ) != NULL ); } - aODFWarningFI.Show( !bShown ); - aODFWarningFT.Show( !bShown ); + aODFWarningFI.Show( bShown ); + aODFWarningFT.Show( bShown ); return 0; } diff --git a/svx/source/options/optsave.src b/svx/source/options/optsave.src index afa1c4b6d0c8..374f53ef618f 100644 --- a/svx/source/options/optsave.src +++ b/svx/source/options/optsave.src @@ -149,8 +149,9 @@ TabPage RID_SFXPAGE_SAVE DropDown = TRUE; StringList [ en-US ] = { - < "1.0/1.1 (OpenOffice.org 2.x)" ; 2 ; > ; - < "1.2 (recommended)" ; 3 ; > ; + < "1.0/1.1" ; 2 ; > ; + < "1.2" ; 4 ; > ; + < "1.2 Extended (recommended)"; 0x7fffffff ; > ; }; }; CheckBox BTN_NOPRETTYPRINTING @@ -219,7 +220,8 @@ TabPage RID_SFXPAGE_SAVE Pos = MAP_APPFONT ( 23 , 169 ) ; Size = MAP_APPFONT ( 239 , 8 ) ; Hide = TRUE; - Text [ en-US ] = "Not using ODF 1.2 may cause infomation to be lost."; + Text [ en-US ] = "Not using ODF 1.2 Extended may cause infomation to be lost."; + Text [ x-comment ] = "EN-US, the term 'extended' must not be translated."; }; Image IMG_ODF_WARNING { diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 69459b1bff35..8236ca1f19ac 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -282,7 +282,11 @@ BOOL SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl // #103894# Expand test for HDL_ANCHOR_TR BOOL bNotDraggable = (HDL_ANCHOR == eDragHdl || HDL_ANCHOR_TR == eDragHdl); - if(bDragHdl) + if(pHdl && (pHdl->GetKind() == HDL_SMARTTAG) && pForcedMeth ) + { + // just use the forced method for smart tags + } + else if(bDragHdl) { mpCurrentSdrDragMethod = new SdrDragMovHdl(*this); } diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx index 35101eb2f418..d0b01f6a820f 100644 --- a/svx/source/svdraw/svdfppt.cxx +++ b/svx/source/svdraw/svdfppt.cxx @@ -39,6 +39,11 @@ #include #include #include +#include +#include +#include +#include +#include #include @@ -2563,9 +2568,11 @@ sal_Bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStre sal_uInt32 nOldPos = rSt.Tell(); DffRecordHeader aProgTagsHd, aProgTagBinaryDataHd; - rSourceHd.SeekToContent( rSt ); - if ( SeekToRec( rSt, PPT_PST_ProgTags, rSourceHd.GetRecEndFilePos(), &aProgTagsHd ) ) + sal_Bool bFound = rSourceHd.nRecType == PPT_PST_ProgTags; + if ( !bFound ) + bFound = SeekToRec( rSt, PPT_PST_ProgTags, rSourceHd.GetRecEndFilePos(), &aProgTagsHd ); + if ( bFound ) { while( SeekToRec( rSt, PPT_PST_ProgBinaryTag, aProgTagsHd.GetRecEndFilePos(), &aProgTagBinaryDataHd ) ) { @@ -2860,6 +2867,75 @@ SdrPage* SdrPowerPointImport::MakeBlancPage( sal_Bool bMaster ) const return pRet; } +void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage, DffRecordHeader& rComment10Hd ) +{ + rtl::OUString sAuthor; + rtl::OUString sText; + rtl::OUString sInitials; + + sal_Int32 nIndex = 0; + util::DateTime aDateTime; + sal_Int32 nPosX = 0; + sal_Int32 nPosY = 0; + + while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < rComment10Hd.GetRecEndFilePos() ) ) + { + DffRecordHeader aCommentHd; + rStCtrl >> aCommentHd; + switch( aCommentHd.nRecType ) + { + case PPT_PST_CString : + { + String aString; + SvxMSDffManager::MSDFFReadZString( rStCtrl, aString, aCommentHd.nRecLen, TRUE ); + switch ( aCommentHd.nRecInstance ) + { + case 0 : sAuthor = aString; break; + case 1 : sText = aString; break; + case 2 : sInitials = aString; break; + } + } + break; + + case PPT_PST_CommentAtom10 : + { + rStCtrl >> nIndex + >> aDateTime.Year + >> aDateTime.Month + >> aDateTime.Day // DayOfWeek + >> aDateTime.Day + >> aDateTime.Hours + >> aDateTime.Minutes + >> aDateTime.Seconds + >> aDateTime.HundredthSeconds + >> nPosX + >> nPosY; + + aDateTime.HundredthSeconds /= 10; + } + break; + } + aCommentHd.SeekToEndOfRecord( rStCtrl ); + } + Point aPosition( nPosX, nPosY ); + rMan.Scale( aPosition ); + + try + { + uno::Reference< office::XAnnotationAccess > xAnnotationAccess( pPage->getUnoPage(), UNO_QUERY_THROW ); + uno::Reference< office::XAnnotation > xAnnotation( xAnnotationAccess->createAndInsertAnnotation() ); + xAnnotation->setPosition( geometry::RealPoint2D( aPosition.X() / 100.0, aPosition.Y() / 100.0 ) ); + xAnnotation->setAuthor( sAuthor ); + xAnnotation->setDateTime( aDateTime ); + uno::Reference< text::XText > xText( xAnnotation->getTextRange() ); + xText->setString( sText ); + } + catch( uno::Exception& ) + { + + } +} + // be sure not to import masterpages with this method // be sure not to import masterpages with this method @@ -2896,6 +2972,21 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* } break; + case PPT_PST_ProgTags : + { + DffRecordHeader aContentDataHd; + if ( SeekToContentOfProgTag( 10, rStCtrl, aHd, aContentDataHd ) ) + { + DffRecordHeader aComment10Hd; + while( ( rStCtrl.GetError() == 0 ) && SeekToRec( rStCtrl, PPT_PST_Comment10, aContentDataHd.GetRecEndFilePos(), &aComment10Hd ) ) + { + ImportComment10( *this, rStCtrl, pRet, aComment10Hd ); + aComment10Hd.SeekToEndOfRecord( rStCtrl ); + } + } + } + break; + case PPT_PST_PPDrawing : { DffRecordHeader aPPDrawHd; diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx index 9c6cb07440d7..c54f76d5f4dc 100644 --- a/svx/source/unoedit/unoforou.cxx +++ b/svx/source/unoedit/unoforou.cxx @@ -490,7 +490,7 @@ sal_Bool SvxOutlinerForwarder::SetDepth( USHORT nPara, sal_Int16 nNewDepth ) { rOutliner.SetDepth( pPara, nNewDepth ); - const bool bOutlinerText = (pSdrObject->GetObjInventor() == SdrInventor) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT); + const bool bOutlinerText = pSdrObject && (pSdrObject->GetObjInventor() == SdrInventor) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT); if( bOutlinerText ) rOutliner.SetLevelDependendStyleSheet( nPara ); diff --git a/xmloff/inc/xmlnmspe.hxx b/xmloff/inc/xmlnmspe.hxx index a79890f19a7d..f90ff05c084d 100644 --- a/xmloff/inc/xmlnmspe.hxx +++ b/xmloff/inc/xmlnmspe.hxx @@ -82,7 +82,15 @@ XML_NAMESPACE( OF, 34U ) // OpenFormula aka ODFF XML_NAMESPACE( XHTML, 35U ) XML_NAMESPACE( GRDDL, 36U ) -#define _XML_OLD_NAMESPACE_BASE 37U +// namespaces for odf extended formats + +#define XML_NAMESPACE_EXT( prefix, key ) \ +const sal_uInt16 XML_NAMESPACE_##prefix##_EXT = key; \ +const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = key; + +XML_NAMESPACE_EXT( OFFICE, 37U ) + +#define _XML_OLD_NAMESPACE_BASE 38U // namespaces used in the technical preview (SO 5.2) XML_OLD_NAMESPACE( FO, 0U ) diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index 978f6e698cc8..70e8ed82ca49 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -144,6 +144,10 @@ namespace xmloff { namespace token { XML_NP_GRDDL, XML_N_GRDDL, + // ODF Enhanced namespaces + XML_NP_OFFICE_EXT, + XML_N_OFFICE_EXT, + // units XML_UNIT_MM, XML_UNIT_M, diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 8045cd582e2f..55af99802f9d 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1358,6 +1358,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) const sal_Char* pVersion = 0; switch( getDefaultVersion() ) { + case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break; case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break; case SvtSaveOptions::ODFVER_011: pVersion = sXML_1_1; break; case SvtSaveOptions::ODFVER_010: break; diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 975cb5432eb7..72ae06150243 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -89,6 +89,7 @@ using namespace ::com::sun::star::document; using namespace ::xmloff::token; sal_Char __READONLY_DATA sXML_np__office[] = "_office"; +sal_Char __READONLY_DATA sXML_np__office_ext[] = "_office_ooo"; sal_Char __READONLY_DATA sXML_np__ooo[] = "_ooo"; sal_Char __READONLY_DATA sXML_np__ooow[] = "_ooow"; sal_Char __READONLY_DATA sXML_np__oooc[] = "_oooc"; @@ -241,6 +242,9 @@ void SvXMLImport::_InitCtor() mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__office ) ), GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE ); + mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__office_ext ) ), + GetXMLToken(XML_N_OFFICE_EXT), + XML_NAMESPACE_OFFICE_EXT ); mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__ooo ) ), GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO ); mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__style) ), GetXMLToken(XML_N_STYLE), diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index d4f60e053b3c..ae95763f1936 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -152,6 +152,10 @@ namespace xmloff { namespace token { TOKEN( "grddl", XML_NP_GRDDL ), TOKEN( "http://www.w3.org/2003/g/data-view#", XML_N_GRDDL ), + // ODF Enhanced namespaces + TOKEN( "officeooo", XML_NP_OFFICE_EXT ), + TOKEN( "http://openoffice.org/2009/office", XML_N_OFFICE_EXT ), + // units TOKEN( "mm", XML_UNIT_MM ), TOKEN( "m", XML_UNIT_M ), diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 67c66b6a1d5f..1d7414d4ca23 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -39,7 +39,9 @@ #include #include #include +#include #include +#include #include #include #include "sdxmlexp_impl.hxx" @@ -51,9 +53,7 @@ #include #include -#ifndef _COM_SUN_STAR_FORM_XFORMSUPPLIER2_HPP_ #include -#endif #include #include #include @@ -96,9 +96,13 @@ using ::rtl::OUStringBuffer; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::util; using namespace ::com::sun::star::container; using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::office; using namespace ::com::sun::star::presentation; +using namespace ::com::sun::star::geometry; +using namespace ::com::sun::star::text; using namespace ::xmloff::token; @@ -640,6 +644,14 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent GetXMLToken(XML_N_ANIMATION), XML_NAMESPACE_ANIMATION); + if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST ) + { + _GetNamespaceMap().Add( + GetXMLToken(XML_NP_OFFICE_EXT), + GetXMLToken(XML_N_OFFICE_EXT), + XML_NAMESPACE_OFFICE_EXT); + } + GetShapeExport()->enableLayerExport(); // #88546# enable progress bar increments @@ -2060,6 +2072,8 @@ void SdXMLExport::_ExportContent() } } } + + exportAnnotations( xDrawPage ); } } @@ -2355,10 +2369,9 @@ void SdXMLExport::_ExportAutoStyles() // create auto style infos for objects on master pages for(sal_Int32 nMPageId(0L); nMPageId < mnDocMasterPageCount; nMPageId++) { - Any aAny(mxDocMasterPages->getByIndex(nMPageId)); - Reference< XDrawPage > xMasterPage; + Reference< XDrawPage > xMasterPage(mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY ); - if((aAny >>= xMasterPage) && xMasterPage.is() ) + if( xMasterPage.is() ) { // collect layer information GetFormExport()->examineForms( xMasterPage ); @@ -2397,6 +2410,7 @@ void SdXMLExport::_ExportAutoStyles() } } } + collectAnnotationAutoStyles(xMasterPage); } } } @@ -2413,10 +2427,8 @@ void SdXMLExport::_ExportAutoStyles() // create auto style infos for objects on pages for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++) { - Any aAny(mxDocDrawPages->getByIndex(nPageInd)); - Reference xDrawPage; - - if((aAny >>= xDrawPage) && xDrawPage.is() ) + Reference xDrawPage( mxDocDrawPages->getByIndex(nPageInd), UNO_QUERY ); + if( xDrawPage.is() ) { // collect layer information GetFormExport()->examineForms( xDrawPage ); @@ -2466,6 +2478,8 @@ void SdXMLExport::_ExportAutoStyles() } } } + + collectAnnotationAutoStyles( xDrawPage ); } } if(IsImpress()) @@ -2536,10 +2550,8 @@ void SdXMLExport::_ExportMasterStyles() // export MasterPages in master-styles section for(sal_Int32 nMPageId = 0L; nMPageId < mnDocMasterPageCount; nMPageId++) { - Any aAny(mxDocMasterPages->getByIndex(nMPageId)); - Reference< XDrawPage > xMasterPage; - - if((aAny >>= xMasterPage) && xMasterPage.is()) + Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY ); + if(xMasterPage.is()) { // prepare masterpage attributes OUString sMasterPageName; @@ -2610,6 +2622,7 @@ void SdXMLExport::_ExportMasterStyles() } } } + exportAnnotations( xMasterPage ); } } } @@ -2770,6 +2783,98 @@ OUString SdXMLExport::getNavigationOrder( const Reference< XDrawPage >& xDrawPag ////////////////////////////////////////////////////////////////////////////// +void SdXMLExport::collectAnnotationAutoStyles( const Reference& xDrawPage ) +{ + Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY ); + if( xAnnotationAccess.is() ) try + { + Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() ); + if( xAnnotationEnumeration.is() ) + { + while( xAnnotationEnumeration->hasMoreElements() ) + { + Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW ); + Reference< XText > xText( xAnnotation->getTextRange() ); + if(xText.is() && xText->getString().getLength()) + GetTextParagraphExport()->collectTextAutoStyles( xText ); + } + } + } + catch( Exception& ) + { + DBG_ERROR("SdXMLExport::collectAnnotationAutoStyles(), exception caught during export of annotation auto styles"); + } +} + +void SdXMLExport::exportAnnotations( const Reference& xDrawPage ) +{ + // do not export in ODF 1.2 or older + if( getDefaultVersion() != SvtSaveOptions::ODFVER_LATEST ) + return; + + Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY ); + if( xAnnotationAccess.is() ) try + { + Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() ); + if( xAnnotationEnumeration.is() && xAnnotationEnumeration->hasMoreElements() ) + { + OUStringBuffer sStringBuffer; + do + { + Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW ); + + RealPoint2D aPosition( xAnnotation->getPosition() ); + + GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast( aPosition.X * 100 ) ); + AddAttribute(XML_NAMESPACE_SVG, XML_X, sStringBuffer.makeStringAndClear()); + + GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast( aPosition.Y * 100 ) ); + AddAttribute(XML_NAMESPACE_SVG, XML_Y, sStringBuffer.makeStringAndClear()); + + RealSize2D aSize( xAnnotation->getSize() ); + + if( aSize.Width || aSize.Height ) + { + GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast( aSize.Width * 100 ) ); + AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, sStringBuffer.makeStringAndClear()); + GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast( aSize.Height * 100 ) ); + AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, sStringBuffer.makeStringAndClear()); + } + + // annotation element + content + SvXMLElementExport aElem(*this, XML_NAMESPACE_OFFICE_EXT, XML_ANNOTATION, sal_False, sal_True); + + // author + OUString aAuthor( xAnnotation->getAuthor() ); + if( aAuthor.getLength() ) + { + SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC, XML_CREATOR, sal_True, sal_False ); + this->Characters(aAuthor); + } + + { + // date time + DateTime aDate( xAnnotation->getDateTime() ); + GetMM100UnitConverter().convertDateTime(sStringBuffer, aDate, sal_True); + SvXMLElementExport aDateElem( *this, XML_NAMESPACE_DC, XML_DATE, sal_True, sal_False ); + Characters(sStringBuffer.makeStringAndClear()); + } + + com::sun::star::uno::Reference < com::sun::star::text::XText > xText( xAnnotation->getTextRange() ); + if( xText.is() ) + this->GetTextParagraphExport()->exportText( xText ); + } + while( xAnnotationEnumeration->hasMoreElements() ); + } + } + catch( Exception& ) + { + DBG_ERROR("SdXMLExport::exportAnnotations(), exception caught during export of annotations"); + } +} + +////////////////////////////////////////////////////////////////////////////// + #define SERVICE( classname, servicename, implementationname, draw, flags )\ uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\ {\ diff --git a/xmloff/source/draw/sdxmlexp_impl.hxx b/xmloff/source/draw/sdxmlexp_impl.hxx index eaf5c7c531f2..2738e948ea69 100644 --- a/xmloff/source/draw/sdxmlexp_impl.hxx +++ b/xmloff/source/draw/sdxmlexp_impl.hxx @@ -186,6 +186,9 @@ class SdXMLExport : public SvXMLExport rtl::OUString getNavigationOrder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage ); + void collectAnnotationAutoStyles( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage ); + void exportAnnotations( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage ); + protected: virtual void GetViewSettings(com::sun::star::uno::Sequence& aProps); virtual void GetConfigurationSettings(com::sun::star::uno::Sequence& aProps); diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx index 4daa6263d391..9d64d49f9421 100644 --- a/xmloff/source/draw/ximppage.cxx +++ b/xmloff/source/draw/ximppage.cxx @@ -32,6 +32,9 @@ #include "precompiled_xmloff.hxx" #include +#include +#include +#include #include #include "XMLNumberStylesImport.hxx" #include @@ -41,6 +44,7 @@ #include "ximppage.hxx" #include "ximpshap.hxx" #include "animimp.hxx" +#include "XMLStringBufferImportContext.hxx" #include #include #include "ximpstyl.hxx" @@ -57,9 +61,155 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::util; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::container; +using namespace ::com::sun::star::office; +using namespace ::com::sun::star::xml::sax; +using namespace ::com::sun::star::geometry; + + +////////////////////////////////////////////////////////////////////////////// + +class DrawAnnotationContext : public SvXMLImportContext +{ + +public: + DrawAnnotationContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess ); + + virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); + virtual void EndElement(); + +private: + Reference< XAnnotation > mxAnnotation; + Reference< XTextCursor > mxCursor; + + OUStringBuffer maAuthorBuffer; + OUStringBuffer maDateBuffer; +}; + +DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess ) +: SvXMLImportContext( rImport, nPrfx, rLocalName ) +, mxAnnotation( xAnnotationAccess->createAndInsertAnnotation() ) +{ + if( mxAnnotation.is() ) + { + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + + RealPoint2D aPosition; + RealSize2D aSize; + + for(sal_Int16 i=0; i < nAttrCount; i++) + { + OUString sValue( xAttrList->getValueByIndex( i ) ); + OUString sAttrName( xAttrList->getNameByIndex( i ) ); + OUString aLocalName; + switch( GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ) ) + { + case XML_NAMESPACE_SVG: + if( IsXMLToken( aLocalName, XML_X ) ) + { + sal_Int32 x; + GetImport().GetMM100UnitConverter().convertMeasure(x, sValue); + aPosition.X = static_cast(x) / 100.0; + } + else if( IsXMLToken( aLocalName, XML_Y ) ) + { + sal_Int32 y; + GetImport().GetMM100UnitConverter().convertMeasure(y, sValue); + aPosition.Y = static_cast(y) / 100.0; + } + else if( IsXMLToken( aLocalName, XML_WIDTH ) ) + { + sal_Int32 w; + GetImport().GetMM100UnitConverter().convertMeasure(w, sValue); + aSize.Width = static_cast(w) / 100.0; + } + else if( IsXMLToken( aLocalName, XML_HEIGHT ) ) + { + sal_Int32 h; + GetImport().GetMM100UnitConverter().convertMeasure(h, sValue); + aSize.Height = static_cast(h) / 100.0; + } + break; + default: + break; + } + } + + mxAnnotation->setPosition( aPosition ); + mxAnnotation->setSize( aSize ); + } +} + +SvXMLImportContext * DrawAnnotationContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +{ + SvXMLImportContext * pContext = NULL; + + if( mxAnnotation.is() ) + { + if( XML_NAMESPACE_DC == nPrefix ) + { + if( IsXMLToken( rLocalName, XML_CREATOR ) ) + pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maAuthorBuffer); + else if( IsXMLToken( rLocalName, XML_DATE ) ) + pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maDateBuffer); + } + else + { + // create text cursor on demand + if( !mxCursor.is() ) + { + uno::Reference< text::XText > xText( mxAnnotation->getTextRange() ); + if( xText.is() ) + { + UniReference < XMLTextImportHelper > xTxtImport = GetImport().GetTextImport(); + mxCursor = xText->createTextCursor(); + if( mxCursor.is() ) + xTxtImport->SetCursor( mxCursor ); + } + } + + // if we have a text cursor, lets try to import some text + if( mxCursor.is() ) + { + pContext = GetImport().GetTextImport()->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList ); + } + } + } + + // call parent for content + if(!pContext) + pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); + + return pContext; +} + +void DrawAnnotationContext::EndElement() +{ + if(mxCursor.is()) + { + // delete addition newline + const OUString aEmpty; + mxCursor->gotoEnd( sal_False ); + mxCursor->goLeft( 1, sal_True ); + mxCursor->setString( aEmpty ); + + // reset cursor + GetImport().GetTextImport()->ResetCursor(); + } + + if( mxAnnotation.is() ) + { + mxAnnotation->setAuthor( maAuthorBuffer.makeStringAndClear() ); + + DateTime aDateTime; + if(SvXMLUnitConverter::convertDateTime(aDateTime, maDateBuffer.makeStringAndClear())) + mxAnnotation->setDateTime(aDateTime); + } +} ////////////////////////////////////////////////////////////////////////////// @@ -70,8 +220,9 @@ SdXMLGenericPageContext::SdXMLGenericPageContext( USHORT nPrfx, const OUString& rLocalName, const Reference< xml::sax::XAttributeList>& xAttrList, Reference< drawing::XShapes >& rShapes) -: SvXMLImportContext( rImport, nPrfx, rLocalName ), - mxShapes( rShapes ) +: SvXMLImportContext( rImport, nPrfx, rLocalName ) +, mxShapes( rShapes ) +, mxAnnotationAccess( rShapes, UNO_QUERY ) { sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -100,10 +251,8 @@ void SdXMLGenericPageContext::StartElement( const Reference< ::com::sun::star::x { GetImport().GetShapeImport()->pushGroupForSorting( mxShapes ); -#ifndef SVX_LIGHT if( GetImport().IsFormsSupported() ) GetImport().GetFormImport()->startPage( Reference< drawing::XDrawPage >::query( mxShapes ) ); -#endif } ////////////////////////////////////////////////////////////////////////////// @@ -120,10 +269,13 @@ SvXMLImportContext* SdXMLGenericPageContext::CreateChildContext( USHORT nPrefix, } else if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_FORMS ) ) { -#ifndef SVX_LIGHT if( GetImport().IsFormsSupported() ) pContext = GetImport().GetFormImport()->createOfficeFormsContext( GetImport(), nPrefix, rLocalName ); -#endif + } + else if( ((nPrefix == XML_NAMESPACE_OFFICE) || (nPrefix == XML_NAMESPACE_OFFICE_EXT)) && IsXMLToken( rLocalName, XML_ANNOTATION ) ) + { + if( mxAnnotationAccess.is() ) + pContext = new DrawAnnotationContext( GetImport(), nPrefix, rLocalName, xAttrList, mxAnnotationAccess ); } else { diff --git a/xmloff/source/draw/ximppage.hxx b/xmloff/source/draw/ximppage.hxx index fa32546b0810..45b505e2044f 100644 --- a/xmloff/source/draw/ximppage.hxx +++ b/xmloff/source/draw/ximppage.hxx @@ -35,6 +35,7 @@ #include "sdxmlimp_impl.hxx" #include #include +#include #include #include "ximpshap.hxx" @@ -44,7 +45,8 @@ class SdXMLGenericPageContext : public SvXMLImportContext { // the shape group this group is working on - com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > mxShapes; + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxShapes; + ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotationAccess > mxAnnotationAccess; protected: rtl::OUString maPageLayoutName; diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx index 0b65592c3613..996e75d0f740 100644 --- a/xmloff/source/meta/MetaExportComponent.cxx +++ b/xmloff/source/meta/MetaExportComponent.cxx @@ -170,6 +170,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum ) const sal_Char* pVersion = 0; switch( getDefaultVersion() ) { + case SvtSaveOptions::ODFVER_LATEST: pVersion = "1.2"; break; case SvtSaveOptions::ODFVER_012: pVersion = "1.2"; break; case SvtSaveOptions::ODFVER_011: pVersion = "1.1"; break; case SvtSaveOptions::ODFVER_010: break; -- cgit v1.2.3