summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-10-03 19:40:22 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-10-10 11:34:42 +0200
commite155c38e75dff41d7e80ade3c7aa9e8e69572ad4 (patch)
tree15dbd20768f0d26224343a608dd41ec1ed39c2d0
parenttdf#98067 get menu readable in windows high contrast mode (diff)
downloadcore-e155c38e75dff41d7e80ade3c7aa9e8e69572ad4.tar.gz
core-e155c38e75dff41d7e80ade3c7aa9e8e69572ad4.zip
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/+/140888 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit f171d9af9bb13ec037841d7c8aa11fcc628c303c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141056 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-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 7d2683ab3ed4..1195417a95ce 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2212,7 +2212,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;