summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-21 14:44:51 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-22 12:15:28 +0200
commitdf44f5013867047abd9d6ebf02acda5a30873cea (patch)
treee97361ef951c1e495aee78f0a89384ed677ab83d /writerperfect
parent5e1be0161918fac4f7ce642e3b4a6ba767658124 (diff)
EPUB export: add table testcase
Fails without commit 54ad8ad0f0ce22299d28b4ec09eea26ad2691642 (EPUB export: initial table support, 2017-08-22). Change-Id: Ie8d793a8851dba894c57f2071e1b4717fa1e17af Reviewed-on: https://gerrit.libreoffice.org/42590 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/qa/unit/EPUBExportTest.cxx10
-rw-r--r--writerperfect/qa/unit/data/writer/epubexport/table.fodt39
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>