summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-02-28 15:00:01 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-02-28 20:27:12 +0100
commitf4fbb127897ea6afe27055d3b6cfcb0441080902 (patch)
tree5949d20ae0d64709ffa629405542abf783ddcb5d /sd
parent609ea85b530185910bf326201f785fd32bcbad2b (diff)
oox smartart, picture strip: fix too wide child shapes
Once the constraints determine the size, the aspect ratio may shrink one dimension to achieve the requested ratio. Implement the case where a >1 ratio shrinks the width, so the container of the image-text shape pair has correct aspect ratio. Change-Id: I7bac764c031e80bac532c4f97ebd5b5096401096 Reviewed-on: https://gerrit.libreoffice.org/68510 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 3a98496735ef..22513adc312a 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -980,6 +980,13 @@ void SdImportTestSmartArt::testPictureStrip()
// Actual : 263', i.e. the left margin was too small.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(nWidth * fFactor), nTextLeftDistance);
+ // Make sure that aspect ratio is not ignored, i.e. width is not larger than height 3 times.
+ uno::Reference<drawing::XShape> xFirstPair = getChildShape(xGroup, 0);
+ awt::Size aFirstPairSize = xFirstPair->getSize();
+ // Without the accompanying fix in place, this test would have failed: bad width was 16932, good
+ // width is 12540, but let's accept 12541 as well.
+ CPPUNIT_ASSERT_LESSEQUAL(aFirstPairSize.Height * 3 + 1, aFirstPairSize.Width);
+
xDocShRef->DoClose();
}