diff options
author | Yogesh Bharate <yogesh.bharate@synerzip.com> | 2014-06-13 16:15:16 +0530 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-07-11 13:23:45 +0200 |
commit | de0d60327e2cd274f55e73417d3281e4a81b2271 (patch) | |
tree | 02e684446882d4e476b5a467226a8d5ac6695459 | |
parent | 9f1f7a6bf2fa0aa6ebe2907c38a2e5b56b1dacac (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.docx | bin | 0 -> 51338 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx | bin | 0 -> 25622 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx | bin | 0 -> 26157 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 43 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 18 |
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 Binary files differnew file mode 100644 index 000000000000..2da7ddcc4f6f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79968.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx Binary files differnew file mode 100644 index 000000000000..0e413992be0e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx Binary files differnew file mode 100644 index 000000000000..6fd11f397432 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx 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"; |