[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/qa sw/source

yogesh.bharate001 yogesh.bharate at synerzip.com
Thu Dec 17 01:59:39 PST 2015


 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 e190f4c5899c302688e4600a128347356616da64
Author: yogesh.bharate001 <yogesh.bharate at 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 <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit 0f64e580ff08a6f76327f0b77f79abbbb044d009)
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

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 4486502..9c158ed 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -800,7 +800,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 3f6fbcf..c728769 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4763,6 +4763,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";


More information about the Libreoffice-commits mailing list