[Libreoffice-commits] core.git: sw/qa sw/source

Vinaya Mandke vinaya.mandke at synerzip.com
Thu May 8 00:27:38 PDT 2014


 sw/qa/extras/ooxmlexport/data/fdo78284.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx    |   11 +++++++++++
 sw/source/filter/ww8/docxsdrexport.cxx      |    6 +++---
 3 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit d8b5bd541b946de2b3e70e8227baf6eb602ba8e2
Author: Vinaya Mandke <vinaya.mandke at synerzip.com>
Date:   Mon May 5 14:13:31 2014 +0530

    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

diff --git a/sw/qa/extras/ooxmlexport/data/fdo78284.docx b/sw/qa/extras/ooxmlexport/data/fdo78284.docx
new file mode 100644
index 0000000..92145eb
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 acd3d06..bea603d 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 563e124..f47a615 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -828,10 +828,10 @@ void DocxSdrExport::writeDiagramRels(uno::Reference<xml::dom::XDocument> 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;


More information about the Libreoffice-commits mailing list