[Libreoffice-commits] core.git: oox/source

ekuiitr jhaekansh80 at gmail.com
Fri Jun 8 16:18:18 UTC 2018


 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit f1368d6a45456b5682d588371cfa2efa5571d798
Author: ekuiitr <jhaekansh80 at gmail.com>
Date:   Sun May 27 01:49:09 2018 +0530

    Smartart: Corrected Line Algorithm
    
    Earlier it display odd height of the children nodes as compared to
    their width.
    
    Change-Id: I379fb192afc5078d089ef276f35ca5a95ff60cfb
    Reviewed-on: https://gerrit.libreoffice.org/54866
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 92b6e9129591..366759581bc0 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -361,12 +361,22 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             if (nIncY)
                 aChildSize.Height /= (nCount + (nCount-1)*fSpace);
 
+            if(nCount <= 2 && nIncY)
+                aChildSize.Height /= 2;
+            else
+                aChildSize.Height /= (nCount+1);
+
             awt::Point aCurrPos(0, 0);
             if (nIncX == -1)
                 aCurrPos.X = rShape->getSize().Width - aChildSize.Width;
             if (nIncY == -1)
                 aCurrPos.Y = rShape->getSize().Height - aChildSize.Height;
 
+            if(nCount <= 2 && nIncY == -1)
+                aCurrPos.Y = rShape->getSize().Height - aChildSize.Height*2;
+            else
+                aCurrPos.Y = rShape->getSize().Height - aChildSize.Height*(nCount+1);
+
             for (auto & aCurrShape : rShape->getChildren())
             {
                 aCurrShape->setPosition(aCurrPos);


More information about the Libreoffice-commits mailing list