diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-07-31 15:59:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-07-31 18:09:52 +0200 |
commit | 91f0f7e5e0a55cb1dbd729a1d7de52388b1cfb15 (patch) | |
tree | dce9f3135ae0a13c7744384a293a99f6311e1ffd /sd | |
parent | f14103af303bcd8a2114c569ae0cb58074f4afe9 (diff) |
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.
Change-Id: I0a007d82f49f18951215afb1bfe8c0f1328ecd41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99875
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/smartart-linear-rule.pptx | bin | 43353 -> 43760 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 8 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-linear-rule.pptx b/sd/qa/unit/data/pptx/smartart-linear-rule.pptx Binary files differindex f5fbb5c87a54..e76dfd9ee770 100644 --- a/sd/qa/unit/data/pptx/smartart-linear-rule.pptx +++ b/sd/qa/unit/data/pptx/smartart-linear-rule.pptx diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index cbe1507cd33c..4bc60fc874c1 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -1541,6 +1541,14 @@ void SdImportTestSmartArt::testLinearRule() // i.e. the width of the background arrow was too small. CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(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(); } |