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 /reportdesign | |
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 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/report/SectionView.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/StartMarker.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/dlgedfunc.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx index b711b13dff33..071d95108847 100644 --- a/reportdesign/source/ui/report/SectionView.cxx +++ b/reportdesign/source/ui/report/SectionView.cxx @@ -75,7 +75,7 @@ void OSectionView::MakeVisible( const tools::Rectangle& rRect, vcl::Window& rWin const tools::Rectangle aVisRect( Point(-aOrg.X(),-aOrg.Y()), aVisSize ); // check, if rectangle is inside visible area - if ( !aVisRect.IsInside( rRect ) ) + if ( !aVisRect.Contains( rRect ) ) { // calculate scroll distance; the rectangle must be inside the visible area sal_Int32 nScrollX = 0, nScrollY = 0; diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index a5871fc52524..69bb14bf756c 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -174,7 +174,7 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt ) const Size aOutputSize = GetOutputSizePixel(); if( aPos.X() > aOutputSize.Width() || aPos.Y() > aOutputSize.Height() ) return; - if ( rMEvt.GetClicks() == 2 || m_aImageRect.IsInside( aPos ) ) + if ( rMEvt.GetClicks() == 2 || m_aImageRect.Contains( aPos ) ) { m_bCollapsed = !m_bCollapsed; diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 4f7cc5be2d7e..68c110780ce1 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -1429,7 +1429,7 @@ void OViewsWindow::handleKey(const vcl::KeyCode& _rCode) tools::Rectangle aMarkRect( rView.GetMarkedObjRect() ); aMarkRect.Move( nX, nY ); - if ( !rWorkArea.IsInside( aMarkRect ) ) + if ( !rWorkArea.Contains( aMarkRect ) ) { if ( aMarkRect.Left() < rWorkArea.Left() ) nX += rWorkArea.Left() - aMarkRect.Left(); @@ -1487,7 +1487,7 @@ void OViewsWindow::handleKey(const vcl::KeyCode& _rCode) } aMarkRect.SetPos(aPos); - if ( !rWorkArea.IsInside( aMarkRect ) ) + if ( !rWorkArea.Contains( aMarkRect ) ) { break; } diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 1cf3b14b58c4..f6e236cd3c0c 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -84,7 +84,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) tools::Rectangle aWorkArea(Point(), pScrollWindow->getTotalSize()); aWorkArea.AdjustRight( -static_cast<tools::Long>(aStartWidth) ); aWorkArea = pScrollWindow->PixelToLogic( aWorkArea ); - if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) ) + if( !aOutRect.Contains( rPos ) && aWorkArea.Contains( rPos ) ) { ScrollBar& rHScroll = pScrollWindow->GetHScroll(); ScrollBar& rVScroll = pScrollWindow->GetVScroll(); |