diff --git a/sw/qa/extras/ooxmlexport/data/fdo78284.docx b/sw/qa/extras/ooxmlexport/data/fdo78284.docx new file mode 100644 index 000000000000..92145eb127c6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78284.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index acd3d0648c3b..bea603d886df 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3260,6 +3260,17 @@ DECLARE_OOXMLEXPORT_TEST(testPageBreakInFirstPara,"fdo77727.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br","type","page"); } +DECLARE_OOXMLEXPORT_TEST(testFDO78284, "fdo78284.docx") +{ + xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + + if (!pXmlDoc) + return; + assertXPath(pXmlDoc,"/ContentType:Types/ContentType:Override[@PartName='/word/media/OOXDiagramDataRels1_0.png']", + "ContentType", + "image/png"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 563e124a9b23..f47a61514330 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -828,10 +828,10 @@ void DocxSdrExport::writeDiagramRels(uno::Reference xDom, diagramDataRelTuple[0] >>= sRelId; diagramDataRelTuple[2] >>= sExtension; OUString sContentType; - if (sExtension == ".jpeg") - sContentType = "image/jpeg"; - else if (sExtension == ".WMF") + if (sExtension.equalsIgnoreAsciiCase(".WMF")) sContentType = "image/x-wmf"; + else + sContentType = OUString("image/") + sExtension.copy(1); sRelId = sRelId.copy(3); StreamDataSequence dataSeq;