summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-01-14 15:10:19 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-01-14 17:43:00 +0100
commit8638cc1b737195df16a160b148d2cd2c68131174 (patch)
tree0898e100da01be9ce982e0cc6d5cafdec5e61557 /sd
parentbe78f86cd0b0b819abe9f7db5d605ac0df191653 (diff)
oox smartart, org chart: fix height of manager nodes without employees
Employees and/or assistants reduce the height of managers -- this effect is wanted even if there are no employees/assistants. Change-Id: I7bfcbf6819ee225aa2fbf21d4e064322912f8d5f Reviewed-on: https://gerrit.libreoffice.org/66304 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/smartart-org-chart.pptxbin53038 -> 57764 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-org-chart.pptx b/sd/qa/unit/data/pptx/smartart-org-chart.pptx
index df6e0521fdca..08c9a4fc916d 100644
--- a/sd/qa/unit/data/pptx/smartart-org-chart.pptx
+++ b/sd/qa/unit/data/pptx/smartart-org-chart.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 5895289ad0ce..66fdfbc254cd 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -718,6 +718,7 @@ void SdImportTestSmartArt::testOrgChart()
CPPUNIT_ASSERT(xManagerShape.is());
awt::Point aManagerPos = xManagerShape->getPosition();
+ 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
@@ -776,6 +777,20 @@ void SdImportTestSmartArt::testOrgChart()
// assistant shape was below the employee shape.
CPPUNIT_ASSERT_GREATER(aAssistantPos.Y, aEmployeePos.Y);
+ // Make sure the height of xManager and xManager2 is the same.
+ uno::Reference<text::XText> xManager2(
+ getChildShape(getChildShape(getChildShape(xGroup, 1), 0), 0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xManager2.is());
+ CPPUNIT_ASSERT_EQUAL(OUString("Manager2"), xManager2->getString());
+
+ uno::Reference<drawing::XShape> xManager2Shape(xManager2, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xManager2Shape.is());
+
+ awt::Size aManager2Size = xManager2Shape->getSize();
+ // Without the accompanying fix in place, this test would have failed:
+ // xManager2's height was 3 times larger than xManager's height.
+ CPPUNIT_ASSERT_EQUAL(aManagerSize.Height, aManager2Size.Height);
+
xDocShRef->DoClose();
}