From df4c562ac613ce51d431cbb633ffe57c5305714f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 20 Apr 2020 09:29:23 +0200 Subject: 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 --- vcl/source/control/scrbar.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'vcl/source/control/scrbar.cxx') 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(); -- cgit