diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-07-31 15:59:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-08-05 11:26:01 +0200 |
commit | 14e664db5211f8c398ee58dded853e12ac9142de (patch) | |
tree | a440c1f0e75cbfafcf8f712f46c7d17d5c2ea784 /sd | |
parent | 84a3c0a924dd074c2c3255739e037f475b7238a5 (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.
(cherry picked from commit 91f0f7e5e0a55cb1dbd729a1d7de52388b1cfb15)
Change-Id: I0a007d82f49f18951215afb1bfe8c0f1328ecd41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100103
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
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 84d6450b0df7..556b1562c584 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -1525,6 +1525,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(); } |