summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-10-03 19:40:22 +0200
committerCaolán McNamara <caolanm@redhat.com>2022-10-03 21:14:38 +0200
commit1896d200ecc775aa3a66cc772adc635332562f21 (patch)
tree52e05c9fd7520e8f84f3d3005ee4b6e48ffb3b5c /cui
parent5d155e920334b6d2f03276eedf4471989dae9105 (diff)
cui: avoid divide by zero in SvxNumberingPreview::Paint
Just check for pActNum->GetLevelCount() > 1 as done later for nYStep See https://crashreport.libreoffice.org/stats/signature/SvxNumberingPreview::Paint(OutputDevice%20&,tools::Rectangle%20const%20&) Change-Id: I0e9518dafe50b2b10a83487e9247e2fd46f9decd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140921 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/numpages.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 050e8c7c0ec8..57648fa612db 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2202,7 +2202,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool
tools::Long nWidthRelation = 30; // chapter dialog
// height per level
- tools::Long nXStep = aSize.Width() / (3 * pActNum->GetLevelCount());
+ tools::Long nXStep = aSize.Width() / (pActNum->GetLevelCount() > 1 ? 3 * pActNum->GetLevelCount() : 3);
if (pActNum->GetLevelCount() < 10)
nXStep /= 2;
tools::Long nYStart = 4;