summaryrefslogtreecommitdiff
path: root/writerperfect/qa/unit
diff options
context:
space:
mode:
Diffstat (limited to 'writerperfect/qa/unit')
-rw-r--r--writerperfect/qa/unit/EPUBExportTest.cxx11
-rw-r--r--writerperfect/qa/unit/data/writer/epubexport/image-link.fodt2
-rw-r--r--writerperfect/qa/unit/data/writer/epubexport/link-invalid.odtbin0 -> 9554 bytes
3 files changed, 12 insertions, 1 deletions
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx
index f52667a9b6ce..5a1c21c0e48f 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -85,6 +85,7 @@ public:
void testTableCellWidth();
void testTableRowHeight();
void testLink();
+ void testLinkInvalid();
void testLinkCharFormat();
void testLinkNamedCharFormat();
void testTableWidth();
@@ -129,6 +130,7 @@ public:
CPPUNIT_TEST(testTableCellWidth);
CPPUNIT_TEST(testTableRowHeight);
CPPUNIT_TEST(testLink);
+ CPPUNIT_TEST(testLinkInvalid);
CPPUNIT_TEST(testLinkCharFormat);
CPPUNIT_TEST(testLinkNamedCharFormat);
CPPUNIT_TEST(testTableWidth);
@@ -662,6 +664,15 @@ void EPUBExportTest::testLink()
assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", "https://libreoffice.org/");
}
+void EPUBExportTest::testLinkInvalid()
+{
+ createDoc("link-invalid.odt", {});
+
+ mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+ // This was 1, invalid relative link was not filtered out.
+ assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", 0);
+}
+
void EPUBExportTest::testLinkCharFormat()
{
createDoc("link-charformat.fodt", {});
diff --git a/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt b/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt
index 9414e36fd723..0796cea3e4b1 100644
--- a/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt
+++ b/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt
@@ -16,7 +16,7 @@
</office:master-styles>
<office:body>
<office:text>
- <text:p text:style-name="Standard"><draw:a xlink:type="simple" xlink:href="meta.cover-image.png"><draw:frame draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char" svg:width="1.806cm" svg:height="1.806cm" draw:z-index="0"><draw:image loext:mime-type="image/png"><office:binary-data>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAAAFz
+ <text:p text:style-name="Standard"><draw:a xlink:type="simple" xlink:href="http://libreoffice.org/"><draw:frame draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char" svg:width="1.806cm" svg:height="1.806cm" draw:z-index="0"><draw:image loext:mime-type="image/png"><office:binary-data>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAAAFz
UkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
AAJiS0dEAACqjSMyAAAACW9GRnMAAAAGAAAAAAAMc1XTAAAACXBIWXMAAA3XAAAN1wFCKJt4
AAAACXZwQWcAAABMAAAAQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
diff --git a/writerperfect/qa/unit/data/writer/epubexport/link-invalid.odt b/writerperfect/qa/unit/data/writer/epubexport/link-invalid.odt
new file mode 100644
index 000000000000..3bbbdeb921e3
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/link-invalid.odt
Binary files differ