sw/qa/extras/ooxmlexport/data/fdo80410.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 13 +++++++++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 7 ++++++- 3 files changed, 19 insertions(+), 1 deletion(-)
New commits: commit 589b256452e729e05d9610f10fb2408810e56eb6 Author: Michael Stahl <mst...@redhat.com> Date: Thu Jul 10 22:47:27 2014 +0200 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 <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/ooxmlexport/data/fdo80410.docx b/sw/qa/extras/ooxmlexport/data/fdo80410.docx new file mode 100644 index 0000000..7660d84 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo80410.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 312d9d9..2d32dc1 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 3b71536..98ed78b 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";
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits