From eb2b7d243dc75578c76b8e5801a63b9a93389bb7 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 3 Jan 2014 16:49:14 +0100 Subject: oox: fix handling of noop parent transformation from DOCX It seems that in Word, a zero parent transformation, like: means the child shapes will have an absolute position / size. We actually use this feature in the exporter, but so far the importer didn't handle this. Change-Id: I250784a3dddd23649e391b548fc128dfdf153614 --- sw/qa/extras/ooxmlexport/data/relorientation.docx | Bin 22602 -> 22931 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 8 ++++++++ 2 files changed, 8 insertions(+) (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/data/relorientation.docx b/sw/qa/extras/ooxmlexport/data/relorientation.docx index d71148b11d46..22a04538bd69 100644 Binary files a/sw/qa/extras/ooxmlexport/data/relorientation.docx and b/sw/qa/extras/ooxmlexport/data/relorientation.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 23a8e6fe4784..aab75ab7e106 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2175,6 +2175,14 @@ DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx") // This resulted in lang::IndexOutOfBoundsException, as nested groupshapes weren't handled. uno::Reference xShapeDescriptor(xGroup->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType()); + + // Right after import we get a rounding error: 8662 vs 8664. + if (m_bExported) + { + uno::Reference xYear(xGroup->getByIndex(1), uno::UNO_QUERY); + // This was 2, due to incorrect handling of parent transformations inside DML groupshapes. + CPPUNIT_ASSERT_EQUAL(sal_Int32(8664), xYear->getSize().Width); + } } DECLARE_OOXMLEXPORT_TEST(testBezier, "bezier.odt") -- cgit