diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-06-01 09:46:16 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-06-01 13:01:32 +0200 |
commit | 697173f6fdfae581022cfdb5ec5171c5a3be58f0 (patch) | |
tree | 62f5908241dcbf7cdb65aa5227d1b356030974a5 /sw/qa/extras/ooxmlexport | |
parent | 88ff39aee58cf0c098a2cce311cf62efbd76bb6d (diff) |
sw: add separate DOCM filter
This way at export time we can preserve the correct content-type, which
isn't the same for DOCX and DOCM.
Change-Id: I08fa734c72fab7400bd327a07a760839556dbf6f
Reviewed-on: https://gerrit.libreoffice.org/38298
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/ooxmlexport')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/hello.docm | bin | 0 -> 12709 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 33 |
2 files changed, 33 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/hello.docm b/sw/qa/extras/ooxmlexport/data/hello.docm Binary files differnew file mode 100644 index 000000000000..a00aa58e7ba5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/hello.docm diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 8e263e2c9f3d..9d1a5e161fcc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -39,6 +39,15 @@ protected: } }; +class DocmTest : public SwModelTestBase +{ +public: + DocmTest() + : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "MS Word 2007 XML VBA") + { + } +}; + DECLARE_OOXMLEXPORT_TEST(testFdo55381, "fdo55381.docx") { uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); @@ -49,6 +58,30 @@ DECLARE_OOXMLEXPORT_TEST(testFdo55381, "fdo55381.docx") //TODO: frames not located on the correct pages } +DECLARE_OOXMLEXPORT_TEST(testDocm, "hello.docm") +{ + // Make sure that we check the name of the export filter. + // This was application/vnd.ms-word.document.macroEnabled.main+xml when the + // name of the import filter was checked. + if (xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml")) + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']", + "ContentType", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"); +} + +DECLARE_SW_ROUNDTRIP_TEST(testDocmSave, "hello.docm", nullptr, DocmTest) +{ + // This was + // application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml, + // we used the wrong content type for .docm files. + if (xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml")) + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']", + "ContentType", + "application/vnd.ms-word.document.macroEnabled.main+xml"); +} + DECLARE_OOXMLEXPORT_TEST(testTdf92045, "tdf92045.docx") { // This was true, <w:effect w:val="none"/> resulted in setting the blinking font effect. |