diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-04-28 15:38:56 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2022-05-06 18:39:30 +0200 |
commit | 4c2a776959da0b7270c9d57289deed4a076c5d51 (patch) | |
tree | f76f72ad530ec3448e5bbfb069adb32706a4b635 | |
parent | sw: avoid one more EXCEPTION_INT_DIVIDE_BY_ZERO (diff) | |
download | core-4c2a776959da0b7270c9d57289deed4a076c5d51.tar.gz core-4c2a776959da0b7270c9d57289deed4a076c5d51.zip |
sw: avoid EXCEPTION_INT_DIVIDE_BY_ZERO
Seen in
https://crashreport.libreoffice.org/stats/signature/SwBookmarkPortion::DoPaint(SwTextPaintInfo%20const%20&,rtl::OUString%20&,SwFont%20&,int%20&)
Introduced by 4ce8120f1e53f7b81e653b01d141643013bc69ab
"tdf#45589 sw: create and paint text portions for bookmarks"
Change-Id: I7d025878164e1f97b86f9d129af9ba93e93b6ba3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133562
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 7c8b9fa98f4c5f7f5620e797dbbe24081e252548)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133602
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit e2ee797ebba6ee52387cbbd662ee35d84943f0ce)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133721
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r-- | sw/source/core/text/porrst.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 1164a0fcb183..7e93011973ca 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -594,7 +594,7 @@ bool SwBookmarkPortion::DoPaint(SwTextPaintInfo const& rTextPaintInfo, Size aSize(rFont.GetSize(rFont.GetActual())); // use also the external leading (line gap) of the portion, but don't use // 100% of it because i can't figure out how to baseline align that - auto const nFactor = (Height() * 95) / aSize.Height(); + auto const nFactor = aSize.Height() > 0 ? (Height() * 95) / aSize.Height() : Height(); rFont.SetProportion(nFactor); rFont.SetWeight(WEIGHT_THIN, rFont.GetActual()); rFont.SetColor(NON_PRINTING_CHARACTER_COLOR); |