From 8638cc1b737195df16a160b148d2cd2c68131174 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 14 Jan 2019 15:10:19 +0100 Subject: 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 Tested-by: Jenkins --- sd/qa/unit/data/pptx/smartart-org-chart.pptx | Bin 53038 -> 57764 bytes sd/qa/unit/import-tests-smartart.cxx | 15 +++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'sd') 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 Binary files a/sd/qa/unit/data/pptx/smartart-org-chart.pptx and b/sd/qa/unit/data/pptx/smartart-org-chart.pptx 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 xManager2( + getChildShape(getChildShape(getChildShape(xGroup, 1), 0), 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xManager2.is()); + CPPUNIT_ASSERT_EQUAL(OUString("Manager2"), xManager2->getString()); + + uno::Reference 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(); } -- cgit