summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-12-21 07:32:14 +0300
committerJustin Luth <justin_luth@sil.org>2016-12-22 05:16:41 +0000
commit34324bff1252dc5a51c9408f9502654453f319b6 (patch)
treecad91338b95efc2448ffbf44193660ef3b84f2c0
parente37563c304e52f1d2385868c9b33e0145493d2bd (diff)
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@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf75573_lostTable.docxbin0 -> 25590 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx15
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx8
3 files changed, 19 insertions, 4 deletions
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 000000000000..8ddb6619e0ad
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf75573_lostTable.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index eb45e2270a87..2372307b3778 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 9997f1a076f1..07e008feb32e 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 )