summaryrefslogtreecommitdiff
path: root/basctl/source
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 /basctl/source
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 'basctl/source')
-rw-r--r--basctl/source/accessibility/accessibledialogwindow.cxx4
-rw-r--r--basctl/source/basicide/bastypes.cxx2
-rw-r--r--basctl/source/dlged/dlgedfunc.cxx4
-rw-r--r--basctl/source/dlged/dlgedview.cxx2
4 files changed, 6 insertions, 6 deletions
diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx
index 0b641c8aca5e..e52d08bfe458 100644
--- a/basctl/source/accessibility/accessibledialogwindow.cxx
+++ b/basctl/source/accessibility/accessibledialogwindow.cxx
@@ -194,7 +194,7 @@ bool AccessibleDialogWindow::IsChildVisible( const ChildDescriptor& rDesc )
// check, if the shape's bounding box intersects with the bounding box of its parent
tools::Rectangle aParentRect( Point( 0, 0 ), m_pDialogWindow->GetSizePixel() );
- if ( aParentRect.IsOver( aRect ) )
+ if ( aParentRect.Overlaps( aRect ) )
bVisible = true;
}
}
@@ -717,7 +717,7 @@ Reference< XAccessible > AccessibleDialogWindow::getAccessibleAtPoint( const awt
{
tools::Rectangle aRect = VCLRectangle( xComp->getBounds() );
Point aPos = VCLPoint( rPoint );
- if ( aRect.IsInside( aPos ) )
+ if ( aRect.Contains( aPos ) )
{
xChild = xAcc;
break;
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 34f17ea7677f..82e43490b28c 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -341,7 +341,7 @@ void DockingWindow::Hide ()
bool DockingWindow::Docking( const Point& rPos, tools::Rectangle& rRect )
{
- if (aDockingRect.IsInside(rPos))
+ if (aDockingRect.Contains(rPos))
{
rRect.SetSize(aDockingRect.GetSize());
return false; // dock
diff --git a/basctl/source/dlged/dlgedfunc.cxx b/basctl/source/dlged/dlgedfunc.cxx
index da0a20bbaf55..8d666f0694d1 100644
--- a/basctl/source/dlged/dlgedfunc.cxx
+++ b/basctl/source/dlged/dlgedfunc.cxx
@@ -50,7 +50,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos )
tools::Long nDeltaX = pHScroll->GetLineSize();
tools::Long nDeltaY = pVScroll->GetLineSize();
- if( !aOutRect.IsInside( rPos ) )
+ if( !aOutRect.Contains( rPos ) )
{
if( rPos.X() < aOutRect.Left() )
nDeltaX = -nDeltaX;
@@ -233,7 +233,7 @@ bool DlgEdFunc::KeyInput( const KeyEvent& rKEvt )
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();
diff --git a/basctl/source/dlged/dlgedview.cxx b/basctl/source/dlged/dlgedview.cxx
index 0878596d8f41..d6c67b7e9f7a 100644
--- a/basctl/source/dlged/dlgedview.cxx
+++ b/basctl/source/dlged/dlgedview.cxx
@@ -63,7 +63,7 @@ void DlgEdView::MakeVisible( const tools::Rectangle& rRect, vcl::Window& rWin )
tools::Rectangle aVisRect( RectTmp );
// check, if rectangle is inside visible area
- if ( aVisRect.IsInside( rRect ) )
+ if ( aVisRect.Contains( rRect ) )
return;
// calculate scroll distance; the rectangle must be inside the visible area