summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-05-27 14:04:58 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2020-05-29 17:23:59 +0200
commitd2cb2ecff3cce10f47a9ae1b1ba80e0eff23745c (patch)
tree99b4e7322a7602763a46c39dee1362a4cd8d8b8b /sd
parent80493ba382647b51e56fc3a5aa3445b0bd17fc0c (diff)
oox smartart import, composite alg: implement vertical centering
The bugdoc's case was that the total height would be used by 2 shapes, but then a constraint decreases the height of one shape, so not all vertical space is used. We used to just count from the top, need to center vertically, as PowerPoint does it. (cherry picked from commit acdde3c643fde015214c546b1567727272ea799e) Change-Id: I436019e9e837b73130e387c9bcd309e20045b0f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95017 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 327645fddc3f..4b110f740e11 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -1480,6 +1480,14 @@ void SdImportTestSmartArt::testFillColorList()
awt::Size aActualSize = xShape->getSize();
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2239), aActualSize.Height);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected greater than: 1738 (2766)
+ // - Actual : 1738
+ // i.e. the columns were not centered vertically.
+ sal_Int32 nGroupTop = xGroup->getPosition().Y;
+ sal_Int32 nShapeTop = xShape->getPosition().Y;
+ CPPUNIT_ASSERT_GREATER(nGroupTop, nShapeTop);
+
xDocShRef->DoClose();
}