| commit | be7ce49f33035fcd289a5ffc7a2307bd9a566780 | [log] |
|---|---|---|
| author | Xisco Fauli <xiscofauli@libreoffice.org> | Tue Apr 18 14:37:32 2023 +0200 |
| committer | Xisco Fauli <xiscofauli@libreoffice.org> | Tue Apr 18 16:55:52 2023 +0200 |
| tree | a7dd1f37ec44654d49a732115a281d1828fcecab | |
| parent | 4b3308a8c24d71c30145c93411fab12c66660b5e [diff] |
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 <caolanm@redhat.com> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 7073ce1..65f434d 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 );