diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 80f99673243b..d1c172862541 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -261,7 +261,9 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, for ( ; nColgetSize().Height / nRow) / (rShape->getSize().Width / nCol) >= fAspectRatio) + const double fShapeHeight = rShape->getSize().Height; + const double fShapeWidth = rShape->getSize().Width; + if ((fShapeHeight / nRow) / (fShapeWidth / nCol) >= fAspectRatio) break; } SAL_INFO("oox.drawingml", "Snake layout grid: " << nCol << "x" << nRow);