diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2019-10-03 08:37:00 +0300 |
---|---|---|
committer | Gülşah Köse <gulsah.kose@collabora.com> | 2019-10-16 10:44:00 +0200 |
commit | c50e44b270bc3048ff9c1a000c3afed1dab9e0bf (patch) | |
tree | d152dc897d7a54e0e01a1b594b1830f9a45f1e19 /svx/qa | |
parent | e1b08d46d1861bfca88af5d8c7137419bcc131aa (diff) |
tdf#126060 Handle text camera z rotation while pptx import.
Change-Id: Ifa4589fb50affc4c5ffb52288db8533c98ec6dd9
Reviewed-on: https://gerrit.libreoffice.org/80587
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'svx/qa')
-rw-r--r-- | svx/qa/unit/customshapes.cxx | 31 | ||||
-rw-r--r-- | svx/qa/unit/data/tdf126060_3D_Z_Rotation.pptx | bin | 0 -> 32602 bytes |
2 files changed, 31 insertions, 0 deletions
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index ad0e305bf6ca..25ddbc97df17 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -504,6 +504,37 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf127785_Mirror) CPPUNIT_ASSERT_EQUAL(OUString(), sErrors); } +CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf126060_3D_Z_Rotation) +{ + // The document contains one textbox with inside overflowed text + // and the text has 3D z rotation. When we open the document we + // should see the text vertically and rotated from text bound center not text box. + + const OUString sFileName("tdf126060_3D_Z_Rotation.pptx"); + OUString sURL = m_directories.getURLFromSrc(sDataDirectory) + sFileName; + mxComponent = loadFromDesktop(sURL, "com.sun.star.comp.drawing.DrawingDocument"); + CPPUNIT_ASSERT_MESSAGE("Could not load document", mxComponent.is()); + OUString sErrors; // sErrors collects the errors and should be empty in case all is OK. + + uno::Reference<drawing::XShape> xShape(getShape(0)); + SdrObjCustomShape& rSdrObjCustomShape( + static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + + if (rSdrObjCustomShape.GetCameraRotation() != 90) + sErrors += "Wrong text camera Z rotation"; + + basegfx::B2DHomMatrix aObjectTransform; + basegfx::B2DPolyPolygon aObjectPolyPolygon; + rSdrObjCustomShape.TRGetBaseGeometry(aObjectTransform, aObjectPolyPolygon); + + if (aObjectTransform.get(0, 0) != 1492 || aObjectTransform.get(0, 1) != 0 + || aObjectTransform.get(0, 2) != 1129 || aObjectTransform.get(1, 0) != 0 + || aObjectTransform.get(1, 1) != 2500 || aObjectTransform.get(1, 2) != 5846) + sErrors += " Wrong transformation matrix"; + + CPPUNIT_ASSERT_EQUAL(OUString(), sErrors); +} + CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf127785_Asymmetric) { // The document contains a shapes with vertical flip and text frame asymmetrical diff --git a/svx/qa/unit/data/tdf126060_3D_Z_Rotation.pptx b/svx/qa/unit/data/tdf126060_3D_Z_Rotation.pptx Binary files differnew file mode 100644 index 000000000000..8c8798f21a61 --- /dev/null +++ b/svx/qa/unit/data/tdf126060_3D_Z_Rotation.pptx |