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

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 2 14:25:18 UTC 2020


 sw/qa/extras/ooxmlexport/data/tdf136850.docx      |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx        |    7 +++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   18 ++++++++++++++++--
 3 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit c37f2b927715ebbeffcc1d7a1e9d646f1611c4ec
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Fri Oct 2 12:55:04 2020 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Fri Oct 2 16:24:32 2020 +0200

    tdf#136850 DOCX: fix change tracking in floating tables
    
    Deleted text still reappeared as normal text in floating
    tables in the case of combination with tracked paragraph
    property changes.
    
    Follow-up of commit 288db6eb47fbbd2b3ca34ffea0686d8ed8ed9be9
    (tdf#132271 DOCX: import change tracking in floating tables)
    and commit 464a7b0631335a8f8729512b8c27f864747f56a7
    (tdf#136667 DOCX import: fix crash of floating tables).
    
    Change-Id: I2c8f63054520ce28306c063ef638756f7d8342e9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103832
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf136850.docx b/sw/qa/extras/ooxmlexport/data/tdf136850.docx
new file mode 100644
index 000000000000..e94a66208e0d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf136850.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index e7b996562803..e45d99c6d2d7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -998,6 +998,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf136667, "tdf136667.docx")
     assertXPath(pXmlDoc, "//w:ins", 4);
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf136850, "tdf136850.docx")
+{
+    xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+    // import change tracking in floating tables
+    assertXPath(pXmlDoc, "//w:del");
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128156, "tdf128156.docx")
 {
     xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index cd985e4fd995..cd78ab36bd0a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -6809,11 +6809,12 @@ void DomainMapper_Impl::ExecuteFrameConversion()
 {
     if( m_xFrameStartRange.is() && m_xFrameEndRange.is() && !m_bDiscardHeaderFooter )
     {
+        std::vector<sal_Int32> redPos, redLen;
         try
         {
             uno::Reference< text::XTextAppendAndConvert > xTextAppendAndConvert( GetTopTextAppend(), uno::UNO_QUERY_THROW );
             // convert redline ranges to cursor movement and character length
-            std::vector<sal_Int32> redPos, redLen;
+
             for( size_t i = 0; i < aFramedRedlines.size(); i+=3)
             {
                 uno::Reference< text::XTextRange > xRange;
@@ -6863,7 +6864,20 @@ void DomainMapper_Impl::ExecuteFrameConversion()
         }
 
         m_bIsActualParagraphFramed = false;
-        aFramedRedlines.clear();
+
+        if (redPos.size() == aFramedRedlines.size()/3)
+        {
+            for( sal_Int32 i = aFramedRedlines.size() - 1; i >= 0; --i)
+            {
+                // keep redlines of floating tables to process them in CloseSectionGroup()
+                if ( redPos[i/3] != -1 )
+                {
+                    aFramedRedlines.erase(aFramedRedlines.begin() + i);
+                }
+            }
+        }
+        else
+            aFramedRedlines.clear();
     }
     m_xFrameStartRange = nullptr;
     m_xFrameEndRange = nullptr;


More information about the Libreoffice-commits mailing list