summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-02-25 14:07:03 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-02-25 16:14:57 +0100
commit90372d52fdcc378473b89f4e6f2de0e206c110ef (patch)
treeac9328bdf39f92a7d03ba8f41aebeec7153dea3c /oox
parent79d7e69384ed7af40f1f87965f5f5dc723d8e188 (diff)
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@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx8
1 files changed, 3 insertions, 5 deletions
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;