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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 2 13:13:19 UTC 2020


 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a5963ebb46098be9aac32ff3d582255d97521df4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 2 08:50:02 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Oct 2 15:12:37 2020 +0200

    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 at redhat.com>

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;


More information about the Libreoffice-commits mailing list