diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-07-10 22:47:27 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-11 15:21:30 +0000 |
commit | 589b256452e729e05d9610f10fb2408810e56eb6 (patch) | |
tree | 704b4ceec003cda602ea64722a396cac893c06bc | |
parent | 32ef78f1f3e1fd8c714ec7228be660f1edb97500 (diff) |
fdo#80410: sw: DOCX export: support DOCX embedded objects
(cherry picked from commit 3ffb06e76be9be7499f12973139949ddbf6297b9)
fdo#80410: let's add a unit test too...
(cherry picked from commit 46d9724369ba4f248eab0133d396bd8f6a4453c6)
Change-Id: Ifa9e12eee4139a9c9c5d17a349ff3511c62b3ea8
Reviewed-on: https://gerrit.libreoffice.org/10234
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo80410.docx | bin | 0 -> 24733 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 13 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 7 |
3 files changed, 19 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo80410.docx b/sw/qa/extras/ooxmlexport/data/fdo80410.docx Binary files differnew file mode 100644 index 000000000000..7660d84447d5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80410.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 312d9d9b6b9c..2d32dc13f3f3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3064,6 +3064,19 @@ DECLARE_OOXMLEXPORT_TEST(testFileWithInvalidImageLink, "FileWithInvalidImageLink assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", "embed", ""); } +DECLARE_OOXMLEXPORT_TEST(testContentTypeDOCX, "fdo80410.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.docx']", + "ContentType", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); +} + DECLARE_OOXMLEXPORT_TEST(testContentTypeXLSM, "fdo76098.docx") { xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 3b71536b7bdc..98ed78b998d3 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4199,7 +4199,12 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"; sFileExtension = "docm"; } - //Implementation for embedded Word 97-2003 document was missing + else if (sProgID == "Word.Document.12") + { + sMediaType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; + sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"; + sFileExtension = "docx"; + } else if( sProgID == "Word.Document.8" ) { sMediaType = "application/msword"; |