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

Mike Kaganski mike.kaganski at collabora.com
Tue Jul 3 16:58:47 UTC 2018


 sw/qa/extras/ooxmlexport/data/tdf107969.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx   |    7 +++++++
 sw/source/filter/ww8/docxexport.cxx          |    6 ++++++
 3 files changed, 13 insertions(+)

New commits:
commit 336d052a8db24ec9d19cec47c54ff76ed35a413c
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Mon Jun 18 14:09:56 2018 +1000

    tdf#107969: use proper serializer for VML in footnotes/endnotes
    
    Change-Id: Ie0e062fab0ae1a63094655cc0f6bee958b4c1087
    Reviewed-on: https://gerrit.libreoffice.org/55978
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit c67b7d795589aaf8f3396a379ef348bd650cb2dc)
    Reviewed-on: https://gerrit.libreoffice.org/56754

diff --git a/sw/qa/extras/ooxmlexport/data/tdf107969.docx b/sw/qa/extras/ooxmlexport/data/tdf107969.docx
new file mode 100644
index 000000000000..e674bcb5db72
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf107969.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index eb42cee254a2..e086b1998aa7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -381,6 +381,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116801, "tdf116801.docx")
     CPPUNIT_ASSERT_EQUAL(OUString("D1"), xCell->getString());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf107969, "tdf107969.docx")
+{
+    // A VML object in a footnote's tracked changes caused write past end of document.xml at export to docx.
+    // After that, importing after export failed with
+    // SAXParseException: '[word/document.xml line 2]: Extra content at the end of the document', Stream 'word/document.xml'.
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 549193949962..68a04ba937d7 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -682,11 +682,14 @@ void DocxExport::WriteFootnotesEndnotes()
         m_pAttrOutput->SetSerializer( pFootnotesFS );
         // tdf#99227
         m_pSdrExport->setSerializer( pFootnotesFS );
+        // tdf#107969
+        m_pVMLExport->SetFS(pFootnotesFS);
 
         // do the work
         m_pAttrOutput->FootnotesEndnotes( true );
 
         // switch the serializer back
+        m_pVMLExport->SetFS(m_pDocumentFS);
         m_pSdrExport->setSerializer( m_pDocumentFS );
         m_pAttrOutput->SetSerializer( m_pDocumentFS );
     }
@@ -706,11 +709,14 @@ void DocxExport::WriteFootnotesEndnotes()
         m_pAttrOutput->SetSerializer( pEndnotesFS );
         // tdf#99227
         m_pSdrExport->setSerializer( pEndnotesFS );
+        // tdf#107969
+        m_pVMLExport->SetFS(pEndnotesFS);
 
         // do the work
         m_pAttrOutput->FootnotesEndnotes( false );
 
         // switch the serializer back
+        m_pVMLExport->SetFS(m_pDocumentFS);
         m_pSdrExport->setSerializer( m_pDocumentFS );
         m_pAttrOutput->SetSerializer( m_pDocumentFS );
     }


More information about the Libreoffice-commits mailing list