summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-01-14 15:10:19 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-01-14 17:43:00 +0100
commit8638cc1b737195df16a160b148d2cd2c68131174 (patch)
tree0898e100da01be9ce982e0cc6d5cafdec5e61557 /oox
parentbe78f86cd0b0b819abe9f7db5d605ac0df191653 (diff)
oox smartart, org chart: fix height of manager nodes without employees
Employees and/or assistants reduce the height of managers -- this effect is wanted even if there are no employees/assistants. Change-Id: I7bfcbf6819ee225aa2fbf21d4e064322912f8d5f Reviewed-on: https://gerrit.libreoffice.org/66304 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index e768bebf362d..0e091da68b0e 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -552,6 +552,13 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
sal_Int32 nCount = rShape->getChildren().size();
+ // A manager node's height should be indepdenent from if it has
+ // assistants and employees, compensate for that.
+ bool bTop = mnType == XML_hierRoot && rShape->getInternalName() == "hierRoot1";
+ double fHeightScale = 1.0;
+ if (mnType == XML_hierRoot && nCount < 3 && bTop)
+ fHeightScale = fHeightScale * nCount / 3;
+
if (mnType == XML_hierRoot && nCount == 3)
{
// Order assistant nodes above employee nodes.
@@ -563,7 +570,10 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
awt::Size aChildSize = rShape->getSize();
if (nDir == XML_fromT)
+ {
aChildSize.Height /= nCount;
+ aChildSize.Height *= fHeightScale;
+ }
else
aChildSize.Width /= nCount;