diff options
author | Grzegorz Araminowicz <g.araminowicz@gmail.com> | 2017-08-08 10:57:24 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-08-10 16:51:49 +0200 |
commit | 93a3739bf47ada4549b3c139c55a9b039c1db1ee (patch) | |
tree | 9cc3fa7aad805df1d21a4881fe30a80d9fb57f5f /sd | |
parent | 0bb18896ad593bed31cc231c7779045ee907a43e (diff) |
SmartArt: add nested shapes only if they are node's children
Change-Id: I6527fc4166001ffc1e1e170b179cd4eadf55305c
Reviewed-on: https://gerrit.libreoffice.org/40870
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/qa/unit/data/pptx/smartart-children.pptx | bin | 0 -> 53014 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 39 |
2 files changed, 39 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-children.pptx b/sd/qa/unit/data/pptx/smartart-children.pptx Binary files differnew file mode 100755 index 000000000000..8eca2f21ec54 --- /dev/null +++ b/sd/qa/unit/data/pptx/smartart-children.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 40804586e9db..726df149b40e 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -164,6 +164,7 @@ public: void testTdf108925(); void testTdf109067(); void testSmartArt1(); + void testSmartArtChildren(); void testTdf109223(); void testActiveXCheckbox(); @@ -237,6 +238,7 @@ public: CPPUNIT_TEST(testTdf108925); CPPUNIT_TEST(testTdf109067); CPPUNIT_TEST(testSmartArt1); + CPPUNIT_TEST(testSmartArtChildren); CPPUNIT_TEST(testTdf109223); CPPUNIT_TEST(testActiveXCheckbox); @@ -2259,6 +2261,43 @@ void SdImportTest::testSmartArt1() xDocShRef->DoClose(); } +void SdImportTest::testSmartArtChildren() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/smartart-children.pptx"), PPTX); + uno::Reference<drawing::XShapes> xShapeGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xShapeGroup->getCount()); + + uno::Reference<drawing::XShapes> xShapeGroup0(xShapeGroup->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xShapeGroup0->getCount()); + uno::Reference<text::XText> xTextA(xShapeGroup0->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("a"), xTextA->getString()); + + uno::Reference<drawing::XShapes> xChildren0(xShapeGroup0->getByIndex(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xChildren0->getCount()); + uno::Reference<drawing::XShapes> xChildB(xChildren0->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference<text::XText> xTextB(xChildB->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("b"), xTextB->getString()); + uno::Reference<drawing::XShapes> xChildC(xChildren0->getByIndex(1), uno::UNO_QUERY_THROW); + uno::Reference<text::XText> xTextC(xChildC->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("c"), xTextC->getString()); + + uno::Reference<drawing::XShapes> xShapeGroup1(xShapeGroup->getByIndex(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xShapeGroup1->getCount()); + uno::Reference<text::XText> xTextX(xShapeGroup1->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("x"), xTextX->getString()); + + uno::Reference<drawing::XShapes> xChildren1(xShapeGroup1->getByIndex(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xChildren1->getCount()); + uno::Reference<drawing::XShapes> xChildY(xChildren1->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference<text::XText> xTextY(xChildY->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("y"), xTextY->getString()); + uno::Reference<drawing::XShapes> xChildZ(xChildren1->getByIndex(1), uno::UNO_QUERY_THROW); + uno::Reference<text::XText> xTextZ(xChildZ->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("z"), xTextZ->getString()); + + xDocShRef->DoClose(); +} + void SdImportTest::testTdf109223() { // In the test document flipV attribute is defined for a group shape |