summaryrefslogtreecommitdiff
path: root/svx/source/sdr
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-06-05 15:24:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-07 11:01:37 +0200
commita46a257794f1f53b294735fc876c394be23a3811 (patch)
tree9eb4fb72df2cc9e2acdf3edffe0a72f67f90b9fa /svx/source/sdr
parent43ddddb703bcdb9430752af63ae46527f737f874 (diff)
improve empty tools::Rectangle (width)
This is the width part, the height part will come next. Instead of storing "empty" as a special value (which is easy to get wrong, eg. some image filters pass in that special value, expecting it to be a valid width), just use separate boolean values for width and height empty. Also lots of code was calling GetBottom() or GetRight() on an empty rectangle, getting back that magic value and doing calculations on it, resulting in completely bogus data. So (1) make the various Rectangle methods do something reasonable when the empty flags are set (2) fix various other code to handle empty better (3) assert when code accesses Bottom or Right and the empty flag is set. Change-Id: I1163378cd2773dd8b386210f83400bb6b4701069 Reviewed-on: https://gerrit.libreoffice.org/73564 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr')
-rw-r--r--svx/source/sdr/contact/objectcontactofpageview.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 3bda11b111f6..4961d4610c34 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -213,6 +213,9 @@ namespace sdr
aViewRange.transform(rTargetOutDev.GetInverseViewTransformation());
}
+ if (aViewRange.isEmpty())
+ return;
+
// update local ViewInformation2D
const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D(
basegfx::B2DHomMatrix(),