summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYogesh Bharate <yogesh.bharate@synerzip.com>2014-06-13 16:15:16 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-20 10:03:42 +0200
commit9f8785074512d6442fd97d67860fd625ac4d6bb1 (patch)
tree6c4b9fdb052e431e1173f5e9d957e17f5dc52ffc
parent7ea1bbe712cef48a97faffdf03b45f2812a93e62 (diff)
fdo#79968: & fdo#79969: Fix for embedded powerpoint & excel sheet in docx.
Problem Description: fdo#79968: 1. Document contains embedded powerpoint in docx. 2. After RT, embedded powerpoint object is not preserved. 3. In this case, .sldx is get converted to .bin due to this powerpoint slides is getting converted to picture. fdo#79969: 1. Document contains embedded excel work sheet. 2. After RT, embedded excel sheet is not preserved. 3. In this case, .xlsm is get converted to .xls. 4. Similar case happened with binary excel work sheet. Implementation: Added sMediaType, sRelationType & sFileExtension for embedded excel sheet, binary excel sheet & powerpoint slide. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/9765 Change-Id: I8f94e3f9293f2ac98b61f919d60ca556695b26c2
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo79968.docxbin0 -> 51338 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docxbin0 -> 25622 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docxbin0 -> 26157 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx42
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx18
5 files changed, 60 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79968.docx b/sw/qa/extras/ooxmlexport/data/fdo79968.docx
new file mode 100644
index 000000000000..2da7ddcc4f6f
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo79968.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx
new file mode 100644
index 000000000000..0e413992be0e
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx
new file mode 100644
index 000000000000..6fd11f397432
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 5b0244e22209..7368b4607a6d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3648,6 +3648,48 @@ DECLARE_OOXMLEXPORT_TEST(testFDO78590, "FDO78590.docx")
assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "h", "1669" );
}
+DECLARE_OOXMLEXPORT_TEST(testfdo79968_sldx, "fdo79968.docx")
+{
+ // This UT for DOCX embedded with powerpoint slide
+ xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+ if (!pXmlDoc)
+ return;
+
+ assertXPath(pXmlDoc,
+ "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.presentationml.slide']",
+ "PartName",
+ "/word/embeddings/oleObject1.sldx");
+}
+
+DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx")
+{
+ // This UT for DOCX embedded with binary excel work sheet.
+ xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+ if (!pXmlDoc)
+ return;
+
+ assertXPath(pXmlDoc,
+ "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.binary.macroEnabled.12']",
+ "PartName",
+ "/word/embeddings/oleObject1.xlsb");
+}
+
+DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx")
+{
+ // This UT for DOCX embedded with excel work sheet.
+ xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
+
+ if (!pXmlDoc)
+ return;
+
+ assertXPath(pXmlDoc,
+ "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.macroEnabled.12']",
+ "PartName",
+ "/word/embeddings/oleObject1.xlsm");
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index ebaaecb97aae..06230f428181 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4328,6 +4328,18 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "xlsx";
}
+ else if(sProgID.startsWith("Excel.SheetBinaryMacroEnabled.12") )
+ {
+ sMediaType = "application/vnd.ms-excel.sheet.binary.macroEnabled.12";
+ sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
+ sFileExtension = "xlsb";
+ }
+ else if( sProgID.startsWith("Excel.SheetMacroEnabled.12") )
+ {
+ sMediaType = "application/vnd.ms-excel.sheet.macroEnabled.12";
+ sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
+ sFileExtension = "xlsm";
+ }
else if( sProgID.startsWith("Excel.Sheet") )
{
sMediaType = "application/vnd.ms-excel";
@@ -4346,6 +4358,12 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
sFileExtension = "ppt";
}
+ else if (sProgID.startsWith("PowerPoint.Slide.12"))
+ {
+ sMediaType = "application/vnd.openxmlformats-officedocument.presentationml.slide";
+ sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
+ sFileExtension = "sldx";
+ }
else
{
sMediaType = "application/vnd.openxmlformats-officedocument.oleObject";