summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/htmlexport/data/tdf162426_image_with_wrap_none.fodt20
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx16
2 files changed, 36 insertions, 0 deletions
diff --git a/sw/qa/extras/htmlexport/data/tdf162426_image_with_wrap_none.fodt b/sw/qa/extras/htmlexport/data/tdf162426_image_with_wrap_none.fodt
new file mode 100644
index 000000000000..9dc1f13101bd
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/tdf162426_image_with_wrap_none.fodt
@@ -0,0 +1,20 @@
+<?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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:styles>
+ <style:style style:name="Graphics" style:family="graphic"/>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics">
+ <style:graphic-properties style:wrap="none"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:body>
+ <office:text>
+ <text:p><draw:frame draw:style-name="fr1" text:anchor-type="char" svg:y="0" svg:width="1cm" svg:height="1cm"><draw:image draw:mime-type="image/png">
+ <office:binary-data>iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX///+nxBvIAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==</office:binary-data>
+ </draw:image>
+ </draw:frame></text:p>
+ </office:text>
+ </office:body>
+</office:document> \ No newline at end of file
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 5de5ef5f155f..df5d90c30855 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -3432,6 +3432,22 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_162282)
CPPUNIT_ASSERT_EQUAL(correctData, emfData);
}
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testHTML_162426)
+{
+ // Given a document with an image with style:wrap="none":
+ createSwDoc("tdf162426_image_with_wrap_none.fodt");
+ // Before the fix, an assertion failed in HtmlWriter::attribute when exporting to HTML :
+ ExportToHTML();
+
+ xmlDocUniquePtr pDoc = parseXml(maTempFile);
+ CPPUNIT_ASSERT(pDoc);
+
+ // Before the fix, the 'border' attribute was written after the 'img' tag was already closed,
+ // so without the asserion, this would fail with
+ // - In <>, XPath '/html/body/p/img' no attribute 'border' exist
+ assertXPath(pDoc, "/html/body/p/img"_ostr, "border"_ostr, u"0"_ustr);
+}
+
} // end of anonymous namespace
CPPUNIT_PLUGIN_IMPLEMENT();