summaryrefslogtreecommitdiff
path: root/writerperfect/qa/unit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-08 15:39:14 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-08 19:19:23 +0200
commit6e260dbebc91f137d6f797dd10d64e53a063dc0b (patch)
treea0c74c73b2df4b47e51dece0b17ddede0d4d98fc /writerperfect/qa/unit
parent1079893be5593268eff0867be87b0291546d88c7 (diff)
EPUB export: handle section content
Just the minimum so content is not completely ignored on export. Change-Id: I2880780ed3ce5d1dd15adbd9222296f52a5e7c3d Reviewed-on: https://gerrit.libreoffice.org/42115 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect/qa/unit')
-rw-r--r--writerperfect/qa/unit/EPUBExportTest.cxx11
-rw-r--r--writerperfect/qa/unit/data/writer/epubexport/section.fodt12
2 files changed, 23 insertions, 0 deletions
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx
index 06278d19eb81..706536c9423a 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -65,6 +65,7 @@ public:
void testLineBreak();
void testEscape();
void testParaCharProps();
+ void testSection();
CPPUNIT_TEST_SUITE(EPUBExportTest);
CPPUNIT_TEST(testOutlineLevel);
@@ -81,6 +82,7 @@ public:
CPPUNIT_TEST(testLineBreak);
CPPUNIT_TEST(testEscape);
CPPUNIT_TEST(testParaCharProps);
+ CPPUNIT_TEST(testSection);
CPPUNIT_TEST_SUITE_END();
};
@@ -362,6 +364,15 @@ void EPUBExportTest::testParaCharProps()
assertCss(aCssDoc, aMiddle, " font-weight: bold;");
}
+void EPUBExportTest::testSection()
+{
+ createDoc("section.fodt", {});
+
+ mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+ // This was "After.", i.e. in-section content was ignored.
+ assertXPathContent(mpXmlDoc, "//xhtml:p[2]/xhtml:span", "In section.");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
}
diff --git a/writerperfect/qa/unit/data/writer/epubexport/section.fodt b/writerperfect/qa/unit/data/writer/epubexport/section.fodt
new file mode 100644
index 000000000000..84fb6d2ae940
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/section.fodt
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:body>
+ <office:text>
+ <text:p>Before.</text:p>
+ <text:section text:name="Section1">
+ <text:p>In section.</text:p>
+ </text:section>
+ <text:p>After.</text:p>
+ </office:text>
+ </office:body>
+</office:document>