diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-25 15:14:22 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-25 15:55:43 +0200 |
commit | 9791453283407a0a129a71767a290058ac759da2 (patch) | |
tree | 2cdd79932ba3f11cdc4458107084221d85262035 /sw | |
parent | dbbd89efdeaa44421d1f2ad774c342009d881d9b (diff) |
DOCX drawingML filter: avoid fake rotation on vertical flip
This also improves positioning a bit, in the changed testcase the
perfect position would be 211.663888889, and reality is now 210 instead
of 208 (100th millimeters).
Change-Id: I5226f2165224a8bbfebfd11d9c612f72d83b8c69
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/drawingml-flipv.docx | bin | 0 -> 15580 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 14 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/drawingml-flipv.docx b/sw/qa/extras/ooxmlexport/data/drawingml-flipv.docx Binary files differnew file mode 100644 index 000000000000..f10a83fac2c6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/drawingml-flipv.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 0b2c78f6b700..be44a0723086 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -290,6 +290,20 @@ DECLARE_OOXMLEXPORT_TEST(testNumberingFont, "numbering-font.docx") CPPUNIT_ASSERT_EQUAL(OUString("Verdana"), getProperty<OUString>(xStyle, "CharFontName")); } +DECLARE_OOXMLEXPORT_TEST(testDrawingmlFlipv, "drawingml-flipv.docx") +{ + // The problem was that the shape had vertical flip only, but then we added rotation as well on export. + if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + { + xmlXPathObjectPtr pXPath = getXPathNode(pXmlDoc, "//a:xfrm"); + xmlNodeSetPtr pXmlNodes = pXPath->nodesetval; + CPPUNIT_ASSERT_EQUAL(1, xmlXPathNodeSetGetLength(pXmlNodes)); + xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; + // The attribute existed, so xmlGetProp() returned non-NULL. + CPPUNIT_ASSERT_EQUAL(static_cast<xmlChar*>(0), xmlGetProp(pXmlNode, BAD_CAST("rot"))); + } +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 713680827641..eca11e6cd010 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1665,7 +1665,7 @@ DECLARE_OOXMLIMPORT_TEST(lineWpsOnly, "line-wps-only.docx") { uno::Reference<drawing::XShape> xShape = getShape(1); // Check position, it was -7223 as it was set after the CustomShapeGeometry property. - CPPUNIT_ASSERT_EQUAL(sal_Int32(208), xShape->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(210), xShape->getPosition().X); } DECLARE_OOXMLIMPORT_TEST(lineRotation, "line-rotation.docx") |