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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Mar 2 13:33:50 UTC 2019


 sw/qa/extras/ooxmlexport/data/tdf116084.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx    |   13 +++++++++++++
 sw/source/core/doc/DocumentRedlineManager.cxx |    9 +++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 7a810d6a9fb79a24d00e5dbd8e1223e6f8b09677
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Wed Feb 27 23:16:26 2019 +0100
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Sat Mar 2 14:33:28 2019 +0100

    tdf#116084 DOCX track changes: fix w:del within w:ins
    
    Instead of showing the tracked deletion as tracked
    insertion, losing the original and actual text contents,
    now w:del within w:ins is imported as tracked deletion
    correctly.
    
    Change-Id: I40694a3a73ad4cd443254167462520c17b1bd484
    Reviewed-on: https://gerrit.libreoffice.org/68478
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf116084.docx b/sw/qa/extras/ooxmlexport/data/tdf116084.docx
new file mode 100644
index 000000000000..61a9fdb13a60
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf116084.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 71189d4e5e9b..c277b9efc4dd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -941,6 +941,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123189_tableBackground, "table-black_fill.docx")
     CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, Color(getProperty<sal_uInt32>(xCell, "BackColor")));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf116084, "tdf116084.docx")
+{
+    // tracked line is not a single text portion: w:del is recognized within w:ins
+    CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 1 )->getString());
+    CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 1), "RedlineType"));
+    CPPUNIT_ASSERT_EQUAL( OUString( "There " ), getRun( getParagraph( 1 ), 2 )->getString());
+    CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 4 )->getString());
+    CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 4), "RedlineType"));
+    CPPUNIT_ASSERT_EQUAL( OUString( "must" ), getRun( getParagraph( 1 ), 5 )->getString());
+}
+
+
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index f01ab4b77fb1..c7d473c29d3a 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1473,8 +1473,13 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall
 
                                 bCompress = true;
                             }
-                            delete pNewRedl;
-                            pNewRedl = nullptr;
+                            if( !bCallDelete && *pEnd == *pREnd )
+                                pRedl->SetEnd( *pStt, pREnd );
+                            else
+                            {
+                                delete pNewRedl;
+                                pNewRedl = nullptr;
+                            }
                             break;
 
                         case SwComparePosition::Outside:


More information about the Libreoffice-commits mailing list