sw/source/uibase/wrtsh/wrtsh1.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
New commits: commit 59e13bdd6d894f48b73eacd339d0ecfa0be87e74 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Apr 18 14:37:32 2023 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Wed Apr 19 12:12:14 2023 +0200 sw: fix divide by 0 See https://crashreport.libreoffice.org/stats/signature/operator/(Fraction%20const%20&,Fraction%20const%20&) Change-Id: Ia93e2969d6eb0bde71c8419f2aa90bb7aa231f61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150553 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit d01dae0cbabc27f2ff2a242316206067cff73cf8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150562 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index b989343266cb..3ef6559cae34 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -914,8 +914,13 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, } else { - aArea.Width ( tools::Long( aArea.Width() / pCli->GetScaleWidth() ) ); - aArea.Height( tools::Long( aArea.Height() / pCli->GetScaleHeight() ) ); + tools::Long nWidth(pCli->GetScaleWidth()); + tools::Long nHeight(pCli->GetScaleHeight()); + if (nWidth && nHeight) + { + aArea.Width ( aArea.Width() / nWidth ); + aArea.Height( aArea.Height() / nHeight ); + } } pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );