summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-04-25 15:52:29 +0200
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-04-25 20:47:41 +0200
commit90548039f09d4bc773bf6879a62d544adfa175db (patch)
tree725eb5a7d88f0bf71496dc2f1389b05da9a17b41 /svx
parent15d19cb69db25f99f7225c2708cda4a17cc7a053 (diff)
svx: Avoid divide by 0
See https://crashreport.libreoffice.org/stats/signature/SvxRuler::UpdateTabs() Change-Id: Ie08c54d1a1b40bcc42da9f81c893f496fff433a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166626 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/svxruler.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6323583fd271..17c4edaa930d 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1033,7 +1033,7 @@ void SvxRuler::UpdateTabs()
lCurrentDefTabDist = mxTabStopItem->GetDefaultDistance();
tools::Long nDefTabDist = ConvertHPosPixel(lCurrentDefTabDist);
- const sal_uInt16 nDefTabBuf = lPosPixel > lRightIndent || lLastTab > lRightIndent
+ const sal_uInt16 nDefTabBuf = lPosPixel > lRightIndent || lLastTab > lRightIndent || nDefTabDist == 0
? 0
: static_cast<sal_uInt16>( (lRightIndent - lPosPixel) / nDefTabDist );