summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-04-11 14:56:37 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-04-15 09:51:44 +0200
commit5218009f4b3f1f619d12151fc76ec14a12c6d89e (patch)
tree778ddf6c3146cf3fe8f4abf4ebf225694789673f /sd
parent504a9575e7bebe29528c60686a6ad64f9ba81c8b (diff)
SmartArt: better detecting connector arrow type
* basing on provided conn alg params * also moved setting arrow direction from getConnectorType() to algorithms Change-Id: I76898a4ccad961edd389677c31e7d8c05bcdf5fe Reviewed-on: https://gerrit.libreoffice.org/70598 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/smartart-multidirectional.pptx (renamed from sd/qa/unit/data/pptx/smartart-mutidirectional.pptx)bin43588 -> 43588 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx25
2 files changed, 24 insertions, 1 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-mutidirectional.pptx b/sd/qa/unit/data/pptx/smartart-multidirectional.pptx
index fd723982a6bf..fd723982a6bf 100644
--- a/sd/qa/unit/data/pptx/smartart-mutidirectional.pptx
+++ b/sd/qa/unit/data/pptx/smartart-multidirectional.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 001bb07678a8..61b4e44f1b50 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -420,6 +420,13 @@ void SdImportTestSmartArt::testCycle()
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>());
+
+ // Make sure that we have an arrow shape between the two shapes
+ comphelper::SequenceAsHashMap aCustomShapeGeometry(
+ xPropSetConn->getPropertyValue("CustomShapeGeometry"));
+ CPPUNIT_ASSERT(aCustomShapeGeometry["Type"].has<OUString>());
+ OUString aType = aCustomShapeGeometry["Type"].get<OUString>();
+ CPPUNIT_ASSERT_EQUAL(OUString("ooxml-rightArrow"), aType);
}
void SdImportTestSmartArt::testHierarchy()
@@ -444,7 +451,23 @@ void SdImportTestSmartArt::testInvertedPyramid()
void SdImportTestSmartArt::testMultidirectional()
{
- //FIXME : so far this only introduce the test document, but the actual importer was not fixed yet.
+ // similar document as cycle, but arrows are pointing in both directions
+
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-multidirectional.pptx"), PPTX);
+ uno::Reference<drawing::XShapes> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xGroup.is());
+
+ // 6 children: 3 shapes, 3 connectors
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6), xGroup->getCount());
+
+ uno::Reference<drawing::XShape> xShapeConn(xGroup->getByIndex(1), uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> xPropSetConn(xShapeConn, uno::UNO_QUERY_THROW);
+ comphelper::SequenceAsHashMap aCustomShapeGeometry(
+ xPropSetConn->getPropertyValue("CustomShapeGeometry"));
+ CPPUNIT_ASSERT(aCustomShapeGeometry["Type"].has<OUString>());
+ OUString aType = aCustomShapeGeometry["Type"].get<OUString>();
+ CPPUNIT_ASSERT_EQUAL(OUString("ooxml-leftRightArrow"), aType);
}
void SdImportTestSmartArt::testHorizontalBulletList()