diff options
-rw-r--r-- | writerperfect/qa/unit/EPUBExportTest.cxx | 10 | ||||
-rw-r--r-- | writerperfect/qa/unit/data/writer/epubexport/table.fodt | 39 |
2 files changed, 49 insertions, 0 deletions
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx index 5697e3c58c64..28349d8bf619 100644 --- a/writerperfect/qa/unit/EPUBExportTest.cxx +++ b/writerperfect/qa/unit/EPUBExportTest.cxx @@ -70,6 +70,7 @@ public: void testSection(); void testList(); void testImage(); + void testTable(); CPPUNIT_TEST_SUITE(EPUBExportTest); CPPUNIT_TEST(testOutlineLevel); @@ -89,6 +90,7 @@ public: CPPUNIT_TEST(testSection); CPPUNIT_TEST(testList); CPPUNIT_TEST(testImage); + CPPUNIT_TEST(testTable); CPPUNIT_TEST_SUITE_END(); }; @@ -441,6 +443,14 @@ void EPUBExportTest::testImage() assertXPath(mpXmlDoc, "//xhtml:p/xhtml:img", 1); } +void EPUBExportTest::testTable() +{ + createDoc("table.fodt", {}); + + mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml"); + assertXPath(mpXmlDoc, "//xhtml:table/xhtml:tbody/xhtml:tr/xhtml:td", 4); +} + CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest); } diff --git a/writerperfect/qa/unit/data/writer/epubexport/table.fodt b/writerperfect/qa/unit/data/writer/epubexport/table.fodt new file mode 100644 index 000000000000..9135c902f5fc --- /dev/null +++ b/writerperfect/qa/unit/data/writer/epubexport/table.fodt @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:automatic-styles> + <style:style style:name="Table1" style:family="table"> + <style:table-properties style:width="17.59cm" table:align="margins"/> + </style:style> + <style:style style:name="Table1.A" style:family="table-column"> + <style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32767*"/> + </style:style> + <style:style style:name="Table1.A1" style:family="table-cell"> + <style:table-cell-properties fo:padding="0.097cm"/> + </style:style> + </office:automatic-styles> + <office:body> + <office:text> + <text:p>Before</text:p> + <table:table table:name="Table1" table:style-name="Table1"> + <table:table-column table:style-name="Table1.A" table:number-columns-repeated="2"/> + <table:table-row> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>A1</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>B1</text:p> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>A2</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>B2</text:p> + </table:table-cell> + </table:table-row> + </table:table> + <text:p>After</text:p> + </office:text> + </office:body> +</office:document> |