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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Feb 25 15:15:26 UTC 2019


 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 90372d52fdcc378473b89f4e6f2de0e206c110ef
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Feb 25 14:07:03 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Feb 25 16:14:57 2019 +0100

    oox smartart, picture strip: fetch # of children only once in snake algo
    
    No functional changes intended.
    
    Change-Id: I847f725a5ecf516755a4b6d85e3180979520eee2
    Reviewed-on: https://gerrit.libreoffice.org/68344
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 4cf36186322c..837755e189d4 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -931,8 +931,6 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             sal_Int32 nStartX = aCurrPos.X;
             sal_Int32 nColIdx = 0,index = 0;
 
-            sal_Int32 num = rShape->getChildren().size();
-
             const sal_Int32 aContDir = maMap.count(XML_contDir) ? maMap.find(XML_contDir)->second : XML_sameDir;
 
             switch(aContDir)
@@ -952,7 +950,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
                     if(++nColIdx == nCol) // condition for next row
                     {
                         // if last row, then position children according to number of shapes.
-                        if((index+1)%nCol!=0 && (index+1)>=3 && ((index+1)/nCol+1)==nRow && num!=nRow*nCol)
+                        if((index+1)%nCol!=0 && (index+1)>=3 && ((index+1)/nCol+1)==nRow && nCount!=nRow*nCol)
                             // position first child of last row
                             aCurrPos.X = nStartX + (nIncX * (aChildSize.Width + fSpace*aChildSize.Width))/2;
                         else
@@ -991,10 +989,10 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
                     if(++nColIdx == nCol) // condition for next row
                     {
                         // if last row, then position children according to number of shapes.
-                        if((index+1)%nCol!=0 && (index+1)>=4 && ((index+1)/nCol+1)==nRow && num!=nRow*nCol && ((index/nCol)+1)%2==0)
+                        if((index+1)%nCol!=0 && (index+1)>=4 && ((index+1)/nCol+1)==nRow && nCount!=nRow*nCol && ((index/nCol)+1)%2==0)
                             // position first child of last row
                             aCurrPos.X -= aChildSize.Width*3/2;
-                        else if((index+1)%nCol!=0 && (index+1)>=4 && ((index+1)/nCol+1)==nRow && num!=nRow*nCol && ((index/nCol)+1)%2!=0)
+                        else if((index+1)%nCol!=0 && (index+1)>=4 && ((index+1)/nCol+1)==nRow && nCount!=nRow*nCol && ((index/nCol)+1)%2!=0)
                             aCurrPos.X = nStartX + (nIncX * (aChildSize.Width + fSpace*aChildSize.Width))/2;
                         else if(((index/nCol)+1)%2!=0)
                             aCurrPos.X = nStartX;


More information about the Libreoffice-commits mailing list