summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-07-24 15:46:06 +0200
committerMichael Stahl <mstahl@redhat.com>2017-07-27 13:53:23 +0200
commit01b92d73b6efd638e025d4b0520c996d5e417937 (patch)
tree85c9683c0dce1a806ba05aa539c5d0c6c74d5291 /sw
parent07838a39305d0ea95a43766cdeee53545ad80cec (diff)
tdf#109202 Add mimetype to image element
Browsers don't recognize base64 svg if the mimetype is missing. So we add the image mimetype to our flat odf export, which the xhtml export uses and transforms it into an xhtml document. Change-Id: I21aafdb97b4104e14e2d40abda73a526bb37041a Reviewed-on: https://gerrit.libreoffice.org/40371 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Reviewed-on: https://gerrit.libreoffice.org/40478 Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/odfexport/data/image-mimetype.odtbin0 -> 88597 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx11
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/image-mimetype.odt b/sw/qa/extras/odfexport/data/image-mimetype.odt
new file mode 100644
index 000000000000..4c4924a1b254
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/image-mimetype.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 13b9a368fb02..012cbf1893ed 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1578,6 +1578,17 @@ DECLARE_ODFEXPORT_TEST(testTableStyles5, "table_styles_5.odt")
}
}
+DECLARE_ODFEXPORT_TEST(testImageMimetype, "image-mimetype.odt")
+{
+ // Test that the loext:mimetype attribute is written for exported images, tdf#109202
+ if (xmlDocPtr pXmlDoc = parseExport("content.xml"))
+ {
+ // Original image (svg)
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@loext:mime-type='image/svg+xml']");
+ }
+}
+
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();