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

Caolán McNamara caolanm at redhat.com
Wed Sep 24 02:05:24 PDT 2014


 sw/qa/extras/ww8export/data/redline-export-2.odt |binary
 sw/qa/extras/ww8export/ww8export.cxx             |    9 ++++++++-
 sw/source/filter/ww8/ww8scan.cxx                 |    9 ++-------
 3 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 705a8c226aee3e68db492083b7cf8b704335328b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 23 20:35:50 2014 +0100

    WW8PLCFMan::AdjustEnds deeply flawed concept wrt change tracking
    
    The whole idea of clipping the char attributes to before the cr that word uses
    as the end of para marker is flawed from especially the perspective of
    redlining which is a char property in word.
    
    If the redline encompasses the newline in order to state that it is deleted,
    then if the prop is clipped to before that newline then the end-of-para doesn't
    get marked as deleted
    
    For now just remove the character attributes clipping from here to be as
    conservative as possible.
    
    Hopefully the ordering of processing start pap before start chp and end chp
    before end pap and the other million improvements in the parser that came about
    after AdjustEnds was created avoids whatever problems were trying to be worked
    around here.
    
    Change-Id: I5a72e462db2fff60f52b12c2125ea6ac363de695

diff --git a/sw/qa/extras/ww8export/data/redline-export-2.odt b/sw/qa/extras/ww8export/data/redline-export-2.odt
new file mode 100644
index 0000000..2aca5ee
Binary files /dev/null and b/sw/qa/extras/ww8export/data/redline-export-2.odt differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index 184815d..cefd0db 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -349,7 +349,7 @@ DECLARE_WW8EXPORT_TEST(testRedlineExport1, "redline-export-1.odt")
     uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
     uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY);
     uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
-    //there must be no redline information on the first line before or after reloading
+    //there must be no redline information on the first line before and after reloading
     while (xRunEnum->hasMoreElements())
     {
         uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
@@ -357,6 +357,13 @@ DECLARE_WW8EXPORT_TEST(testRedlineExport1, "redline-export-1.odt")
     }
 }
 
+DECLARE_WW8EXPORT_TEST(testRedlineExport2, "redline-export-2.odt")
+{
+    //there must be redline information on the first portion of the third paragraph before and after reloading
+    CPPUNIT_ASSERT_EQUAL(true, hasProperty(getRun(getParagraph(3), 1), "RedlineType"));
+}
+
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index d1898fe..9c3d266 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4235,20 +4235,15 @@ void WW8PLCFMan::AdjustEnds( WW8PLCFxDesc& rDesc )
             nLineEnd = pPap->nEndPos;// nLineEnd zeigt *hinter* das <CR>
             pPap->nEndPos--;        // Absatzende um 1 Zeichen verkuerzen
 
-            // gibt es bereits ein CharAttr-Ende das auf das jetzige
-            // Absatzende zeigt ?  ... dann auch um 1 Zeichen verkuerzen
-            if (pChp->nEndPos == nLineEnd)
-                pChp->nEndPos--;
-
             // gibt es bereits ein Sep-Ende, das auf das jetzige Absatzende
             // zeigt ?  ... dann auch um 1 Zeichen verkuerzen
             if( pSep->nEndPos == nLineEnd )
                 pSep->nEndPos--;
         }
     }
-    else if ( (&rDesc == pChp) || (&rDesc == pSep) )
+    else if (&rDesc == pSep)
     {
-        // Char Adjust oder Sep Adjust Wenn Ende Char-Attr == Absatzende ...
+        // Sep Adjust Wenn Ende Char-Attr == Absatzende ...
         if( (rDesc.nEndPos == nLineEnd) && (rDesc.nEndPos > rDesc.nStartPos) )
             rDesc.nEndPos--;            // ... dann um 1 Zeichen verkuerzen
     }


More information about the Libreoffice-commits mailing list