diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-08-03 11:18:49 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-08-05 11:26:28 +0200 |
commit | 1a16bb0de0d40084fdbcb5d7a875037b34e336e4 (patch) | |
tree | 03d9ec33147059fd9e09394b1ae9b1685cdcf673 /oox | |
parent | d5bff7f5e4b10ec42395efa3cd0520c40c06a356 (diff) |
oox smartart, linear layout: limit height of children to parent size
Constraints are OK to request more, but it seems PowerPoint doesn't
allow leaving the parent, which simplifies the layout as well.
(cherry picked from commit b7481a026348c3417fa13a440312521dccee9ec8)
Change-Id: Id67a8740f1eff506e4beae0c797ad50e0218dfe6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100105
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 24e5422ce654..cc0e456fa25d 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -926,9 +926,21 @@ void AlgAtom::layoutShape(const ShapePtr& rShape, const std::vector<Constraint>& LayoutProperty& rProperty = aProperties[rConstraint.msForName]; if (rConstraint.mnType == XML_w) + { rProperty[XML_w] = rShape->getSize().Width * rConstraint.mfFactor; + if (rProperty[XML_w] > rShape->getSize().Width) + { + rProperty[XML_w] = rShape->getSize().Width; + } + } if (rConstraint.mnType == XML_h) + { rProperty[XML_h] = rShape->getSize().Height * rConstraint.mfFactor; + if (rProperty[XML_h] > rShape->getSize().Height) + { + rProperty[XML_h] = rShape->getSize().Height; + } + } // TODO: get values from differently named constraints as well if (rConstraint.msForName == "sp" || rConstraint.msForName == "space" || rConstraint.msForName == "sibTrans") |