[Libreoffice-commits] core.git: sw/qa sw/source

Caolán McNamara caolanm at redhat.com
Wed Sep 24 07:13:42 PDT 2014


 sw/qa/extras/ww8export/data/redline-export-3.odt |binary
 sw/qa/extras/ww8export/ww8export.cxx             |    8 ++++++++
 sw/source/filter/ww8/wrtw8nds.cxx                |   22 +++++++++++++++++++---
 3 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit ded3740d2498b7a14afe8c0c63219c924cf800df
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Sep 24 13:14:50 2014 +0100

    also consider redline that starts right before the end para marker
    
    We were currently handing the case where a paragraph end mark is right
    before the *end* of a redline, now we also need to take care if the end
    mark is right after the *start* of a redline
    
    Change-Id: I816335067f60d1d9332bfdb1117fb1448b564972

diff --git a/sw/qa/extras/ww8export/data/redline-export-3.odt b/sw/qa/extras/ww8export/data/redline-export-3.odt
new file mode 100644
index 0000000..6d0d80a
Binary files /dev/null and b/sw/qa/extras/ww8export/data/redline-export-3.odt differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index cefd0db..60f583b 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -363,6 +363,14 @@ DECLARE_WW8EXPORT_TEST(testRedlineExport2, "redline-export-2.odt")
     CPPUNIT_ASSERT_EQUAL(true, hasProperty(getRun(getParagraph(3), 1), "RedlineType"));
 }
 
+DECLARE_WW8EXPORT_TEST(testRedlineExport3, "redline-export-3.odt")
+{
+    //there must be redline information just on the para-break boundary between para one and two
+    CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(getParagraph(1), 1), "RedlineType"));
+    CPPUNIT_ASSERT_EQUAL(true, hasProperty(getRun(getParagraph(1), 2), "RedlineType"));
+    CPPUNIT_ASSERT_EQUAL(true, hasProperty(getRun(getParagraph(2), 1), "RedlineType"));
+    CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(getParagraph(2), 2), "RedlineType"));
+}
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 540ed19..24b5f2d 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1261,6 +1261,7 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons
         const SwRangeRedline *pRange = m_rExport.pDoc->getIDocumentRedlineAccess().GetRedlineTbl()[nPos];
         const SwPosition* pEnd = pRange->End();
         const SwPosition* pStart = pRange->Start();
+        bool bBreak = true;
         // In word the paragraph end marker is a real character, in writer it is not.
         // Here we find out if the para end marker we will emit is affected by
         // redlining, in which case it must be included by the range of character
@@ -1271,11 +1272,25 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons
             {
                 // This condition detects if the pseudo-char we will export
                 // should be explicitly included by the redlining char
-                // properties on this node
+                // properties on this node because the redlining ends right
+                // after it
                 return true;
             }
+            bBreak = false;
         }
-        else if (pStart->nNode.GetIndex()-1 == rNd.GetIndex())
+        if (pStart->nNode == rNd)
+        {
+            if (pStart->nContent.GetIndex() == nEnd)
+            {
+                // This condition detects if the pseudo-char we will export
+                // should be explicitly included by the redlining char
+                // properties on this node because the redlining starts right
+                // before it
+                return true;
+            }
+            bBreak = false;
+        }
+        if (pStart->nNode.GetIndex()-1 == rNd.GetIndex())
         {
             if (pStart->nContent.GetIndex() == 0)
             {
@@ -1284,9 +1299,10 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons
                 // properties starting on the next node.
                 return true;
             }
+            bBreak = false;
         }
 
-        else
+        if (bBreak)
             break;
     }
     return false;


More information about the Libreoffice-commits mailing list