diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2015-11-22 16:04:36 +1000 |
---|---|---|
committer | Mike Kaganski <mikekaganski@hotmail.com> | 2015-11-24 13:46:49 +0000 |
commit | ae0e830f9ace78b889713e7e74ce46f88fa21470 (patch) | |
tree | d8799369cc9459bf100a3e949616666626ed54e3 /sw/qa/extras/ooxmlimport/ooxmlimport.cxx | |
parent | ccd04a5f46c491d50b071cf2a58b77a2bacb1922 (diff) |
tdf#95970: Don't loose mirroring in SdrTextObj::TRSetBaseGeometry
Currently, negative scaling (mirroring) is lost in
SdrTextObj::NbcSetSnapRect, when rect is justified.
This patch cares for this.
Possibly it's better to make these changes directly in
SdrTextObj::NbcSetSnapRect?
Change-Id: I353ff01626e15b398de95e28eae78572991dfdc3
Reviewed-on: https://gerrit.libreoffice.org/20109
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'sw/qa/extras/ooxmlimport/ooxmlimport.cxx')
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 8c28ff91a0fc..53b55b9e5bbc 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -78,6 +78,7 @@ #include <oox/drawingml/drawingmltypes.hxx> #include <unotools/streamwrap.hxx> #include <comphelper/propertysequence.hxx> +#include <com/sun/star/drawing/HomogenMatrix3.hpp> #include <bordertest.hxx> @@ -2961,6 +2962,33 @@ DECLARE_OOXMLIMPORT_TEST(testTdf60351, "tdf60351.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[5].Y); } +DECLARE_OOXMLIMPORT_TEST(testTdf95970, "tdf95970.docx") +{ + // First shape: the rotation should be -12.94 deg, it should be mirrored. + // Proper color order of image on test doc (left->right): + // top row: green->red + // bottom row: yellow->blue + uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY_THROW); + sal_Int32 aRotate = 0; + xPropertySet->getPropertyValue("RotateAngle") >>= aRotate; + CPPUNIT_ASSERT_EQUAL(sal_Int32(34706), aRotate); + bool bIsMirrored = false; + xPropertySet->getPropertyValue("IsMirrored") >>= bIsMirrored; + CPPUNIT_ASSERT(bIsMirrored); + drawing::HomogenMatrix3 aTransform; + xPropertySet->getPropertyValue("Transformation") >>= aTransform; + CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line1.Column1, 4767.0507250872988)); + CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line1.Column2, -1269.0985325236848)); + CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line1.Column3, 696.73611111111109)); + CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line2.Column1, 1095.3035265135941)); + CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line2.Column2, 5523.4525711162969)); + CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line2.Column3, 672.04166666666663)); + CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line3.Column1, 0.0)); + CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line3.Column2, 0.0)); + CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line3.Column3, 1.0)); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |