diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-05 11:16:32 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-05 16:45:42 +0200 |
commit | 35021cd56b3b4e38035804087f215c80085564be (patch) | |
tree | 008898c50092fb5b81421a5174b7c9fcd60fb9d5 /sw/qa/extras | |
parent | 3d0eebe0f1471db6f0b9a472a582f51c8c37753b (diff) |
tdf#124470: Split export of table autostyles out from collection phase
This allows to call collectAutoStyles where required (e.g. when enumerating
used fonts), without side effect of writing table styles XML inside the call,
out of place.
Change-Id: Ida05e373eb8502590c43e2b0e85c3b0c1107c551
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100153
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/odfexport/data/tdf124470TableAndEmbeddedUsedFonts.odt | bin | 0 -> 10880 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/tdf124470TableAndEmbeddedUsedFonts.odt b/sw/qa/extras/odfexport/data/tdf124470TableAndEmbeddedUsedFonts.odt Binary files differnew file mode 100644 index 000000000000..21969e9e5485 --- /dev/null +++ b/sw/qa/extras/odfexport/data/tdf124470TableAndEmbeddedUsedFonts.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 443492c4b42b..293252176a05 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -2539,5 +2539,23 @@ DECLARE_ODFEXPORT_TEST(testPageContentBottom, "page-content-bottom.odt") CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int16>(xShape, "VertOrientRelation")); } +DECLARE_ODFEXPORT_TEST(tdf124470, "tdf124470TableAndEmbeddedUsedFonts.odt") +{ + // Table styles were exported out of place, inside font-face-decls. + // Without the fix in place, this will fail already in ODF validation: + // "content.xml[2,2150]: Error: tag name "style:style" is not allowed. Possible tag names are: <font-face>" + + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc, "/office:document-content/office:font-face-decls/style:style", 0); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:family='table']", 1); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:family='table-column']", 2); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:family='paragraph']", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |