summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-03 16:49:14 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-03 17:22:00 +0100
commiteb2b7d243dc75578c76b8e5801a63b9a93389bb7 (patch)
tree72704e80979a55c7f1ee239dc0fb01e31ab6c2c1 /sw
parentf2945255df273404ee2457dcf761cb8f334b732b (diff)
oox: fix handling of noop parent transformation from DOCX
It seems that in Word, a zero parent transformation, like: <a:chOff x="0" y="0"/> <a:chExt cx="0" cy="0"/> 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
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/relorientation.docxbin22602 -> 22931 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx8
2 files changed, 8 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/relorientation.docx b/sw/qa/extras/ooxmlexport/data/relorientation.docx
index d71148b11d46..22a04538bd69 100644
--- a/sw/qa/extras/ooxmlexport/data/relorientation.docx
+++ b/sw/qa/extras/ooxmlexport/data/relorientation.docx
Binary files 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<drawing::XShapeDescriptor> 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<drawing::XShape> 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")