summaryrefslogtreecommitdiff
path: root/vcl/osx
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 /vcl/osx
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 'vcl/osx')
-rw-r--r--vcl/osx/salnativewidgets.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index ad1362d438de..481d7a90e5fe 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -1017,6 +1017,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion )
{
+ if (rControlRegion.IsEmpty()) // nothing to do
+ return false;
bool toReturn = false;
tools::Rectangle aCtrlBoundRect( rControlRegion );