fdo#78284 Content-type of ".png" images in Smart Art
Content-type for 'png' images was not getting added in [Content_Types].xml. This was as only 'jpeg' and 'wmf' extensions were handled. Modified DocxSdrExport::writeDiagramRels to handle all types of extensions. Added UT for the same. Reviewed on: https://gerrit.libreoffice.org/9252 Change-Id: I5e068d4db14f3a43be08a4b7c9bf265f388bf356
This commit is contained in:
parent
9beda5ab8f
commit
d8b5bd541b
BIN
sw/qa/extras/ooxmlexport/data/fdo78284.docx
Normal file
BIN
sw/qa/extras/ooxmlexport/data/fdo78284.docx
Normal file
Binary file not shown.
@ -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");
|
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
|
#endif
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
@ -828,10 +828,10 @@ void DocxSdrExport::writeDiagramRels(uno::Reference<xml::dom::XDocument> xDom,
|
|||||||
diagramDataRelTuple[0] >>= sRelId;
|
diagramDataRelTuple[0] >>= sRelId;
|
||||||
diagramDataRelTuple[2] >>= sExtension;
|
diagramDataRelTuple[2] >>= sExtension;
|
||||||
OUString sContentType;
|
OUString sContentType;
|
||||||
if (sExtension == ".jpeg")
|
if (sExtension.equalsIgnoreAsciiCase(".WMF"))
|
||||||
sContentType = "image/jpeg";
|
|
||||||
else if (sExtension == ".WMF")
|
|
||||||
sContentType = "image/x-wmf";
|
sContentType = "image/x-wmf";
|
||||||
|
else
|
||||||
|
sContentType = OUString("image/") + sExtension.copy(1);
|
||||||
sRelId = sRelId.copy(3);
|
sRelId = sRelId.copy(3);
|
||||||
|
|
||||||
StreamDataSequence dataSeq;
|
StreamDataSequence dataSeq;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user