From f4fbb127897ea6afe27055d3b6cfcb0441080902 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 28 Feb 2019 15:00:01 +0100 Subject: 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 Tested-by: Jenkins --- sd/qa/unit/import-tests-smartart.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sd') 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(nWidth * fFactor), nTextLeftDistance); + // Make sure that aspect ratio is not ignored, i.e. width is not larger than height 3 times. + uno::Reference 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(); } -- cgit