summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-11 15:39:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-12 13:33:15 +0200
commit2bc1758239dc3e76ef604fccf9d1c58eeba967e5 (patch)
treef85c041e24fae71e966fb60f5d8bb7ad22e2d563
parentce8b63ed20aa9ce8a36c3b2c02a4f74459e91229 (diff)
coverity#1430087 Division by zero
Change-Id: Ie29773a3f0a3fcadd633f09e6355b801945933c2 Reviewed-on: https://gerrit.libreoffice.org/54140 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/tabpages/grfpage.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 51a393db83a4..6b148013bb00 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -489,7 +489,7 @@ IMPL_LINK( SvxGrfCropPage, CropHdl, SpinField&, rField, void )
long nLeft = lcl_GetValue( *m_pLeftMF, eUnit );
long nRight = lcl_GetValue( *m_pRightMF, eUnit );
long nWidthZoom = static_cast<long>(m_pWidthZoomMF->GetValue());
- if(bZoom && ( ( ( aOrigSize.Width() - (nLeft + nRight )) * nWidthZoom )
+ if (bZoom && nWidthZoom != 0 && ( ( ( aOrigSize.Width() - (nLeft + nRight )) * nWidthZoom )
/ 100 >= aPageSize.Width() ) )
{
if(&rField == m_pLeftMF)