diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-22 09:02:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-22 20:48:45 +0200 |
commit | 1dea4f935a97a59dbefd93a6ce250f628989b0ad (patch) | |
tree | ccde08b9c08dd6babbcef445a8602b2ad9b21a16 /chart2 | |
parent | 40d0b880625d2c93162ecc6a95c80772fab47da3 (diff) |
cid#1451627 Division or modulo by float zero
Change-Id: Ifb4b446edb3da3096230e99a898e2fa8c4e9d66c
Reviewed-on: https://gerrit.libreoffice.org/76098
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/PositionAndSizeHelper.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx index 8f8b7109b8a5..40972d47c3f4 100644 --- a/chart2/source/controller/main/PositionAndSizeHelper.cxx +++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx @@ -44,6 +44,10 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType tools::Rectangle aObjectRect( Point(rNewPositionAndSize.X,rNewPositionAndSize.Y), Size(rNewPositionAndSize.Width,rNewPositionAndSize.Height) ); tools::Rectangle aPageRect( Point(rPageRectangle.X,rPageRectangle.Y), Size(rPageRectangle.Width,rPageRectangle.Height) ); + // every following branch divides by width and height + if (aPageRect.getWidth() == 0 || aPageRect.getHeight() == 0) + return false; + if( eObjectType==OBJECTTYPE_TITLE ) { //@todo decide whether x is primary or secondary |