summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYogesh Bharate <yogesh.bharate@synerzip.com>2014-06-13 16:15:16 +0530
committerMichael Stahl <mstahl@redhat.com>2014-07-11 13:23:45 +0200
commitde0d60327e2cd274f55e73417d3281e4a81b2271 (patch)
tree02e684446882d4e476b5a467226a8d5ac6695459
parent9f1f7a6bf2fa0aa6ebe2907c38a2e5b56b1dacac (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. Signed-off-by: Michael Stahl <mstahl@redhat.com> Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/9765 (cherry picked from commit 9f8785074512d6442fd97d67860fd625ac4d6bb1) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx 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.cxx43
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx18
5 files changed, 61 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 4d02d314ef72..c62b75050e81 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1657,6 +1657,49 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69644, "fdo69644.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 5);
}
+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");
+}
+
+
DECLARE_OOXMLEXPORT_TEST(testCp1000015, "cp1000015.odt")
{
// Redline and hyperlink end got exported in an incorrect order.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index edcd130e1d90..7b2db2e14adf 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4145,6 +4145,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";
@@ -4163,6 +4175,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";