diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-08-03 11:18:49 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-08-05 10:46:17 +0200 |
commit | 2b4d3b05b345280368d6277dbbcf470e92937e46 (patch) | |
tree | 3becfdbc252c23f338b05844f80abdf238a154ab /oox/source | |
parent | 1d68ea619ca08264ec357e4388ac2da2b7473d2b (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/+/100114
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox/source')
-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 e23226de61a8..13e684d7b76f 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -927,9 +927,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") |