Kaydet (Commit) 90372d52 authored tarafından Miklos Vajna's avatar Miklos Vajna

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/68344Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
üst 79d7e693
...@@ -931,8 +931,6 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, ...@@ -931,8 +931,6 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
sal_Int32 nStartX = aCurrPos.X; sal_Int32 nStartX = aCurrPos.X;
sal_Int32 nColIdx = 0,index = 0; 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; const sal_Int32 aContDir = maMap.count(XML_contDir) ? maMap.find(XML_contDir)->second : XML_sameDir;
switch(aContDir) switch(aContDir)
...@@ -952,7 +950,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, ...@@ -952,7 +950,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
if(++nColIdx == nCol) // condition for next row if(++nColIdx == nCol) // condition for next row
{ {
// if last row, then position children according to number of shapes. // 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 // position first child of last row
aCurrPos.X = nStartX + (nIncX * (aChildSize.Width + fSpace*aChildSize.Width))/2; aCurrPos.X = nStartX + (nIncX * (aChildSize.Width + fSpace*aChildSize.Width))/2;
else else
...@@ -991,10 +989,10 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, ...@@ -991,10 +989,10 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
if(++nColIdx == nCol) // condition for next row if(++nColIdx == nCol) // condition for next row
{ {
// if last row, then position children according to number of shapes. // 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 // position first child of last row
aCurrPos.X -= aChildSize.Width*3/2; 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; aCurrPos.X = nStartX + (nIncX * (aChildSize.Width + fSpace*aChildSize.Width))/2;
else if(((index/nCol)+1)%2!=0) else if(((index/nCol)+1)%2!=0)
aCurrPos.X = nStartX; aCurrPos.X = nStartX;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment