summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-02-26 09:44:00 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-02-26 10:44:31 +0100
commit159e33ec661b2ce038b2642b2f30600ce7901d1b (patch)
treeb2cd2dc577d732ce2ad377a55936e79d0fb94d59 /sd
parent3caf379f1c6398548c65bb7a83e3911d9a8bc444 (diff)
oox smartart, picture strip: fix too many columns with aspect ratio request
The bugdoc has 3 items in the picture strip and PowerPoint laid this out as a single column with 3 rows (as a snake algorithm). We used to put the first two items to the first row and the third item to the second row. Improve out layout by taking into account what aspect ratio the child algorithms request: this way it's obvious that we should use a single column in case we have a large enough aspect ratio and few enough items. (PowerPoint also uses multiple columns without the aspect ratio request.) Change-Id: I9f1158c04c665fc6a2c85e4ac3a1ed363b1c75fb Reviewed-on: https://gerrit.libreoffice.org/68370 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/smartart-picture-strip.pptxbin47565 -> 47928 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-picture-strip.pptx b/sd/qa/unit/data/pptx/smartart-picture-strip.pptx
index 4c379dfd396c..b117e4e70cf6 100644
--- a/sd/qa/unit/data/pptx/smartart-picture-strip.pptx
+++ b/sd/qa/unit/data/pptx/smartart-picture-strip.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 22d781950176..0d47ad679edb 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -940,6 +940,21 @@ void SdImportTestSmartArt::testPictureStrip()
// xSecondImage had the bitmap fill from the second shape.
CPPUNIT_ASSERT(aFirstGraphic.GetChecksum() != aSecondGraphic.GetChecksum());
+ // Test that the 3 images are in a single column, in 3 rows.
+ uno::Reference<drawing::XShape> xFirstImageShape(xFirstImage, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xFirstImage.is());
+ uno::Reference<drawing::XShape> xSecondImageShape(xSecondImage, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xSecondImage.is());
+ uno::Reference<drawing::XShape> xThirdImageShape(getChildShape(getChildShape(xGroup, 2), 1),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xThirdImageShape.is());
+ // Without the accompanying fix in place, this test would have failed: the first and the second
+ // image were in the same row.
+ CPPUNIT_ASSERT_EQUAL(xFirstImageShape->getPosition().X, xSecondImageShape->getPosition().X);
+ CPPUNIT_ASSERT_EQUAL(xSecondImageShape->getPosition().X, xThirdImageShape->getPosition().X);
+ CPPUNIT_ASSERT_GREATER(xFirstImageShape->getPosition().Y, xSecondImageShape->getPosition().Y);
+ CPPUNIT_ASSERT_GREATER(xSecondImageShape->getPosition().Y, xThirdImageShape->getPosition().Y);
+
xDocShRef->DoClose();
}