Kaydet (Commit) 808d0486 authored tarafından Paul Trojahn's avatar Paul Trojahn Kaydeden (comit) Tamás Zolnai

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/42766Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 3d0c0abe
......@@ -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
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment