diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2016-10-25 01:51:25 +0000 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2016-10-25 00:37:25 +0000 |
commit | f7c61b08d526c79ecd1522dff79386059b6125e0 (patch) | |
tree | 496c9960e02bb0ded01d8ab9ecd0faf8c2ec2620 /sw | |
parent | 419e4fa1b587c1e4bc3f8d48729e1955ade1c8c3 (diff) |
tdf#103389: Resaving a DOCX document with two canvases leads to a broken file.
Make custom shape export more robust. In case of the test
document, WriteCustomGeometry is called, but this call
does not export anything, and so we get a shape without
any geometry in the DOCX file, which causes problem to MS Word.
Change-Id: Ie7a4e2b8a18bfddaeeb81425ae5f1de04140d43f
Reviewed-on: https://gerrit.libreoffice.org/30241
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf103389.docx | bin | 0 -> 13983 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf103389.docx b/sw/qa/extras/ooxmlexport/data/tdf103389.docx Binary files differnew file mode 100644 index 000000000000..0ef80e6a1814 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103389.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 18ab97e5a406..95b1c2dbf44f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -52,6 +52,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf89377, "tdf89377_tableWithBreakBeforeParaStyle.d CPPUNIT_ASSERT_EQUAL( 3, getPages() ); } +DECLARE_OOXMLEXPORT_TEST(testTdf103389, "tdf103389.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + // No geometry was exported for the second canvas + // Check both canvases' geometry + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom", "prst", "rect"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom", "prst", "rect"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |