diff options
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 @@ </node> </node> <node oor:name="com.sun.star.presentation.PresentationDocument" oor:op="replace"> - <node oor:name="1_MOD1" oor:op="replace"> + <node oor:name="PAGEDOWN_MOD1_MOD2" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="en-US">.uno:NextAnnotation</value> + </prop> + </node> + <node oor:name="PAGEUP_MOD1_MOD2" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="en-US">.uno:PreviousAnnotation</value> + </prop> + </node> + <node oor:name="1_MOD1" oor:op="replace"> <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> <value xml:lang="en-US">.uno:SpacePara1</value> </prop> 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 @@ </node> <node oor:name=".uno:NoteVisible" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Show Note</value> - </prop> - </node> + <value xml:lang="en-US">Show Comment</value> + </prop> + </node> + <node oor:name=".uno:InsertAnnotation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Comm~ent</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:DeleteNote" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Delete Note</value> + <value xml:lang="en-US">Delete Comment</value> </prop> </node> <node oor:name=".uno:InputLineVisible" oor:op="replace"> 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 @@ <value xml:lang="en-US">~Slide Show</value> </prop> </node> - <node oor:name=".uno:GroupMenu" oor:op="replace"> + <!--node oor:name=".uno:ReviewMenu" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">~Review</value> + </prop> + </node--> + <node oor:name=".uno:GroupMenu" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">~Group</value> @@ -2061,6 +2066,54 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:InsertAnnotation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Comme~nt</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ShowAnnotation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Comme~nts</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DeleteAnnotation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">~Delete Comment</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DeleteAllAnnotation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Delete ~All Comments</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:NextAnnotation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Next Comment</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:PreviousAnnotation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Previous Comment</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> </node> </node> </oor:component-data> 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 @@ <value>true</value> </prop> </node> - <node oor:name="private:resource/toolbar/masterviewtoolbar" oor:op="replace"> + <node oor:name="private:resource/toolbar/commentsbar" oor:op="replace"> + <prop oor:name="Docked" oor:type="xs:boolean"> + <value>false</value> + </prop> + <prop oor:name="Visible" oor:type="xs:boolean"> + <value>false</value> + </prop> + <prop oor:name="UIName" oor:type="xs:string"> + <value xml:lang="en-US">Comments</value> + </prop> + <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean"> + <value>false</value> + </prop> + </node> + <node oor:name="private:resource/toolbar/masterviewtoolbar" oor:op="replace"> <prop oor:name="Docked" oor:type="xs:boolean"> <value>false</value> </prop> 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 @@ </node> <node oor:name=".uno:InsertAnnotation" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Not~e</value> + <value xml:lang="en-US">Comme~nt</value> </prop> <prop oor:name="Properties" oor:type="xs:int"> <value>1</value> @@ -5134,17 +5134,17 @@ </node> --> <node oor:name=".uno:DeleteAllNotes" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Delete All Notes</value> + <value xml:lang="en-US">Delete All Comments</value> </prop> </node> <node oor:name=".uno:DeleteAuthor" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Delete All Notes by This Author</value> + <value xml:lang="en-US">Delete All Comments by This Author</value> </prop> </node> <node oor:name=".uno:DeleteNote" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Delete Note</value> + <value xml:lang="en-US">Delete Comment</value> </prop> </node> </node> 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 @@ <value>false</value> </prop> </node> - <node oor:name="private:resource/toolbar/formtextobjectbar" oor:op="replace"> + <node oor:name="private:resource/toolbar/formtextobjectbar" oor:op="replace"> <prop oor:name="UIName" oor:type="xs:string"> <value xml:lang="en-US">Text Box Formatting</value> </prop> @@ -761,7 +761,21 @@ <value>true</value> </prop> </node> - <node oor:name="private:resource/toolbar/masterviewtoolbar" oor:op="replace"> + <node oor:name="private:resource/toolbar/commentsbar" oor:op="replace"> + <prop oor:name="Docked" oor:type="xs:boolean"> + <value>false</value> + </prop> + <prop oor:name="Visible" oor:type="xs:boolean"> + <value>false</value> + </prop> + <prop oor:name="UIName" oor:type="xs:string"> + <value xml:lang="en-US">Comments</value> + </prop> + <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean"> + <value>false</value> + </prop> + </node> + <node oor:name="private:resource/toolbar/masterviewtoolbar" oor:op="replace"> <prop oor:name="Docked" oor:type="xs:boolean"> <value>false</value> </prop> 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 @@ </node> <node oor:name=".uno:ShowAnnotations" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Notes</value> + <value xml:lang="en-US">Comments</value> </prop> </node> <node oor:name=".uno:InsertScript" oor:op="replace"> @@ -330,7 +330,7 @@ </node> <node oor:name=".uno:InsertAnnotation" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">~Note</value> + <value xml:lang="en-US">Comme~nt</value> </prop> <prop oor:name="Properties" oor:type="xs:int"> <value>1</value> 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 @@ <!-- UIHints: Tools - Options -Spreadsheets - Contents - [Section] Display --> <info> <author>NN</author> - <desc>Indicates whether notes are marked.</desc> - <label>Note tags</label> + <desc>Indicates whether comments are marked.</desc> + <label>Comment tags</label> </info> <value>true</value> </prop> 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 <desc>ODFVER_011</desc> </info> </enumeration> - <enumeration oor:value="3"> + <enumeration oor:value="4"> <info> <desc>ODFVER_012</desc> </info> </enumeration> - </constraints> - <value>3</value> - </prop> + <enumeration oor:value="3"> + <info> + <desc>ODFVER_LATEST</desc> + </info> + </enumeration> + </constraints> + <value>3</value> + </prop> </group> </group> <group oor:name="Load"> @@ -6003,7 +6008,7 @@ Dymamic border coloring means that when the mouse is hovered over a control, and <!-- UIHints: Edit Search/Replace --> <info> <author>mod</author> - <desc>Specifies if search includes notes(SwPostItFields)</desc> + <desc>Specifies if search includes comments(SwPostItFields)</desc> </info> <value>false</value> </prop> 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 @@ </constraints> <value>0</value> </prop> - <prop oor:name="SimpleHandles" oor:type="xs:boolean"> - <!-- OldPath: Draw/Other --> - <!-- OldLocation: soffice.cfg --> - <!-- UIHints: Optionbar --> + <prop oor:name="ShowComments" oor:type="xs:boolean"> <info> - <author>AF</author> - <desc>Indicates whether to show simple (true) or 3D-handles (false).</desc> - <label>Simple Handles</label> + <author>CL</author> + <desc>Indicates whether to show comments (true) or hide them (false).</desc> + <label>Show Comments</label> </info> <value>true</value> </prop> - <prop oor:name="BigHandles" oor:type="xs:boolean"> + <prop oor:name="SimpleHandles" oor:type="xs:boolean"> + <!-- OldPath: Draw/Other --> + <!-- OldLocation: soffice.cfg --> + <!-- UIHints: Optionbar --> + <info> + <author>AF</author> + <desc>Indicates whether to show simple (true) or 3D-handles (false).</desc> + <label>Simple Handles</label> + </info> + <value>true</value> + </prop> + <prop oor:name="BigHandles" oor:type="xs:boolean"> <!-- OldPath: Draw/Other --> <!-- OldLocation: soffice.cfg --> <!-- UIHints: Optionbar --> 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 @@ </constraints> <value>0</value> </prop> - <prop oor:name="SimpleHandles" oor:type="xs:boolean"> + <prop oor:name="ShowComments" oor:type="xs:boolean"> + <info> + <author>CL</author> + <desc>Indicates whether to show comments (true) or hide them (false).</desc> + <label>Show Comments</label> + </info> + <value>true</value> + </prop> + <prop oor:name="SimpleHandles" oor:type="xs:boolean"> <!-- OldPath: Impress/Other --> <!-- OldLocation: soffice.cfg --> <!-- UIHints: Optionbar --> 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 @@ </group> <group oor:name="CalcNotesBackground"> <info> - <desc>Specifies the settings used for the background of notes in Calc.</desc> + <desc>Specifies the settings used for the background of comments in Calc.</desc> </info> <prop oor:name="Color" oor:type="xs:int"> <info> - <desc>Specifies the color used for the background of notes.</desc> + <desc>Specifies the color used for the background of comments.</desc> </info> </prop> </group> 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 @@ <!-- UIHints: Tools - Options - Text document - Contents - [Section] Display --> <info> <author>OS</author> - <desc>Specifies if notes are displayed.</desc> - <label>Notes</label> + <desc>Specifies if comments are displayed.</desc> + <label>Comments</label> </info> <value>true</value> </prop> @@ -2145,7 +2145,7 @@ <!-- UIHints: Tools - Options - Text document - Print - [Section] Notes --> <info> <author>OS</author> - <desc>Specifies if and how notes are printed.</desc> + <desc>Specifies if and how comments are printed.</desc> </info> <constraints> <enumeration oor:value="0"> @@ -2155,7 +2155,7 @@ </enumeration> <enumeration oor:value="1"> <info> - <desc>Notes only</desc> + <desc>Comments only</desc> </info> </enumeration> <enumeration oor:value="2"> @@ -5659,13 +5659,13 @@ </group> <group oor:name="Notes"> <info> - <desc>Contains settings for notes</desc> + <desc>Contains settings for comments</desc> </info> <prop oor:name="ShowAnkor" oor:type="xs:boolean"> <info> <author>mod</author> - <desc>configures if note anchor should be shown or hidden when display is off</desc> - <label>Notes Ankor on/off</label> + <desc>configures if comment anchor should be shown or hidden when display is off</desc> + <label>Comments Ankor on/off</label> </info> <value>false</value> </prop> @@ -6983,7 +6983,7 @@ </prop> <prop oor:type="xs:boolean" oor:name="ShowNotes"> <info> - <desc>Show the "notes" heading ? </desc> + <desc>Show the "comments" heading ? </desc> </info> </prop> 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 @@ <!-- UIHints: Tools - Option - HTML-Document Contents - [Section] Display --> <info> <author>OS</author> - <desc>Specifies if notes are displayed.</desc> - <label>Notes</label> + <desc>Specifies if comments are displayed.</desc> + <label>Comments</label> </info> <value>true</value> </prop> @@ -686,7 +686,7 @@ <!-- UIHints: Tools - Option - HTML-Document Print - [Section] Notes --> <info> <author>OS</author> - <desc>Specifies if notes are printed and how they are printed.</desc> + <desc>Specifies if comments are printed and how they are printed.</desc> </info> <constraints> <enumeration oor:value="0"> @@ -696,7 +696,7 @@ </enumeration> <enumeration oor:value="1"> <info> - <desc>Notes only</desc> + <desc>Comments only</desc> </info> </enumeration> <enumeration oor:value="2"> 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 @@ -5982,6 +5982,185 @@ SfxVoidItem InsertAnnotation SID_INSERT_POSTIT ] //-------------------------------------------------------------------------- +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, SfxStringItem ClassLocation FN_PARAM_2, 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 <sot/storinfo.hxx> #include <sot/stg.hxx> #include <com/sun/star/embed/Aspects.hpp> +#include <com/sun/star/office/XAnnotation.hpp> +#include <com/sun/star/office/XAnnotationAccess.hpp> +#include <com/sun/star/text/XText.hpp> +#include <com/sun/star/geometry/RealPoint2D.hpp> +#include <com/sun/star/util/DateTime.hpp> #include <unotools/streamwrap.hxx> @@ -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 <com/sun/star/lang/ServiceNotRegisteredException.hpp> #include <com/sun/star/presentation/XPresentationSupplier.hpp> #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp> +#include <com/sun/star/geometry/RealPoint2D.hpp> #include <com/sun/star/task/XStatusIndicatorSupplier.hpp> +#include <com/sun/star/office/XAnnotationAccess.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/uno/Any.hxx> #include "sdxmlexp_impl.hxx" @@ -51,9 +53,7 @@ #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/style/XStyle.hpp> -#ifndef _COM_SUN_STAR_FORM_XFORMSUPPLIER2_HPP_ #include <com/sun/star/form/XFormsSupplier2.hpp> -#endif #include <com/sun/star/presentation/XPresentationPage.hpp> #include <com/sun/star/drawing/XMasterPageTarget.hpp> #include <com/sun/star/text/XText.hpp> @@ -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> xDrawPage; - - if((aAny >>= xDrawPage) && xDrawPage.is() ) + Reference<XDrawPage> 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>& 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>& 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<sal_Int32>( aPosition.X * 100 ) ); + AddAttribute(XML_NAMESPACE_SVG, XML_X, sStringBuffer.makeStringAndClear()); + + GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( 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<sal_Int32>( aSize.Width * 100 ) ); + AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, sStringBuffer.makeStringAndClear()); + GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( 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<com::sun::star::beans::PropertyValue>& aProps); virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& 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 <tools/debug.hxx> +#include <com/sun/star/geometry/RealPoint2D.hpp> +#include <com/sun/star/text/XTextCursor.hpp> +#include <com/sun/star/util/DateTime.hpp> #include <cppuhelper/implbase1.hxx> #include "XMLNumberStylesImport.hxx" #include <xmloff/xmlstyle.hxx> @@ -41,6 +44,7 @@ #include "ximppage.hxx" #include "ximpshap.hxx" #include "animimp.hxx" +#include "XMLStringBufferImportContext.hxx" #include <xmloff/formsimp.hxx> #include <xmloff/xmlictxt.hxx> #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<double>(x) / 100.0; + } + else if( IsXMLToken( aLocalName, XML_Y ) ) + { + sal_Int32 y; + GetImport().GetMM100UnitConverter().convertMeasure(y, sValue); + aPosition.Y = static_cast<double>(y) / 100.0; + } + else if( IsXMLToken( aLocalName, XML_WIDTH ) ) + { + sal_Int32 w; + GetImport().GetMM100UnitConverter().convertMeasure(w, sValue); + aSize.Width = static_cast<double>(w) / 100.0; + } + else if( IsXMLToken( aLocalName, XML_HEIGHT ) ) + { + sal_Int32 h; + GetImport().GetMM100UnitConverter().convertMeasure(h, sValue); + aSize.Height = static_cast<double>(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 <xmloff/nmspmap.hxx> #include <com/sun/star/drawing/XShapes.hpp> +#include <com/sun/star/office/XAnnotationAccess.hpp> #include <tools/rtti.hxx> #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; |