diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-07-13 11:42:28 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-07-13 15:23:54 +0200 |
commit | 423433ee105faea7775a3869dbf4054ab960480c (patch) | |
tree | 9352d5188ec32f67d2cbad849d6bbc0a88ea7b55 /sw | |
parent | 2e6f9dff530f16db33c52ab289efe18f96f71bb0 (diff) |
DocxAttributeOutput: overwrite WritePostitFieldStart/End
Change-Id: If8ecbc9a831f26cab81ba47af9114b608592524b
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 29 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 10 |
2 files changed, 39 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index e5af71947460..4d14585c9d58 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -566,6 +566,7 @@ void DocxAttributeOutput::EndRun() } DoWriteBookmarks( ); + WriteCommentRanges(); m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); m_pSerializer->mergeTopMarks( sax_fastparser::MERGE_MARKS_PREPEND ); // merges with "postponed run start", see above @@ -593,6 +594,22 @@ void DocxAttributeOutput::EndRun() EndRedline(); } +void DocxAttributeOutput::WriteCommentRanges() +{ + if (m_bPostitStart) + { + m_bPostitStart = false; + OString idstr = OString::valueOf( sal_Int32( m_postitFieldsMaxId )); + m_pSerializer->singleElementNS( XML_w, XML_commentRangeStart, FSNS( XML_w, XML_id ), idstr.getStr(), FSEND ); + } + if (m_bPostitEnd) + { + m_bPostitEnd = false; + OString idstr = OString::valueOf( sal_Int32( m_postitFieldsMaxId )); + m_pSerializer->singleElementNS( XML_w, XML_commentRangeEnd, FSNS( XML_w, XML_id ), idstr.getStr(), FSEND ); + } +} + void DocxAttributeOutput::DoWriteBookmarks() { // Write the start bookmarks @@ -3323,6 +3340,16 @@ void DocxAttributeOutput::WritePostitFieldReference() } } +void DocxAttributeOutput::WritePostitFieldStart() +{ + m_bPostitStart = true; +} + +void DocxAttributeOutput::WritePostitFieldEnd() +{ + m_bPostitEnd = true; +} + void DocxAttributeOutput::WritePostitFields() { for( unsigned int i = 0; @@ -4301,6 +4328,8 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_bOpenedSectPr( false ), m_sFieldBkm( ), m_nNextMarkId( 0 ), + m_bPostitStart(false), + m_bPostitEnd(false), m_pTableWrt( NULL ), m_bTableCellOpen( false ), m_nTableDepth( 0 ), diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 99265a0496bc..ca863ae18bc6 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -98,6 +98,10 @@ public: virtual void WritePostitFieldReference(); + virtual void WritePostitFieldStart(); + + virtual void WritePostitFieldEnd(); + /// Output text (inside a run). virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 ); @@ -522,6 +526,7 @@ private: void DoWriteBookmarks( ); void WritePostponedGraphic(); void WritePostponedMath(); + void WriteCommentRanges(); void StartField_Impl( FieldInfos& rInfos, bool bWriteRun = sal_False ); void DoWriteCmd( String& rCmd ); @@ -559,6 +564,11 @@ private: std::vector<rtl::OString> m_rMarksStart; std::vector<rtl::OString> m_rMarksEnd; + /// Is there a postit start to output? + bool m_bPostitStart; + /// Is there a postit end to output? + bool m_bPostitEnd; + /// Maps of the bookmarks ids std::map<rtl::OString, sal_uInt16> m_rOpenedMarksIds; |