summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-07-29 21:43:41 +0200
committerCaolán McNamara <caolanm@redhat.com>2017-08-02 10:29:54 +0200
commit732dd5bb677c4518c48d653846b752177b56400b (patch)
tree4c1cef86179f96ff11df4f8c1a996468731e0e90 /sd
parent6d77bfc9b2cf5a30a06a97c69ed814e3a97ed685 (diff)
tdf#109223: PPTX: Vertical flip of child shape is not imported correctly
Group shape level vertical flip is not handled well. Recent handling of group shape's transformation makes it hard to import this attribute, but we can import the right text direction at least. Reviewed-on: https://gerrit.libreoffice.org/40554 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit d742c0019435d0bc90c9342492583636099a057f) Change-Id: Ib9e39e3dcb28a95fabc61c13152a3f7296fbd4c3 Reviewed-on: https://gerrit.libreoffice.org/40555 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rwxr-xr-xsd/qa/unit/data/pptx/tdf109223.pptxbin0 -> 34023 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx34
2 files changed, 34 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf109223.pptx b/sd/qa/unit/data/pptx/tdf109223.pptx
new file mode 100755
index 000000000000..0f68796e8e14
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf109223.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index f8e67dabf214..896f8b74ac84 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -161,6 +161,7 @@ public:
void testTdf100926();
void testTdf89064();
void testTdf108925();
+ void testTdf109223();
bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
@@ -230,6 +231,7 @@ public:
CPPUNIT_TEST(testPatternImport);
CPPUNIT_TEST(testTdf89064);
CPPUNIT_TEST(testTdf108925);
+ CPPUNIT_TEST(testTdf109223);
CPPUNIT_TEST_SUITE_END();
};
@@ -2216,6 +2218,38 @@ void SdImportTest::testTdf108925()
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();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();