summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-04-10 16:19:32 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-04-12 09:48:38 +0200
commitc9c9c5ad3fa41f78042b44092c44a181c3b846b8 (patch)
treefcfc20743de151e8f7db4f108ecc50dfaa09b102 /sd
parenta293630bb4dfed200c1c1e246acab4226a0ff08f (diff)
SmartArt: improve cycle algorithm
connector arrows are now correctly positioned and rotated Change-Id: I6407ec5e2d6e29d250f751f8dc5feae878d3c74c Reviewed-on: https://gerrit.libreoffice.org/70525 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 33bdf6532966..001bb07678a8 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -401,10 +401,25 @@ void SdImportTestSmartArt::testCycle()
m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-cycle.pptx"), PPTX);
uno::Reference<drawing::XShapes> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
CPPUNIT_ASSERT(xGroup.is());
+
// 10 children: 5 shapes, 5 connectors
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10), xGroup->getCount());
- //FIXME : so far this only introduce the test document, but the actual importer was not fixed yet.
+ uno::Reference<drawing::XShape> xShape0(xGroup->getByIndex(0), uno::UNO_QUERY_THROW);
+ uno::Reference<drawing::XShape> xShapeConn(xGroup->getByIndex(1), uno::UNO_QUERY_THROW);
+ uno::Reference<drawing::XShape> xShape2(xGroup->getByIndex(2), uno::UNO_QUERY_THROW);
+
+ uno::Reference<text::XText> xText0(xShape0, uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(OUString("a"), xText0->getString());
+ uno::Reference<text::XText> xText2(xShape2, uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(OUString("b"), xText2->getString());
+
+ // xShapeConn is connector between shapes 0 and 2
+ // it should lay between them and be rotated 0 -> 2
+ CPPUNIT_ASSERT(xShape0->getPosition().X < xShapeConn->getPosition().X);
+ CPPUNIT_ASSERT(xShape0->getPosition().Y < xShapeConn->getPosition().Y && xShapeConn->getPosition().Y < xShape2->getPosition().Y);
+ uno::Reference<beans::XPropertySet> xPropSetConn(xShapeConn, uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(32400), xPropSetConn->getPropertyValue("RotateAngle").get<sal_Int32>());
}
void SdImportTestSmartArt::testHierarchy()