diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-05-31 13:29:00 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-06-09 11:00:57 +0200 |
commit | 4850317481b3dcc08c124904fe7826e0156276ff (patch) | |
tree | f2838bd3f1c4a4a6eaa107cd3a314b6051f4c276 /sw | |
parent | ac3969aaf5b57d0d0834fabb43430fbd1c1d13ef (diff) |
sw: avoid EXCEPTION_INT_DIVIDE_BY_ZERO
See https://crashreport.libreoffice.org/stats/signature/SwFormatCol::Calc(unsigned%20short,unsigned%20short)
Change-Id: I79321737b7bed3acff3418d0b51dc6225baaf57f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135184
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit ea4cd397300120a0f825752182eb3b943eb8a1b2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135254
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 4791fda80169..5876f3624c53 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1065,7 +1065,7 @@ void SwFormatCol::Calc( sal_uInt16 nGutterWidth, sal_uInt16 nAct ) { tools::Long nTmp = rCol.GetWishWidth(); nTmp *= GetWishWidth(); - nTmp /= nAct; + nTmp = nAct == 0 ? nTmp : nTmp / nAct; rCol.SetWishWidth(sal_uInt16(nTmp)); } } |