summaryrefslogtreecommitdiff
path: root/vcl/source/control/scrbar.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-20 09:29:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-20 10:47:44 +0200
commitdf4c562ac613ce51d431cbb633ffe57c5305714f (patch)
tree35bc0691f68140e465c4db07e18e081f58e41555 /vcl/source/control/scrbar.cxx
parentc7821b8cd1bfd93ac232d9b3cc114e9ed9931bc9 (diff)
add tools::Rectangle::Justify
so rectangles can be constructed already valid Change-Id: I3ae5e24add3c81f79dcdf863f855dca439876f11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92521 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/control/scrbar.cxx')
-rw-r--r--vcl/source/control/scrbar.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 0cf1c9c5f82c..6d313b0ffe1e 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -269,10 +269,7 @@ void ScrollBar::ImplCalc( bool bUpdate )
aControlRegion, ControlState::NONE, ImplControlValue(), aBoundingRegion, aTrackRegion ) )
maTrackRect = aTrackRegion;
else
- {
- maTrackRect = tools::Rectangle( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() );
- maTrackRect.Justify();
- }
+ maTrackRect = tools::Rectangle::Justify( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() );
// Check if available space is big enough for thumb ( min thumb size = ScrBar width/height )
mnThumbPixRange = maTrackRect.Right() - maTrackRect.Left();
@@ -309,10 +306,7 @@ void ScrollBar::ImplCalc( bool bUpdate )
aControlRegion, ControlState::NONE, ImplControlValue(), aBoundingRegion, aTrackRegion ) )
maTrackRect = aTrackRegion;
else
- {
- maTrackRect = tools::Rectangle( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() );
- maTrackRect.Justify();
- }
+ maTrackRect = tools::Rectangle::Justify( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() );
// Check if available space is big enough for thumb
mnThumbPixRange = maTrackRect.Bottom() - maTrackRect.Top();