diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-21 11:44:22 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-21 12:37:15 +0100 |
commit | 6c4f737ec88a4f4dc5da8b2295ca5e7de2d4c24f (patch) | |
tree | 2c378201a71937f9e80deb795d8e4079e3087fdb /sw/qa | |
parent | 6eac9deadd9fb6d0c547791e3a8ae4f9a4d33de4 (diff) |
DOCX drawingML shape import: fix position when CustomShapeGeometry is set
DOCX drawingML shapes had wrong position if they had their
CustomShapeGeometry set (e.g. flipped). This wasn't a problem for VML
shapes, as there the shape knows its position, and position was always
set in oox as well, not in writerfilter. However, in case of WPS shapes,
oox created the shape, and previously writerfilter set the position
after-the-fact. This leads to incorrect results if CustomShapeGeometry
is involved. Fix this by passing the position from writerfilter to oox,
and call setPosition() after creation, but before CustomShapeGeometry is
set.
The other problem was that normally writerfilter learns the position of
the shape when relevant token in GraphicImport::lcl_sprm() arrives, but
this happens after OOXMLFastContextHandlerShape::sendShape() needs that
information. Work around this by accessing the PositionHandler directly.
Change-Id: Iced35dc9467ef77c41f1897f124729f686bd045e
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/line-wps-only.docx | bin | 0 -> 8721 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 7 |
2 files changed, 7 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/line-wps-only.docx b/sw/qa/extras/ooxmlimport/data/line-wps-only.docx Binary files differnew file mode 100644 index 000000000000..465f4bd6ed2c --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/line-wps-only.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index d8ca06f9cafa..90956106eb1f 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1526,6 +1526,13 @@ DECLARE_OOXMLIMPORT_TEST(testWpsOnly, "wps-only.docx") CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(getShape(2), "Opaque"))); } +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(210), xShape->getPosition().X); +} + DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx") { // The document contains a rotated bitmap |