summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryogesh.bharate001 <yogesh.bharate@synerzip.com>2015-07-15 15:57:58 +0530
committerMichael Stahl <mstahl@redhat.com>2015-12-16 23:19:18 +0100
commite190f4c5899c302688e4600a128347356616da64 (patch)
treec4413e4c3d024165a479a4a5d461ea7a15148e86
parentee26cbc575206363e80752afa7a2fc11a4e62e3a (diff)
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@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 0f64e580ff08a6f76327f0b77f79abbbb044d009) Signed-off-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docxbin0 -> 21785 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx12
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
3 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx b/sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx
new file mode 100644
index 000000000000..567660b8e1d0
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 44865025a2fc..9c158eda2365 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 3f6fbcfeec83..c7287693e730 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";