diff options
author | Grzegorz Araminowicz <g.araminowicz@gmail.com> | 2017-08-23 12:23:58 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-08-24 15:16:32 +0200 |
commit | f6850953dfd0ff0847e5a24bf921456a12ae47e4 (patch) | |
tree | 11c1f978af2fca457a4962f1fd16bdc2a8ea73ee /sd | |
parent | c137c2a46cd2276938d572c97fb111b9aa31cdfd (diff) |
SmartArt: implement dir and maxDepth if node functions
Change-Id: I4ef05b5bab1188cf349d1c7f5bbc9022bc79b21c
Reviewed-on: https://gerrit.libreoffice.org/41452
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/qa/unit/data/pptx/smartart-dir.pptx | bin | 0 -> 41593 bytes | |||
-rwxr-xr-x | sd/qa/unit/data/pptx/smartart-maxdepth.pptx | bin | 0 -> 43256 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 31 |
3 files changed, 31 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-dir.pptx b/sd/qa/unit/data/pptx/smartart-dir.pptx Binary files differnew file mode 100755 index 000000000000..ab94459d262f --- /dev/null +++ b/sd/qa/unit/data/pptx/smartart-dir.pptx diff --git a/sd/qa/unit/data/pptx/smartart-maxdepth.pptx b/sd/qa/unit/data/pptx/smartart-maxdepth.pptx Binary files differnew file mode 100755 index 000000000000..545d744bd229 --- /dev/null +++ b/sd/qa/unit/data/pptx/smartart-maxdepth.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index e4258b161730..7546689852a5 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -166,6 +166,8 @@ public: void testSmartArtChildren(); void testSmartArtText(); void testSmartArtCnt(); + void testSmartArtDir(); + void testSmartArtMaxDepth(); void testSmartArtRotation(); void testTdf109223(); void testTdf109187(); @@ -243,6 +245,8 @@ public: CPPUNIT_TEST(testSmartArtChildren); CPPUNIT_TEST(testSmartArtText); CPPUNIT_TEST(testSmartArtCnt); + CPPUNIT_TEST(testSmartArtDir); + CPPUNIT_TEST(testSmartArtMaxDepth); CPPUNIT_TEST(testSmartArtRotation); CPPUNIT_TEST(testTdf109223); CPPUNIT_TEST(testTdf109187); @@ -2336,6 +2340,33 @@ void SdImportTest::testSmartArtCnt() xDocShRef->DoClose(); } +void SdImportTest::testSmartArtDir() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/smartart-dir.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::XShape> xShape0(xShapeGroup->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference<drawing::XShape> xShape1(xShapeGroup->getByIndex(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xShape0->getPosition().X > xShape1->getPosition().X); + + xDocShRef->DoClose(); +} + +void SdImportTest::testSmartArtMaxDepth() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/smartart-maxdepth.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<text::XText> xText0(xShapeGroup->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("first"), xText0->getString()); + uno::Reference<text::XText> xText1(xShapeGroup->getByIndex(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("second"), xText1->getString()); + + xDocShRef->DoClose(); +} + void SdImportTest::testSmartArtRotation() { sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/smartart-rotation.pptx"), PPTX); |