diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-02-18 14:24:16 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-18 15:50:04 +0100 |
commit | 5b2e38e0cfc7006d6982f741cf158a8a98dc8630 (patch) | |
tree | e0f9d6bb5e7be58df3b4739b3bbc3bc9a2d4217e /oox | |
parent | reorder to reduce size from 64 to 48 bytes (diff) | |
download | core-5b2e38e0cfc7006d6982f741cf158a8a98dc8630.tar.gz core-5b2e38e0cfc7006d6982f741cf158a8a98dc8630.zip |
oox smartart, cycle matrix: fix too large height in composite algo
The user-level problem was that the height of the entire smartart was
too large. The reason for this was that:
- composite algorithm gets the constraint height should be 77% of width,
this means 6096000 -> 4693920 EMUs
- at the same time the parent container is already smaller, 4064000 EMUs
- a few lines later we already limit the max height with std::min(), but
in the meantime an incorrect y position is calculated, exactly due to
the lack of early limited height
Solve the problem by making sure composite algorithm never works with a
height (even when using it to calculate vertical center) that exceeds
the height of the parent.
Change-Id: Iba29ed8b6e376bf379c40f1cddfce3ae45beff0a
Reviewed-on: https://gerrit.libreoffice.org/67970
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index b3063762cd7a..dc526803f8fe 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -533,9 +533,9 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, LayoutProperty::const_iterator it, it2; if ( (it = rProp.find(XML_w)) != rProp.end() ) - aSize.Width = it->second; + aSize.Width = std::min(it->second, rShape->getSize().Width); if ( (it = rProp.find(XML_h)) != rProp.end() ) - aSize.Height = it->second; + aSize.Height = std::min(it->second, rShape->getSize().Height); if ( (it = rProp.find(XML_l)) != rProp.end() ) aPos.X = it->second; |