sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx             |   12 ++++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx          |    6 ++++++
 3 files changed, 18 insertions(+)

New commits:
commit 0f64e580ff08a6f76327f0b77f79abbbb044d009
Author: yogesh.bharate001 <yogesh.bhar...@synerzip.com>
Date:   Wed Jul 15 15:57:58 2015 +0530

    tdf#92754: Excel Chart content type is not exported properly.
    
    Problem Description :
    - Excel chart contenttype is not exported properly,
    it exported the .xls file as .bin file.
    - Due to this when we open the roundtrip file back in MS Office,
    the embedded excel chart is not open and gives ERROR.
    
    Solution : Added support for embedded .xls for docx file.
    
    Change-Id: I16e18ffa4f6c72526665ff9d34d6c6053278c2c5
    Reviewed-on: https://gerrit.libreoffice.org/17066
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx 
b/sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx
new file mode 100644
index 0000000..567660b
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index a85f202..238cbde 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -797,7 +797,19 @@ DECLARE_OOXMLEXPORT_TEST(testSimpleSdts, 
"simple-sdts.docx")
     assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:picture", 1);
     assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:group", 1);
     assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:citation", 1);
+}
 
+DECLARE_OOXMLEXPORT_TEST(testEmbeddedExcelChart, "EmbeddedExcelChart.docx")
+{
+    xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+    if (!pXmlDoc) // only test the export, not initial import
+       return;
+
+    assertXPath(pXmlDoc,
+        
"/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.xls']",
+        "ContentType",
+        "application/vnd.ms-excel");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf83227, "tdf83227.docx")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index bcfbf61..4c1ca92 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4814,6 +4814,12 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, 
const Size& rSize, const S
         sRelationType = 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";;
         sFileExtension = "doc";
     }
+    else if( sProgID == "Excel.Chart.8" )
+    {
+        sMediaType = "application/vnd.ms-excel";
+        sRelationType = 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";;
+        sFileExtension = "xls";
+    }
     else
     {
         sMediaType = "application/vnd.openxmlformats-officedocument.oleObject";
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to