sw/source/core/edit/edfcol.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit 5dadc59dd1f9b4ff27221e231a5f37d31e9a41f5 Author: Caolán McNamara <caol...@redhat.com> Date: Fri May 26 10:39:47 2017 +0100 coverity#1409893 Division or modulo by float zero Change-Id: I697e9c7772792b02257ed1f40666dd70bb70300c Reviewed-on: https://gerrit.libreoffice.org/38914 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index c2cf6252dec0..b44cdf43a115 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -425,8 +425,12 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark) OutputDevice* pOut = Application::GetDefaultDevice(); vcl::Font aFont(pOut->GetFont()); aFont.SetFamilyName(sFont); - fRatio = aFont.GetFontSize().Height(); - fRatio /= pOut->GetTextWidth(rWatermark.GetText()); + auto nTextWidth = pOut->GetTextWidth(rWatermark.GetText()); + if (nTextWidth) + { + fRatio = aFont.GetFontSize().Height(); + fRatio /= nTextWidth; + } // Calc the size. sal_Int32 nWidth = 0;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits