summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-02 08:50:02 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-10-02 15:12:37 +0200
commita5963ebb46098be9aac32ff3d582255d97521df4 (patch)
tree0ee7452c91747db777a933d2e983e7f106ed9dcd /oox
parent330f26bea4358658ac84b6d87270229fe71deb02 (diff)
cid#1467667 Division or modulo by float zero
Change-Id: Ia332896190e09d6c5459ce80819c8f1263a60873 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103815 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index d1280406fedb..644c31790d64 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -321,11 +321,11 @@ void SnakeAlg::layoutShapeChildren(const AlgAtom::ParamMap& rMap, const ShapePtr
awt::Size aCurrSize(aChildSize);
// aShapeWidths items are a portion of nMaxRowWidth. We want the same ratio,
// based on the original parent width, ignoring the aspect ratio request.
- double fWidthFactor = static_cast<double>(aShapeWidths[index]) / nMaxRowWidth;
bool bWidthsFromConstraints
= nCount >= 2 && rShape->getChildren()[1]->getDataNodeType() == XML_sibTrans;
- if (bWidthsFromConstraints)
+ if (bWidthsFromConstraints && nMaxRowWidth)
{
+ double fWidthFactor = static_cast<double>(aShapeWidths[index]) / nMaxRowWidth;
// We can only work from constraints if spacing is represented by a real
// child shape.
aCurrSize.Width = rShape->getSize().Width * fWidthFactor;