summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-01-18 11:10:28 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-01-18 18:14:16 +0100
commitae34f471030869dfc0da1784597cae6f9131f8c5 (patch)
tree96a7901205ca3d4f6ece1db21cc7c3975a8aa627 /sd
parente3cc5506d695b602fbd3c6ee816e36e6a76d9d96 (diff)
oox smartart, org chart: implement support for hierBranch conditions
The relevant part of the layout is the <dgm:layoutNode name="hierChild2"> element that has a <dgm:choose> with two branches: <dgm:if name="Name34" func="var" arg="hierBranch" op="equ" val="std"> <dgm:if name="Name36" func="var" arg="hierBranch" op="equ" val="init"> The connectors were missing as we took the first branch (ConditionAtom::getDecision() returned true if the arg was hierBranch), even hierBranch on the parent layout node was set to "init". With this, the correct number of connectors are created, previously all employee connectors were missing. Their size / position is still incorrect, though. Change-Id: I74a705b13f82a065fc0b9b9d306bfb0dcaf0f7f4 Reviewed-on: https://gerrit.libreoffice.org/66579 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 846a95ee6738..34b9ea439544 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -721,16 +721,15 @@ void SdImportTestSmartArt::testOrgChart()
awt::Size aManagerSize = xManagerShape->getSize();
// Make sure that the manager has 2 employees.
- // Without the accompanying fix in place, this test would have failed with
- // 'Expected: 2; Actual : 1'.
uno::Reference<drawing::XShapes> xEmployees(getChildShape(getChildShape(xGroup, 0), 2),
uno::UNO_QUERY);
CPPUNIT_ASSERT(xEmployees.is());
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xEmployees->getCount());
+ // 4 children: connector, 1st employee, connector, 2nd employee.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), xEmployees->getCount());
uno::Reference<text::XText> xEmployee(
getChildShape(
- getChildShape(getChildShape(getChildShape(getChildShape(xGroup, 0), 2), 0), 0), 0),
+ getChildShape(getChildShape(getChildShape(getChildShape(xGroup, 0), 2), 1), 0), 0),
uno::UNO_QUERY);
CPPUNIT_ASSERT(xEmployee.is());
CPPUNIT_ASSERT_EQUAL(OUString("Employee"), xEmployee->getString());
@@ -752,7 +751,7 @@ void SdImportTestSmartArt::testOrgChart()
// the second employee was below the first one.
uno::Reference<text::XText> xEmployee2(
getChildShape(
- getChildShape(getChildShape(getChildShape(getChildShape(xGroup, 0), 2), 1), 0), 0),
+ getChildShape(getChildShape(getChildShape(getChildShape(xGroup, 0), 2), 3), 0), 0),
uno::UNO_QUERY);
CPPUNIT_ASSERT(xEmployee2.is());
CPPUNIT_ASSERT_EQUAL(OUString("Employee2"), xEmployee2->getString());