diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-09-17 21:49:21 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-09-20 12:10:44 +0200 |
commit | b22d4785310eac35696df771803dfba0871a50ac (patch) | |
tree | 56e394a3c38a2e1f17530fbc18dd8e6b3c5d5098 /vcl/source/window/splitwin.cxx | |
parent | 3e2370260f2b79c43b4f8a86b123861aa95d3ef2 (diff) |
clean up ambiguous confusing rectangle APIs like IsInside()
Reading 'rectA.IsInside( rectB )' kind of suggests that the code
checks whether 'rectA is inside rectB', but it's actually the other
way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(),
which should make it clear which way the logic goes.
Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'vcl/source/window/splitwin.cxx')
-rw-r--r-- | vcl/source/window/splitwin.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index ed32ca8f44fd..fa3cada9ecfa 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -330,7 +330,7 @@ static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, const Point& rPos, aRect.AdjustLeft( -(pSet->mnSplitSize) ); } - if ( aRect.IsInside( rPos ) ) + if ( aRect.Contains( rPos ) ) { if ( rItem.mpSet && !rItem.mpSet->mvItems.empty() ) { @@ -1468,7 +1468,7 @@ void SplitWindow::ImplDrawGrip(vcl::RenderContext& rRenderContext, const tools:: Color aColor; - if (rRect.IsInside(GetPointerPosPixel())) + if (rRect.Contains(GetPointerPosPixel())) { vcl::RenderTools::DrawSelectionBackground(rRenderContext, *this, rRect, 2, false, false, false); @@ -1813,7 +1813,7 @@ void SplitWindow::MouseButtonDown( const MouseEvent& rMEvt ) mbFadeNoButtonMode = false; ImplGetFadeOutRect( aTestRect ); - if ( aTestRect.IsInside( aMousePosPixel ) ) + if ( aTestRect.Contains( aMousePosPixel ) ) { mbFadeOutDown = true; mbFadeOutPressed = true; @@ -1822,7 +1822,7 @@ void SplitWindow::MouseButtonDown( const MouseEvent& rMEvt ) else { ImplGetFadeInRect( aTestRect, true ); - if ( aTestRect.IsInside( aMousePosPixel ) ) + if ( aTestRect.Contains( aMousePosPixel ) ) { mbFadeInDown = true; mbFadeInPressed = true; @@ -1858,8 +1858,8 @@ void SplitWindow::MouseMove( const MouseEvent& rMEvt ) ImplGetFadeInRect( aFadeInRect ); ImplGetFadeOutRect( aFadeOutRect ); - if ( !aFadeInRect.IsInside( aPos ) && - !aFadeOutRect.IsInside( aPos ) ) + if ( !aFadeInRect.Contains( aPos ) && + !aFadeOutRect.Contains( aPos ) ) { if ( nSplitTest && !(nSplitTest & SPLIT_NOSPLIT) ) { @@ -1895,7 +1895,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) { tools::Rectangle aTestRect; ImplGetFadeInRect( aTestRect, true ); - bool bNewPressed = aTestRect.IsInside( aMousePosPixel ); + bool bNewPressed = aTestRect.Contains( aMousePosPixel ); if ( bNewPressed != mbFadeInPressed ) { mbFadeInPressed = bNewPressed; @@ -1921,7 +1921,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) { tools::Rectangle aTestRect; ImplGetFadeOutRect( aTestRect ); - bool bNewPressed = aTestRect.IsInside( aMousePosPixel ); + bool bNewPressed = aTestRect.Contains( aMousePosPixel ); if ( !bNewPressed ) { mbFadeOutPressed = bNewPressed; @@ -2035,9 +2035,9 @@ bool SplitWindow::PreNotify( NotifyEvent& rNEvt ) ImplGetFadeInRect( aFadeInRect ); ImplGetFadeOutRect( aFadeOutRect ); - if ( aFadeInRect.IsInside( GetPointerPosPixel() ) != aFadeInRect.IsInside( GetLastPointerPosPixel() ) ) + if ( aFadeInRect.Contains( GetPointerPosPixel() ) != aFadeInRect.Contains( GetLastPointerPosPixel() ) ) Invalidate( aFadeInRect ); - if ( aFadeOutRect.IsInside( GetPointerPosPixel() ) != aFadeOutRect.IsInside( GetLastPointerPosPixel() ) ) + if ( aFadeOutRect.Contains( GetPointerPosPixel() ) != aFadeOutRect.Contains( GetLastPointerPosPixel() ) ) Invalidate( aFadeOutRect ); if( pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow() ) @@ -2086,12 +2086,12 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt ) TranslateId pHelpResId; ImplGetFadeInRect( aHelpRect, true ); - if ( aHelpRect.IsInside( aMousePosPixel ) ) + if ( aHelpRect.Contains( aMousePosPixel ) ) pHelpResId = SV_HELPTEXT_FADEIN; else { ImplGetFadeOutRect( aHelpRect ); - if ( aHelpRect.IsInside( aMousePosPixel ) ) + if ( aHelpRect.Contains( aMousePosPixel ) ) pHelpResId = SV_HELPTEXT_FADEOUT; } |