From b4e9171e598dd6c2a5774b079e0b3203aaf1b29d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 2 Apr 2018 11:35:53 +0100 Subject: ofz#7229 Divide by zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7bd2f19d5dc99e9041b3ef0fc10caef6d8b7ca6a Reviewed-on: https://gerrit.libreoffice.org/52253 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/filter/ww8/ww8par6.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sw/source/filter/ww8/ww8par6.cxx') diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index a476a800dc93..2f6e45f1d373 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -330,6 +330,10 @@ bool wwSectionManager::SetCols(SwFrameFormat &rFormat, const wwSection &rSection if (nCols < 2) //check for no columns or other weird state return false; + const sal_uInt16 nNetWriterWidth = writer_cast(nNetWidth); + if (nNetWriterWidth == 0) + return false; + SwFormatCol aCol; // Create SwFormatCol //sprmSDxaColumns - Default distance is 1.25 cm @@ -346,8 +350,7 @@ bool wwSectionManager::SetCols(SwFrameFormat &rFormat, const wwSection &rSection aCol.SetLineWidth(1); } - aCol.Init(nCols, writer_cast(nColSpace), - writer_cast(nNetWidth)); + aCol.Init(nCols, writer_cast(nColSpace), nNetWriterWidth); // sprmSFEvenlySpaced if (!rSep.fEvenlySpaced) @@ -365,7 +368,7 @@ bool wwSectionManager::SetCols(SwFrameFormat &rFormat, const wwSection &rSection pCol->SetLeft(writer_cast(nLeft)); pCol->SetRight(writer_cast(nRight)); } - aCol.SetWishWidth(writer_cast(nNetWidth)); + aCol.SetWishWidth(nNetWriterWidth); } rFormat.SetFormatAttr(aCol); return true; -- cgit