summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-07-24 15:46:06 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-07-27 09:02:20 +0200
commit4469b29faeb8dbf7793a5d81d9c5ddebacf3015f (patch)
tree5d88d54b7c9af5504d7bf287b6f81a8aed083bf2 /sw/qa
parent7f381be4d3261149a5b54048f9605fab0340c221 (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>
Diffstat (limited to 'sw/qa')
-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 38ce6a5596c6..bbebd6b24afc 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1644,6 +1644,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();