summaryrefslogtreecommitdiffstats
path: root/sw/source/core/text/porrst.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/text/porrst.cxx')
-rw-r--r--sw/source/core/text/porrst.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 654ddec99fea..213cb3b5e7e0 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -540,7 +540,7 @@ bool SwBookmarkPortion::DoPaint(SwTextPaintInfo const& rInf,
Size size(rTmpFont.GetSize(rTmpFont.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) / size.Height();
+ auto const nFactor = size.Height() > 0 ? (Height() * 95) / size.Height() : Height();
rTmpFont.SetProportion(nFactor);
rTmpFont.SetWeight(WEIGHT_THIN, rTmpFont.GetActual());
rTmpFont.SetColor(NON_PRINTING_CHARACTER_COLOR);