diff options
author | Yogesh Bharate <yogesh.bharate@synerzip.com> | 2014-06-13 16:15:16 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-20 10:03:42 +0200 |
commit | 9f8785074512d6442fd97d67860fd625ac4d6bb1 (patch) | |
tree | 6c4b9fdb052e431e1173f5e9d957e17f5dc52ffc | |
parent | 7ea1bbe712cef48a97faffdf03b45f2812a93e62 (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.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 | 42 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 18 |
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 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 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"; |