sw/source/filter/ww8/attributeoutputbase.hxx |    8 ++++----
 sw/source/filter/ww8/docxattributeoutput.cxx |    9 +++++++--
 sw/source/filter/ww8/docxattributeoutput.hxx |    2 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx  |    2 +-
 sw/source/filter/ww8/rtfattributeoutput.hxx  |    2 +-
 sw/source/filter/ww8/wrtw8nds.cxx            |    5 +++--
 sw/source/filter/ww8/ww8atr.cxx              |    6 +++---
 sw/source/filter/ww8/ww8attributeoutput.hxx  |    2 +-
 8 files changed, 21 insertions(+), 15 deletions(-)

New commits:
commit f9df93c76b28b92c8df83fcfead173282e1e9521
Author: Adam Co <rattles2...@gmail.com>
Date:   Wed Dec 18 12:31:29 2013 +0200

    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 <vmik...@collabora.co.uk>
    Tested-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx 
b/sw/source/filter/ww8/attributeoutputbase.hxx
index 06ef068..d8b83e1 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 924aa1b..7daf788 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 8ebf31e..62ec9f4 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 3c58c9a..ef8c12c 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 3ca0665..b616f62 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 a8bd186..967ad08 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 0c407ee..96975cf 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 68dea48..2860f0b 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();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to