diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-17 16:33:06 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-17 18:04:08 +0200 |
commit | f61acf7ebb2365d29209310b56c371ccf63f153d (patch) | |
tree | 725107363ef5b417ce74a3a6eacd2f798ab4558a /writerperfect/qa | |
parent | 66b3970c946bd25647484ea1ac2c2e62bd9fb7b4 (diff) |
EPUB export: handle char format of hyperlinks
<text:a> child elements were not handled.
Change-Id: I7db9c005869934456ffbe5c36347b01cc76645b6
Reviewed-on: https://gerrit.libreoffice.org/43462
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect/qa')
-rw-r--r-- | writerperfect/qa/unit/EPUBExportTest.cxx | 12 | ||||
-rw-r--r-- | writerperfect/qa/unit/data/writer/epubexport/link-charformat.fodt | 13 |
2 files changed, 25 insertions, 0 deletions
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx index 374d9f730c23..850228c0a276 100644 --- a/writerperfect/qa/unit/EPUBExportTest.cxx +++ b/writerperfect/qa/unit/EPUBExportTest.cxx @@ -72,6 +72,7 @@ public: void testImage(); void testTable(); void testLink(); + void testLinkCharFormat(); CPPUNIT_TEST_SUITE(EPUBExportTest); CPPUNIT_TEST(testOutlineLevel); @@ -93,6 +94,7 @@ public: CPPUNIT_TEST(testImage); CPPUNIT_TEST(testTable); CPPUNIT_TEST(testLink); + CPPUNIT_TEST(testLinkCharFormat); CPPUNIT_TEST_SUITE_END(); }; @@ -466,6 +468,16 @@ void EPUBExportTest::testLink() assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", "https://libreoffice.org/"); } +void EPUBExportTest::testLinkCharFormat() +{ + createDoc("link-charformat.fodt", {}); + + mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml"); + // <span> was lost, link text having a char format was missing. + assertXPathContent(mpXmlDoc, "//xhtml:p/xhtml:a/xhtml:span", "https://libreoffice.org/"); + assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", "https://libreoffice.org/"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest); } diff --git a/writerperfect/qa/unit/data/writer/epubexport/link-charformat.fodt b/writerperfect/qa/unit/data/writer/epubexport/link-charformat.fodt new file mode 100644 index 000000000000..b158ce3dbb82 --- /dev/null +++ b/writerperfect/qa/unit/data/writer/epubexport/link-charformat.fodt @@ -0,0 +1,13 @@ +<?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:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:automatic-styles> + <style:style style:name="T1" style:family="text"> + <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/> + </style:style> + </office:automatic-styles> + <office:body> + <office:text> + <text:p>Before <text:a xlink:type="simple" xlink:href="https://libreoffice.org/"><text:span text:style-name="T1">https://libreoffice.org/</text:span></text:a> after.</text:p> + </office:text> + </office:body> +</office:document> |