sd/source/ui/func/fuzoom.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
New commits: commit 75f2b5a5ed1c0df2487c7be3312e89daf295491e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Aug 8 16:24:29 2022 +0200 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Aug 11 10:11:47 2022 +0200 sd: avoid divide by zero in FuZoom::MouseMove See https://crashreport.libreoffice.org/stats/signature/sd::FuZoom::MouseMove(MouseEvent%20const%20&) Change-Id: I3b07def2ba088a92e2358e7db57c27c047165cef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137988 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 2f5366f05bed04d805cfe469b2ea58b029167095) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137972 diff --git a/sd/source/ui/func/fuzoom.cxx b/sd/source/ui/func/fuzoom.cxx index aa5395267183..871d594d3368 100644 --- a/sd/source/ui/func/fuzoom.cxx +++ b/sd/source/ui/func/fuzoom.cxx @@ -117,10 +117,14 @@ bool FuZoom::MouseMove(const MouseEvent& rMEvt) { Size aWorkSize = mpView->GetWorkArea().GetSize(); Size aPageSize = mpView->GetSdrPageView()->GetPage()->GetSize(); - aScroll.setX( aScroll.X() / ( aWorkSize.Width() / aPageSize.Width()) ); - aScroll.setY( aScroll.Y() / ( aWorkSize.Height() / aPageSize.Height()) ); - mpViewShell->Scroll(aScroll.X(), aScroll.Y()); - aBeginPosPix = aPosPix; + if (aWorkSize.Width() != 0 && aWorkSize.Height() != 0 && + aPageSize.Width() != 0 && aPageSize.Height() != 0) + { + aScroll.setX( aScroll.X() / ( aWorkSize.Width() / aPageSize.Width()) ); + aScroll.setY( aScroll.Y() / ( aWorkSize.Height() / aPageSize.Height()) ); + mpViewShell->Scroll(aScroll.X(), aScroll.Y()); + aBeginPosPix = aPosPix; + } } } else