diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-09-13 20:42:22 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-09-14 10:38:31 +0200 |
commit | 58cb4fc7d17ae5b339c5ed6ae139e6ef2433c927 (patch) | |
tree | b4acd1d8a81c9409eee63bb2d15dfa1eced1a01d /sw/qa/extras/odfexport | |
parent | 6b2433f3b66c1f118dabcd40924122deb2d4f204 (diff) |
tdf#150927: properly handle nesting in tables
This re-implements the relevant part of commit
35021cd56b3b4e38035804087f215c80085564be, to follow the same
recursion logic that is used in SwXMLExport::ExportTable.
Additionally, it found a place where XML was still emitted
when collecting autostyles (breaks were exported); fixed.
Change-Id: I3b7eed06e0eca9ad20304b45db4c3e9d72478c9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139901
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa/extras/odfexport')
-rw-r--r-- | sw/qa/extras/odfexport/data/table-in-frame-in-table-in-header-base.odt | bin | 0 -> 10398 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 14 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/table-in-frame-in-table-in-header-base.odt b/sw/qa/extras/odfexport/data/table-in-frame-in-table-in-header-base.odt Binary files differnew file mode 100644 index 000000000000..44dbf0bdec69 --- /dev/null +++ b/sw/qa/extras/odfexport/data/table-in-frame-in-table-in-header-base.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 84cd056d3e1d..fb3aa5e3412b 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -3204,6 +3204,20 @@ CPPUNIT_TEST_FIXTURE(Test, tdf135942) assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']", 2); } +CPPUNIT_TEST_FIXTURE(Test, tdf150927) +{ + // Similar to tdf135942 + + loadAndReload("table-in-frame-in-table-in-header-base.odt"); + // All table autostyles should be collected, including nested, and must not crash. + + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + xmlDocUniquePtr pXmlDoc = parseExport("styles.xml"); + + assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']", 2); +} + DECLARE_ODFEXPORT_TEST(testGutterLeft, "gutter-left.odt") { CPPUNIT_ASSERT_EQUAL(1, getPages()); |