From b193ca37569f0e916a9d827e8a78ebbba4577a5b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 31 Jul 2020 15:59:10 +0200 Subject: oox smartart, linear layout: correctly scale spacings wrt constraints and rules When constraints request a width which is larger than 100%, we scale down. Then rules decide which children should be scaled down and which ones stay as-is. This commit adjusts the size of children which have no rule, but their size has a constraint that they're a fraction of a scaled down child. (cherry picked from commit 91f0f7e5e0a55cb1dbd729a1d7de52388b1cfb15) Change-Id: I0a007d82f49f18951215afb1bfe8c0f1328ecd41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100111 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna --- sd/qa/unit/data/pptx/smartart-linear-rule.pptx | Bin 43353 -> 43760 bytes sd/qa/unit/import-tests-smartart.cxx | 8 ++++++++ 2 files changed, 8 insertions(+) (limited to 'sd') diff --git a/sd/qa/unit/data/pptx/smartart-linear-rule.pptx b/sd/qa/unit/data/pptx/smartart-linear-rule.pptx index f5fbb5c87a54..e76dfd9ee770 100644 Binary files a/sd/qa/unit/data/pptx/smartart-linear-rule.pptx and b/sd/qa/unit/data/pptx/smartart-linear-rule.pptx differ diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index eba7aa4e748b..b64f7f997412 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -1507,6 +1507,14 @@ void SdImportTestSmartArt::testLinearRule() // i.e. the width of the background arrow was too small. CPPUNIT_ASSERT_GREATER(static_cast(17500), xShape->getSize().Width); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 3160 + // - Actual : 8770 + // i.e. there was unexpected spacing on the left of the arrow. + sal_Int32 nGroupLeft = xGroup->getPosition().X; + sal_Int32 nArrowLeft = xShape->getPosition().X; + CPPUNIT_ASSERT_EQUAL(nGroupLeft, nArrowLeft); + xDocShRef->DoClose(); } -- cgit