summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-05-27 14:04:58 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-05-28 14:40:46 +0200
commit3d3066b124b23d18a06fbd14938e18696dc5c9cd (patch)
treece7a9c78644d957aad1979074c990abc62305c52 /sd
parent51b40687d41aab9576dd4e2620c3cd5231732d58 (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. Change-Id: I436019e9e837b73130e387c9bcd309e20045b0f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94948 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit acdde3c643fde015214c546b1567727272ea799e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94962
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 67db3deb4cc6..f08b60c30193 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -1498,6 +1498,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();
}