diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-09-30 12:41:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-09-30 14:50:23 +0200 |
commit | 71303c5c23bdb385e9f12c0dbe5d2a0818b836ec (patch) | |
tree | fbea800a5fd0104e2a47689c287175fb0bc645dd /sd/qa | |
parent | fb9b3e68dc4bf88a1a2764cbcd6420dc2a475220 (diff) |
oox smartart: snake algo: make sure child shape height stays within parent
1) When applying double outside spacing, introduced with commit
0a29c928afa74123bca05dc089c751603d368467 (oox smartart, picture strip:
fix lack of spacing around the picture list, 2019-02-26), make sure that
is only applied in the direction of a signle row: i.e. the bugdoc case
is left/right outer spacing, but no top/bottom spacing.
2) If a child shape has an aspect ratio request, make sure that it only
decreases what would be allocated by default, so the children never
leave the parent's rectangle.
3) Fix a mis-match between the first and second row, the unexpected
small left padding in the second row was because code assumed that all
child shapes have the same width; which is not true, when widths come
from constraints.
With this in place, we finally do a good rendering of the bugdoc, and
child shapes are always within the bounds of the background.
Change-Id: Ia2606dcd945402f7dfe17c6e2f261bfd98667022
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103680
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 55cc20343e8e..f9ec7c430fb0 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -1615,14 +1615,12 @@ void SdImportTestSmartArt::testSnakeRows() m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-snake-rows.pptx"), PPTX); uno::Reference<drawing::XShapes> xDiagram(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY); + // Collect position of the background and the real child shapes. First row and background has + // the same top position, unless some unexpected spacing happens, since this is a + // "left-to-right, then top-to-bottom" snake direction. std::set<sal_Int32> aYPositions; for (sal_Int32 nChild = 0; nChild < xDiagram->getCount(); ++nChild) { - if (nChild == 0) - { - // Ignore background shape, we check how many rows actual children use. - continue; - } uno::Reference<drawing::XShape> xChild(xDiagram->getByIndex(nChild), uno::UNO_QUERY); aYPositions.insert(xChild->getPosition().Y); } |