diff options
author | Paul Trojahn <paul.trojahn@gmail.com> | 2017-09-08 19:05:19 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-09-16 17:14:38 +0200 |
commit | 33a6eb3df861009d0fe9ffee344ef00cd2906520 (patch) | |
tree | 17dec3fc32d3ab9618f38a722860ad2923fe8b0b /sd | |
parent | 57d3c7883bc51e9aed5b4eb8f2c2d599741888ca (diff) |
tdf#100065 PPTX Fix import of custom shapes in groups
A negative scale of the parent matrix indicates that the shape needs to
be flipped. This commit fixes text rotation as well, so
d742c0019435d0bc90c9342492583636099a057f is no longer needed.
Change-Id: I67bba34519b3af9215fe64a71f5137aa510edf7a
Reviewed-on: https://gerrit.libreoffice.org/42250
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf100065.pptx | bin | 0 -> 34359 bytes | |||
-rwxr-xr-x | sd/qa/unit/data/pptx/tdf109223.pptx | bin | 34023 -> 0 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 49 |
3 files changed, 15 insertions, 34 deletions
diff --git a/sd/qa/unit/data/pptx/tdf100065.pptx b/sd/qa/unit/data/pptx/tdf100065.pptx Binary files differnew file mode 100644 index 000000000000..83952dff5504 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf100065.pptx diff --git a/sd/qa/unit/data/pptx/tdf109223.pptx b/sd/qa/unit/data/pptx/tdf109223.pptx Binary files differdeleted file mode 100755 index 0f68796e8e14..000000000000 --- a/sd/qa/unit/data/pptx/tdf109223.pptx +++ /dev/null diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 9975f16e87ef..f49fd62881ff 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -162,9 +162,9 @@ public: void testTdf89064(); void testTdf108925(); void testTdf109067(); - void testTdf109223(); void testTdf109187(); void testTdf108926(); + void testTdf100065(); bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected); void testPatternImport(); @@ -235,9 +235,9 @@ public: CPPUNIT_TEST(testTdf89064); CPPUNIT_TEST(testTdf108925); CPPUNIT_TEST(testTdf109067); - CPPUNIT_TEST(testTdf109223); CPPUNIT_TEST(testTdf109187); CPPUNIT_TEST(testTdf108926); + CPPUNIT_TEST(testTdf100065); CPPUNIT_TEST_SUITE_END(); }; @@ -2234,38 +2234,6 @@ void SdImportTest::testTdf109067() xDocShRef->DoClose(); } -void SdImportTest::testTdf109223() -{ - // In the test document flipV attribute is defined for a group shape - // This transformation is not applied on child shapes - // To make the text direction right at least I added an additional text rotation when parent shape is flipped. - sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf109223.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); - - // Check the shape text to make sure we test the right shape - OUString sText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getString(); - CPPUNIT_ASSERT_EQUAL(OUString("Tested child shape"), sText); - - // Check the attribute inherited from parent shape - bool bAttributeFound = false; - uno::Sequence<beans::PropertyValue> aProps; - CPPUNIT_ASSERT(xShape->getPropertyValue("CustomShapeGeometry") >>= aProps); - for (sal_Int32 i = 0; i < aProps.getLength(); ++i) - { - const beans::PropertyValue& rProp = aProps[i]; - if (rProp.Name == "TextPreRotateAngle") - { - CPPUNIT_ASSERT_EQUAL(sal_Int32(180), rProp.Value.get<sal_Int32>()); - bAttributeFound = true; - break; - } - } - - CPPUNIT_ASSERT_EQUAL(true, bAttributeFound); - xDocShRef->DoClose(); -} - void SdImportTest::testTdf109187() { sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf109187.pptx"), PPTX); @@ -2298,6 +2266,19 @@ void SdImportTest::testTdf108926() xDocShRef->DoClose(); } +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); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |