diff options
author | Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com> | 2019-05-19 15:40:14 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-05-21 09:28:55 +0200 |
commit | c91302d8818587a6b817ee1325b920578f06d5c5 (patch) | |
tree | c842d81d41211747b5c5af7ee64b3335a5a4c4cc /sd | |
parent | 15d0cc8cb1287f9e6c3f0a67866890eef2d2599c (diff) |
SmartArt: Support ctrShpMap cycle algorithm parameter
it allows to lay out first node in the center and others around it
Change-Id: Ie9d7d66df638767d8713e301dee2a89a63900fbe
Reviewed-on: https://gerrit.libreoffice.org/72589
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/smartart-center-cycle.pptx | bin | 0 -> 44405 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-center-cycle.pptx b/sd/qa/unit/data/pptx/smartart-center-cycle.pptx Binary files differnew file mode 100644 index 000000000000..72f3685fb2ab --- /dev/null +++ b/sd/qa/unit/data/pptx/smartart-center-cycle.pptx diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index a1acd88cc213..1e726a5d1339 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -74,6 +74,7 @@ public: void testInteropGrabBag(); void testBackground(); void testBackgroundDrawingmlFallback(); + void testCenterCycle(); CPPUNIT_TEST_SUITE(SdImportTestSmartArt); @@ -110,6 +111,7 @@ public: CPPUNIT_TEST(testInteropGrabBag); CPPUNIT_TEST(testBackground); CPPUNIT_TEST(testBackgroundDrawingmlFallback); + CPPUNIT_TEST(testCenterCycle); CPPUNIT_TEST_SUITE_END(); }; @@ -1136,6 +1138,34 @@ void SdImportTestSmartArt::testBackgroundDrawingmlFallback() xDocShRef->DoClose(); } +void SdImportTestSmartArt::testCenterCycle() +{ + sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-center-cycle.pptx"), PPTX); + uno::Reference<drawing::XShapes> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY); + CPPUNIT_ASSERT(xGroup.is()); + + uno::Reference<drawing::XShapes> xGroupNested(xGroup->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xGroupNested.is()); + + uno::Reference<drawing::XShape> xShapeCenter(xGroupNested->getByIndex(0), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShapeA(xGroupNested->getByIndex(1), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShapeB(xGroupNested->getByIndex(2), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShapeC(xGroupNested->getByIndex(3), uno::UNO_QUERY); + + uno::Reference<text::XText> xTextCenter(xShapeCenter, uno::UNO_QUERY); + CPPUNIT_ASSERT(xTextCenter.is()); + CPPUNIT_ASSERT_EQUAL(OUString("center"), xTextCenter->getString()); + + CPPUNIT_ASSERT_LESS(xShapeCenter->getPosition().Y, xShapeA->getPosition().Y); + CPPUNIT_ASSERT_GREATER(xShapeCenter->getPosition().X, xShapeB->getPosition().X); + CPPUNIT_ASSERT_GREATER(xShapeCenter->getPosition().Y, xShapeB->getPosition().Y); + CPPUNIT_ASSERT_LESS(xShapeCenter->getPosition().X, xShapeC->getPosition().X); + CPPUNIT_ASSERT_GREATER(xShapeCenter->getPosition().Y, xShapeC->getPosition().Y); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt); CPPUNIT_PLUGIN_IMPLEMENT(); |