diff options
author | Adam Co <rattles2013@gmail.com> | 2013-12-18 12:31:29 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-20 16:15:22 +0000 |
commit | f9df93c76b28b92c8df83fcfead173282e1e9521 (patch) | |
tree | 209f3a10de2204510bf931b9cf1bc5c5093c6683 /sw | |
parent | 11a73705d9dd10ebefa2bcdefa560f55e7024a1b (diff) |
Support DOCX exporting 'Track Changes - Inserted Paragraph Mark'
This patch adds support for the DOCX exporter to export the
'Track Changes' of type 'Inserted Paragraph Marker'.
Change-Id: Iaab42c1b678bb83832f519a2f2a8fbc42b9d729d
Reviewed-on: https://gerrit.libreoffice.org/7128
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/attributeoutputbase.hxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8attributeoutput.hxx | 2 |
8 files changed, 21 insertions, 15 deletions
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 06ef068c145c..d8b83e1a5bfa 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -31,6 +31,7 @@ #include <swtypes.hxx> #include <wrtswtbl.hxx> #include <fldbas.hxx> +#include <IDocumentRedlineAccess.hxx> #include <vector> @@ -160,7 +161,7 @@ public: virtual void StartParagraphProperties() = 0; /// Called after we end outputting the attributes. - virtual void EndParagraphProperties( const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted ) = 0; + virtual void EndParagraphProperties( const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted ) = 0; /// Empty paragraph. virtual void EmptyParagraph() = 0; @@ -635,9 +636,8 @@ public: /// Exports the definition (image, size) of a single numbering picture bullet. virtual void BulletDefinition(int /*nId*/, const Graphic& /*rGraphic*/, Size /*aSize*/) {} - // Returns whether or not the 'SwTxtNode' has a paragraph marker deleted (using 'track changes') - virtual const SwRedlineData* GetDeletedParagraphMarker( const SwTxtNode& rNode ); - + // Returns whether or not the 'SwTxtNode' has a paragraph marker inserted \ deleted (using 'track changes') + virtual const SwRedlineData* GetParagraphMarkerRedline( const SwTxtNode& rNode, RedlineType_t aRedlineType ); }; #endif // INCLUDED_SW_SOURCE_FILTER_WW8_ATTRIBUTEOUTPUTBASE_HXX diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 924aa1b759a9..7daf7888fddc 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -696,7 +696,7 @@ void DocxAttributeOutput::WriteCollectedParagraphProperties() } } -void DocxAttributeOutput::EndParagraphProperties( const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted ) +void DocxAttributeOutput::EndParagraphProperties( const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted ) { // Call the 'Redline' function. This will add redline (change-tracking) information that regards to paragraph properties. // This includes changes like 'Bold', 'Underline', 'Strikethrough' etc. @@ -706,7 +706,7 @@ void DocxAttributeOutput::EndParagraphProperties( const SwRedlineData* pRedlineD // Write 'Paragraph Mark' properties bool bIsParagraphMarkProperties = false; // In future - get the 'paragraph marker' properties as a parameter - if (bIsParagraphMarkProperties || pRedlineParagraphMarkerDeleted) + if (bIsParagraphMarkProperties || pRedlineParagraphMarkerDeleted || pRedlineParagraphMarkerInserted) { m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); @@ -715,6 +715,11 @@ void DocxAttributeOutput::EndParagraphProperties( const SwRedlineData* pRedlineD StartRedline( pRedlineParagraphMarkerDeleted ); EndRedline( pRedlineParagraphMarkerDeleted ); } + if ( pRedlineParagraphMarkerInserted ) + { + StartRedline( pRedlineParagraphMarkerInserted ); + EndRedline( pRedlineParagraphMarkerInserted ); + } m_pSerializer->endElementNS( XML_w, XML_rPr ); } diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 8ebf31ef0c3b..62ec9f4b7c05 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -141,7 +141,7 @@ public: virtual void StartParagraphProperties(); /// Called after we end outputting the attributes. - virtual void EndParagraphProperties( const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted ); + virtual void EndParagraphProperties( const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted ); /// Start of the text run. virtual void StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false ); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 3c58c9a56ead..ef8c12ca046b 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -388,7 +388,7 @@ void RtfAttributeOutput::StartParagraphProperties() m_aSectionHeaders.append(aPar.makeStringAndClear()); } -void RtfAttributeOutput::EndParagraphProperties( const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/ ) +void RtfAttributeOutput::EndParagraphProperties( const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/ ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); m_aStyles.append(m_aStylesEnd.makeStringAndClear()); diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 3ca0665a9432..b616f6260a2b 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -57,7 +57,7 @@ public: virtual void StartParagraphProperties(); /// Called after we end outputting the attributes. - virtual void EndParagraphProperties( const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted ); + virtual void EndParagraphProperties( const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted ); /// Start of the text run. virtual void StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false ); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index a8bd18654881..967ad08d01d1 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2427,9 +2427,10 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) } } - const SwRedlineData* pRedlineParagraphMarkerDeleted = AttrOutput().GetDeletedParagraphMarker( rNode ); + const SwRedlineData* pRedlineParagraphMarkerDelete = AttrOutput().GetParagraphMarkerRedline( rNode, nsRedlineType_t::REDLINE_DELETE ); + const SwRedlineData* pRedlineParagraphMarkerInsert = AttrOutput().GetParagraphMarkerRedline( rNode, nsRedlineType_t::REDLINE_INSERT ); const SwRedlineData* pParagraphRedlineData = aAttrIter.GetParagraphLevelRedline( ); - AttrOutput().EndParagraphProperties( pParagraphRedlineData, pRedlineParagraphMarkerDeleted ); + AttrOutput().EndParagraphProperties( pParagraphRedlineData, pRedlineParagraphMarkerDelete, pRedlineParagraphMarkerInsert ); AttrOutput().EndParagraph( pTextNodeInfoInner ); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 0c407eeee1f2..96975cf41f93 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -5387,12 +5387,12 @@ void AttributeOutputBase::FormatCharBorder( const SvxBoxItem& rBox ) /* * This function is used to check if the current SwTxtNode (paragraph) has a redline object - * that signals that the paragraph marker is deleted. + * that is attached to the paragraph marker. * This is done by checking if the range (SwPaM) of the redline is : * - Start = the last character of the current paragraph * - End = the first character of the next paragraph */ -const SwRedlineData* AttributeOutputBase::GetDeletedParagraphMarker( const SwTxtNode& rNode ) +const SwRedlineData* AttributeOutputBase::GetParagraphMarkerRedline( const SwTxtNode& rNode, RedlineType_t aRedlineType) { // ToDo : this is not the most ideal ... should start maybe from 'nCurRedlinePos' for( sal_uInt16 nRedlinePos = 0; nRedlinePos < GetExport().pDoc->GetRedlineTbl().size(); ++nRedlinePos ) @@ -5400,7 +5400,7 @@ const SwRedlineData* AttributeOutputBase::GetDeletedParagraphMarker( const SwTxt const SwRedline* pRedl = GetExport().pDoc->GetRedlineTbl()[ nRedlinePos ]; // Only check redlines that are of type 'Delete' - if ( pRedl->GetRedlineData().GetType() != nsRedlineType_t::REDLINE_DELETE ) + if ( pRedl->GetRedlineData().GetType() != aRedlineType ) continue; const SwPosition* pCheckedStt = pRedl->Start(); diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index 68dea48d13e4..2860f0b99508 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -42,7 +42,7 @@ public: virtual void StartParagraphProperties() {} /// Called after we end outputting the attributes. - virtual void EndParagraphProperties( const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/ ) {} + virtual void EndParagraphProperties( const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/ ) {} /// Empty paragraph. virtual void EmptyParagraph(); |