summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-07-31 15:59:10 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-08-05 10:45:38 +0200
commitb193ca37569f0e916a9d827e8a78ebbba4577a5b (patch)
treeab85a3b7b021aeeaf9de391456cc35b923ab8ac3 /sd
parent34b0e97c25a943c2e4ba98750b970bee542f5819 (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/+/100111 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/smartart-linear-rule.pptxbin43353 -> 43760 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx8
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
index f5fbb5c87a54..e76dfd9ee770 100644
--- a/sd/qa/unit/data/pptx/smartart-linear-rule.pptx
+++ b/sd/qa/unit/data/pptx/smartart-linear-rule.pptx
Binary files 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<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();
}