diff options
author | ekuiitr <jhaekansh80@gmail.com> | 2018-06-15 23:42:13 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-07-10 14:25:44 +0200 |
commit | 2d61cb923e5e3999f6fd660aec26504311f0407c (patch) | |
tree | 305d6614417016ae322073061384aeea5a8d2f4c /sd | |
parent | 6d7c22092e66b6479ab4542286a0c0690e20b4dd (diff) |
Unit test for Chevron Smartart and
modified Unit test for Line algorithm.
It checks the position of the childs and
compare it with position of that child in MSO.
It also checks whether the childs are in the
same horizontal level or not.
Change-Id: I8e6dcaaf2923fe9d0d24e945486ba2f2954927d3
Reviewed-on: https://gerrit.libreoffice.org/55891
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 97f304723004..e4960ada1121 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -242,7 +242,26 @@ void SdImportTestSmartArt::testPyramid() void SdImportTestSmartArt::testChevron() { - //FIXME : so far this only introduce the test document, but the actual importer was not fixed yet. + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/smartart-chevron.pptx"), PPTX); + uno::Reference<drawing::XShapes> xShapeGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xShapeGroup->getCount()); + + uno::Reference<text::XText> xText0(xShapeGroup->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("a"), xText0->getString()); + uno::Reference<text::XText> xText1(xShapeGroup->getByIndex(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("b"), xText1->getString()); + uno::Reference<text::XText> xText2(xShapeGroup->getByIndex(2), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("c"), xText2->getString()); + + uno::Reference<drawing::XShape> xShape0(xShapeGroup->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference<drawing::XShape> xShape1(xShapeGroup->getByIndex(1), uno::UNO_QUERY_THROW); + uno::Reference<drawing::XShape> xShape2(xShapeGroup->getByIndex(2), uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xShape0->getPosition().X < xShape1->getPosition().X && xShape1->getPosition().X < xShape2->getPosition().X); + CPPUNIT_ASSERT_EQUAL(xShape0->getPosition().Y, xShape1->getPosition().Y); + CPPUNIT_ASSERT_EQUAL(xShape1->getPosition().Y, xShape2->getPosition().Y); + + xDocShRef->DoClose(); } void SdImportTestSmartArt::testCycle() |