summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-04-25 15:52:29 +0200
committerAron Budea <aron.budea@collabora.com>2024-05-07 03:42:38 +0200
commit35c0afcf0a0428670e3e1998f222440b504ae0c8 (patch)
tree56664cde245b660ccfba46ae235ef037b5dbf23d
parent2165fa986408a2ee53c56ee18936f69ed97d40e3 (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> (cherry picked from commit 90548039f09d4bc773bf6879a62d544adfa175db) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166674 Reviewed-by: Aron Budea <aron.budea@collabora.com>
-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 );