summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-09-17 21:49:21 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-09-20 12:10:44 +0200
commitb22d4785310eac35696df771803dfba0871a50ac (patch)
tree56e394a3c38a2e1f17530fbc18dd8e6b3c5d5098 /dbaccess
parent3e2370260f2b79c43b4f8a86b123861aa95d3ef2 (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 'dbaccess')
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowAccess.cxx4
3 files changed, 6 insertions, 6 deletions
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 0006f45de56f..db4dc6da6290 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -522,7 +522,7 @@ void SbaGridHeader::ImplStartColumnDrag(sal_Int8 _nAction, const Point& _rMouseP
tools::Rectangle aColRect = GetItemRect(nId);
aColRect.AdjustLeft(nId ? 3 : 0 ); // the handle col (nId == 0) does not have a left margin for resizing
aColRect.AdjustRight( -3 );
- bResizingCol = !aColRect.IsInside(_rMousePos);
+ bResizingCol = !aColRect.Contains(_rMousePos);
}
if (bResizingCol)
return;
@@ -1164,7 +1164,7 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt )
break;
tools::Rectangle aRect = GetCellRect(nRow, nCol, false);
- if (!aRect.IsInside(rEvt.maPosPixel))
+ if (!aRect.Contains(rEvt.maPosPixel))
// not dropped within a cell (a cell isn't as wide as the column - the are small spaces)
break;
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index ff31bcefddc0..5d0bd23534ae 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -580,9 +580,9 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin )
aBottom.AdjustX(aNewSize.Width() );
aBottom.AdjustY(aNewSize.Height() );
- if(!GetHScrollBar().GetRange().IsInside(aBottom.X()))
+ if(!GetHScrollBar().GetRange().Contains(aBottom.X()))
GetHScrollBar().SetRange( Range(0, aBottom.X()) );
- if(!GetVScrollBar().GetRange().IsInside(aBottom.Y()))
+ if(!GetVScrollBar().GetRange().Contains(aBottom.Y()))
GetVScrollBar().SetRange( Range(0, aBottom.Y()) );
pTabWin->SetPosSizePixel( aNewPos, aNewSize );
diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
index f49b97c7787c..3a35d4a66f9b 100644
--- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
@@ -153,9 +153,9 @@ namespace dbaui
{
Point aPoint(_aPoint.X,_aPoint.Y);
tools::Rectangle aRect(m_pTable->GetDesktopRectPixel());
- if( aRect.IsInside(aPoint) )
+ if( aRect.Contains(aPoint) )
aRet = this;
- else if( m_pTable->GetListBox()->GetDesktopRectPixel().IsInside(aPoint))
+ else if( m_pTable->GetListBox()->GetDesktopRectPixel().Contains(aPoint))
aRet = m_pTable->GetListBox()->GetAccessible();
}
return aRet;