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

ekuiitr jhaekansh80 at gmail.com
Mon Jun 11 10:26:14 UTC 2018


 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |   15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

New commits:
commit 3f8fdfced059bdec7f28164eb3c0e99974c6780a
Author: ekuiitr <jhaekansh80 at gmail.com>
Date:   Mon Jun 11 00:11:23 2018 +0530

    coverity#1436015 UNUSED_VALUE
    
    I got to know that, earlier the code I've submitted about line algorithm
    creates error. I've fixed that in this patch. Moreover, child width and
    height doesn't depend of nIncX and nIncY, so I've removed that code, it
    relates only to the position of the child.
    
    Change-Id: I9f4bdec87fc20340c21daed60246b9898967ab50
    Reviewed-on: https://gerrit.libreoffice.org/55564
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index c085fb6daa7f..72fc01a5fe9f 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -356,15 +356,9 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             double fSpace = 0.3;
 
             awt::Size aChildSize = rShape->getSize();
-            if (nIncX)
-                aChildSize.Width /= (nCount + (nCount-1)*fSpace);
-            if (nIncY)
-                aChildSize.Height /= (nCount + (nCount-1)*fSpace);
 
-            if(nCount <= 2 && nIncY)
-                aChildSize.Height /= 2;
-            else
-                aChildSize.Height /= (nCount+1);
+            aChildSize.Width /= (nCount + (nCount-1)*fSpace);
+            aChildSize.Height /= (nCount + (nCount-1)*fSpace);
 
             awt::Point aCurrPos(0, 0);
             if (nIncX == -1)
@@ -372,11 +366,6 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             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