[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sw/qa sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Nov 23 08:15:53 UTC 2018


 sw/qa/extras/ooxmlexport/data/tdf121597.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx  |   15 +++++++++++++
 sw/source/filter/ww8/ww8atr.cxx             |   31 ++--------------------------
 3 files changed, 18 insertions(+), 28 deletions(-)

New commits:
commit 626504ee27d853d70a5a8b3b62d69313b9b6eb98
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Wed Nov 21 17:18:39 2018 +0100
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Fri Nov 23 09:15:29 2018 +0100

    tdf#121597 DOCX: don't export empty paragraphs at tracked deletion
    
    of non-empty multiple paragraphs. Complete the fix for
    "tdf#115521 DOCX export: keep empty paragraphs in tracked deletion"
    in commit 2cdc870a7ee82d0faf35cdb5b2bf4e687cfd2b8d
    
    This solves the regression reported in tdf#121109
    "FILESAVE: Page break is added after removed paragraph".
    
    Change-Id: Ic3446e2a2118e604a7a4d269c8fed1f9f157846f
    Reviewed-on: https://gerrit.libreoffice.org/63731
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit d1ee27cf9b83ad9b69d1ee00e2e8969fb35446c9)
    Reviewed-on: https://gerrit.libreoffice.org/63825

diff --git a/sw/qa/extras/ooxmlexport/data/tdf121597.odt b/sw/qa/extras/ooxmlexport/data/tdf121597.odt
new file mode 100644
index 000000000000..760b46e76379
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121597.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 40e9fb19c3ca..c4a76e33ad92 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -815,6 +815,21 @@ DECLARE_OOXMLEXPORT_TEST(testTdf58944RepeatingTableHeader, "tdf58944-repeating-t
                          parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf121597TrackedDeletionOfMultipleParagraphs, "tdf121597.odt")
+{
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+    if (!pXmlDoc)
+        return;
+
+    // check paragraphs with removed paragraph mark
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:del");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:del");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:del");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:rPr/w:del");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:rPr/w:del");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d8411eed8796..b911ef83b6a7 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -5505,37 +5505,12 @@ const SwRedlineData* AttributeOutputBase::GetParagraphMarkerRedline( const SwTex
         if ( pRedl->GetRedlineData().GetType() != aRedlineType )
             continue;
 
-        const SwPosition* pCheckedEnd = pRedl->End();
-        const SwPosition* pCheckedStt = pRedl->Start();
-        sal_uLong uStartNodeIndex = pCheckedStt->nNode.GetIndex();
-        sal_uLong uStartCharIndex = pCheckedStt->nContent.GetIndex();
-        sal_uLong uEndNodeIndex   = pCheckedEnd->nNode.GetIndex();
-        sal_uLong uEndCharIndex   = pCheckedEnd->nContent.GetIndex();
+        sal_uLong uStartNodeIndex = pRedl->Start()->nNode.GetIndex();
+        sal_uLong uEndNodeIndex   = pRedl->End()->nNode.GetIndex();
         sal_uLong uNodeIndex = rNode.GetIndex();
 
         if( uStartNodeIndex <= uNodeIndex && uNodeIndex < uEndNodeIndex )
-        {
-            // Maybe add here a check that also the start & end of the redline is the entire paragraph
-            if ( ( uStartNodeIndex < uEndNodeIndex ) &&
-                 // check start:
-                 // 1. start in the same node
-                 (( uStartNodeIndex == uNodeIndex &&
-                    uStartCharIndex == static_cast<sal_uLong>(rNode.Len()) ) ||
-                 // 2. or in a previous node
-                    uStartNodeIndex < uNodeIndex
-                 ) &&
-                 // check end:
-                 // 1. end in the same node
-                 (( uEndNodeIndex == (uNodeIndex + 1) &&
-                    uEndCharIndex == 0) ||
-                 // 2. or end in after that
-                    uEndNodeIndex > (uNodeIndex + 1)
-                 )
-               )
-            {
-                return &( pRedl->GetRedlineData() );
-            }
-        }
+            return &( pRedl->GetRedlineData() );
     }
     return nullptr;
 }


More information about the Libreoffice-commits mailing list