diff options
author | Paul Trojahn <paul.trojahn@gmail.com> | 2017-09-24 22:24:20 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-09-26 13:53:19 +0200 |
commit | 808d048694630303d895e818cfd5fb48c9d16738 (patch) | |
tree | 1e242a16858142e3a38094900f72a760f700ab3a | |
parent | 3d0c0abea7ed5f59ab30aa8f120d55e54d3e7098 (diff) |
tdf#100065 Fix scale of transformation
The shape needs to be flipped to compensate the change of
mbFlipH/mbFlipV.
Change-Id: I7b680497fee6ae9ed7bbd6f4ed9089d1a25a1deb
Reviewed-on: https://gerrit.libreoffice.org/42766
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r-- | oox/source/drawingml/shape.cxx | 2 | ||||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf100065.pptx | bin | 34359 -> 36317 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 16 |
3 files changed, 13 insertions, 5 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index ddf829bcea5a..292f2a2be8d0 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -517,10 +517,12 @@ Reference< XShape > const & Shape::createAndInsert( if(aScale.getX() < 0) { mbFlipH = !mbFlipH; + aTransformation.scale(-1, 1); } if(aScale.getY() < 0) { mbFlipV = !mbFlipV; + aTransformation.scale(1, -1); } } // rotate around object's center diff --git a/sd/qa/unit/data/pptx/tdf100065.pptx b/sd/qa/unit/data/pptx/tdf100065.pptx Binary files differindex 83952dff5504..c6125dc6d40a 100644 --- a/sd/qa/unit/data/pptx/tdf100065.pptx +++ b/sd/qa/unit/data/pptx/tdf100065.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index f49fd62881ff..875c110584a6 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -2269,12 +2269,18 @@ void SdImportTest::testTdf108926() void SdImportTest::testTdf100065() { sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf100065.pptx"), PPTX); - uno::Reference< container::XIndexAccess > xGroupShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - uno::Reference< beans::XPropertySet > xShape(xGroupShape->getByIndex(1), uno::UNO_QUERY_THROW); - sal_Int32 nAngle; - CPPUNIT_ASSERT(xShape->getPropertyValue("RotateAngle") >>= nAngle); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2000), nAngle); + uno::Reference< container::XIndexAccess > xGroupShape1(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); + uno::Reference< beans::XPropertySet > xShape1(xGroupShape1->getByIndex(1), uno::UNO_QUERY_THROW); + sal_Int32 nAngle1; + CPPUNIT_ASSERT(xShape1->getPropertyValue("RotateAngle") >>= nAngle1); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2000), nAngle1); + + uno::Reference< container::XIndexAccess > xGroupShape2(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); + uno::Reference< beans::XPropertySet > xShape2(xGroupShape2->getByIndex(0), uno::UNO_QUERY_THROW); + sal_Int32 nAngle2; + CPPUNIT_ASSERT(xShape2->getPropertyValue("RotateAngle") >>= nAngle2); + CPPUNIT_ASSERT_EQUAL(sal_Int32(18000), nAngle2); xDocShRef->DoClose(); } |