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

Justin Luth justin_luth at sil.org
Thu Dec 22 05:17:04 UTC 2016


 sw/qa/extras/ooxmlimport/data/tdf75573_lostTable.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx              |   15 +++++++++++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx     |    8 ++++----
 3 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit 34324bff1252dc5a51c9408f9502654453f319b6
Author: Justin Luth <justin_luth at sil.org>
Date:   Wed Dec 21 07:32:14 2016 +0300

    tdf#75573 - relocate code: alternate stream already started
    
    moving this keeps the original fix and prevents losing a table
    in this unit test
    
    fixes regression commit ecea3431ca761369d8180a74eba2877533050516
    
    Change-Id: I5e94760649020ddf1c468d52b91aaf0521bbfdda
    Reviewed-on: https://gerrit.libreoffice.org/32269
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Tested-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/qa/extras/ooxmlimport/data/tdf75573_lostTable.docx b/sw/qa/extras/ooxmlimport/data/tdf75573_lostTable.docx
new file mode 100644
index 0000000..8ddb661
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf75573_lostTable.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index eb45e22..2372307 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -726,6 +726,21 @@ DECLARE_OOXMLIMPORT_TEST(testTdf75573, "tdf75573_page1frame.docx")
     CPPUNIT_ASSERT(!bProt);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf75573_lostTable, "tdf75573_lostTable.docx")
+{
+    uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("# of tables", 1, xTables->getCount() );
+
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("# of frames/shapes", 0, xDraws->getCount() );
+
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("# of paragraphs", 6, getParagraphs() );
+
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("# of pages", 3, getPages() );
+}
+
 DECLARE_OOXMLIMPORT_TEST(testMultiColumnSeparator, "multi-column-separator-with-line.docx")
 {
     uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1, "First data."), "TextSection");
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 9997f1a..07e008f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5282,16 +5282,16 @@ void DomainMapper_Impl::substream(Id rName,
     }
 #endif
 
+    //finalize any waiting frames before starting alternate streams
+    CheckUnregisteredFrameConversion();
+    ExecuteFrameConversion();
+
     appendTableManager();
     // Appending a TableManager resets its TableHandler, so we need to append
     // that as well, or tables won't be imported properly in headers/footers.
     appendTableHandler();
     getTableManager().startLevel();
 
-    //finalize any waiting frames before starting alternate streams
-    CheckUnregisteredFrameConversion();
-    ExecuteFrameConversion();
-
     //import of page header/footer
 
     switch( rName )


More information about the Libreoffice-commits mailing list