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 /accessibility | |
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 'accessibility')
11 files changed, 17 insertions, 17 deletions
diff --git a/accessibility/source/extended/AccessibleBrowseBox.cxx b/accessibility/source/extended/AccessibleBrowseBox.cxx index 4a5b27f5249f..7dd780508816 100644 --- a/accessibility/source/extended/AccessibleBrowseBox.cxx +++ b/accessibility/source/extended/AccessibleBrowseBox.cxx @@ -147,7 +147,7 @@ AccessibleBrowseBox::getAccessibleAtPoint( const awt::Point& rPoint ) xCurrChildComp( xCurrChild, uno::UNO_QUERY ); if( xCurrChildComp.is() && - VCLRectangle( xCurrChildComp->getBounds() ).IsInside( aPoint ) ) + VCLRectangle( xCurrChildComp->getBounds() ).Contains( aPoint ) ) xChild = xCurrChild; } } diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx index 40ffe655ba76..ee64200065d1 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx @@ -209,7 +209,7 @@ lang::Locale SAL_CALL AccessibleBrowseBoxBase::getLocale() sal_Bool SAL_CALL AccessibleBrowseBoxBase::containsPoint( const css::awt::Point& rPoint ) { - return tools::Rectangle( Point(), getBoundingBox().GetSize() ).IsInside( VCLPoint( rPoint ) ); + return tools::Rectangle( Point(), getBoundingBox().GetSize() ).Contains( VCLPoint( rPoint ) ); } awt::Rectangle SAL_CALL AccessibleBrowseBoxBase::getBounds() @@ -348,7 +348,7 @@ bool AccessibleBrowseBoxBase::implIsShowing() css::uno::Reference< css::accessibility::XAccessibleComponent > xParentComp( mxParent->getAccessibleContext(), uno::UNO_QUERY ); if( xParentComp.is() ) - bShowing = implGetBoundingBox().IsOver( + bShowing = implGetBoundingBox().Overlaps( VCLRectangle( xParentComp->getBounds() ) ); } return bShowing; diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index 22e6539b8afd..c90cc0384b46 100644 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -166,7 +166,7 @@ AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint ) xCurrChildComp( xCurrChild, uno::UNO_QUERY ); if( xCurrChildComp.is() && - VCLRectangle( xCurrChildComp->getBounds() ).IsInside( aPoint ) ) + VCLRectangle( xCurrChildComp->getBounds() ).Contains( aPoint ) ) xChild = xCurrChild; } } diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index 34a6edadfa7d..c118c70f7a32 100644 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -184,7 +184,7 @@ lang::Locale SAL_CALL AccessibleGridControlBase::getLocale() sal_Bool SAL_CALL AccessibleGridControlBase::containsPoint( const awt::Point& rPoint ) { - return tools::Rectangle( Point(), getBoundingBox().GetSize() ).IsInside( VCLPoint( rPoint ) ); + return tools::Rectangle( Point(), getBoundingBox().GetSize() ).Contains( VCLPoint( rPoint ) ); } awt::Rectangle SAL_CALL AccessibleGridControlBase::getBounds() @@ -273,7 +273,7 @@ bool AccessibleGridControlBase::implIsShowing() css::uno::Reference< css::accessibility::XAccessibleComponent > xParentComp( m_xParent->getAccessibleContext(), uno::UNO_QUERY ); if( xParentComp.is() ) - bShowing = implGetBoundingBox().IsOver( + bShowing = implGetBoundingBox().Overlaps( VCLRectangle( xParentComp->getBounds() ) ); } return bShowing; diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx index 8cc2f083ad63..5a995a94fc91 100644 --- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx @@ -138,7 +138,7 @@ namespace accessibility { Reference< XAccessibleComponent > xParentComp( xParentContext, uno::UNO_QUERY ); if( xParentComp.is() ) - bShowing = GetBoundingBox_Impl().IsOver( VCLRectangle( xParentComp->getBounds() ) ); + bShowing = GetBoundingBox_Impl().Overlaps( VCLRectangle( xParentComp->getBounds() ) ); } return bShowing; @@ -336,7 +336,7 @@ namespace accessibility sal_Bool SAL_CALL AccessibleIconChoiceCtrlEntry::containsPoint( const awt::Point& rPoint ) { - return tools::Rectangle( Point(), GetBoundingBox().GetSize() ).IsInside( VCLPoint( rPoint ) ); + return tools::Rectangle( Point(), GetBoundingBox().GetSize() ).Contains( VCLPoint( rPoint ) ); } Reference< XAccessible > SAL_CALL AccessibleIconChoiceCtrlEntry::getAccessibleAtPoint( const awt::Point& ) @@ -445,7 +445,7 @@ namespace accessibility for ( tools::Long i = 0; i < nLen; ++i ) { tools::Rectangle aRect = aLayoutData.GetCharacterBounds(i); - bool bInside = aRect.IsInside( aPnt ); + bool bInside = aRect.Contains( aPnt ); if ( bInside ) break; diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx index 06cc2cf6897e..716955b69595 100644 --- a/accessibility/source/extended/accessiblelistboxentry.cxx +++ b/accessibility/source/extended/accessiblelistboxentry.cxx @@ -175,7 +175,7 @@ namespace accessibility { Reference< XAccessibleComponent > xParentComp( xParentContext, uno::UNO_QUERY ); if( xParentComp.is() ) - bShowing = GetBoundingBox_Impl().IsOver( VCLRectangle( xParentComp->getBounds() ) ); + bShowing = GetBoundingBox_Impl().Overlaps( VCLRectangle( xParentComp->getBounds() ) ); } return bShowing; @@ -544,7 +544,7 @@ namespace accessibility sal_Bool SAL_CALL AccessibleListBoxEntry::containsPoint( const awt::Point& rPoint ) { - return tools::Rectangle( Point(), GetBoundingBox().GetSize() ).IsInside( VCLPoint( rPoint ) ); + return tools::Rectangle( Point(), GetBoundingBox().GetSize() ).Contains( VCLPoint( rPoint ) ); } Reference< XAccessible > SAL_CALL AccessibleListBoxEntry::getAccessibleAtPoint( const awt::Point& _aPoint ) @@ -562,7 +562,7 @@ namespace accessibility assert(xListBox.is()); auto pAccEntry = m_rListBox.implGetAccessible(*pEntry); tools::Rectangle aRect = pAccEntry->GetBoundingBox_Impl(); - if ( aRect.IsInside( VCLPoint( _aPoint ) ) ) + if ( aRect.Contains( VCLPoint( _aPoint ) ) ) xAcc = pAccEntry.get(); return xAcc; } diff --git a/accessibility/source/extended/accessibletabbar.cxx b/accessibility/source/extended/accessibletabbar.cxx index 218ed1cab071..e983c1e47471 100644 --- a/accessibility/source/extended/accessibletabbar.cxx +++ b/accessibility/source/extended/accessibletabbar.cxx @@ -385,7 +385,7 @@ namespace accessibility { tools::Rectangle aRect = VCLRectangle( xComp->getBounds() ); Point aPos = VCLPoint( rPoint ); - if ( aRect.IsInside( aPos ) ) + if ( aRect.Contains( aPos ) ) { xChild = xAcc; break; diff --git a/accessibility/source/extended/accessibletabbarpagelist.cxx b/accessibility/source/extended/accessibletabbarpagelist.cxx index 37b1ab279522..3c7f9976e0af 100644 --- a/accessibility/source/extended/accessibletabbarpagelist.cxx +++ b/accessibility/source/extended/accessibletabbarpagelist.cxx @@ -514,7 +514,7 @@ namespace accessibility { tools::Rectangle aRect = VCLRectangle( xComp->getBounds() ); Point aPos = VCLPoint( rPoint ); - if ( aRect.IsInside( aPos ) ) + if ( aRect.Contains( aPos ) ) { xChild = xAcc; break; diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx index e873322f9c56..bce5968c7cfc 100644 --- a/accessibility/source/standard/accessiblemenubasecomponent.cxx +++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx @@ -361,7 +361,7 @@ Reference< XAccessible > OAccessibleMenuBaseComponent::GetChildAt( const awt::Po { tools::Rectangle aRect = VCLRectangle( xComp->getBounds() ); Point aPos = VCLPoint( rPoint ); - if ( aRect.IsInside( aPos ) ) + if ( aRect.Contains( aPos ) ) { xChild = xAcc; break; diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx index e25c1070f8ed..dea8682c127e 100644 --- a/accessibility/source/standard/vclxaccessiblelistitem.cxx +++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx @@ -293,7 +293,7 @@ sal_Bool SAL_CALL VCLXAccessibleListItem::containsPoint( const awt::Point& _aPoi { tools::Rectangle aRect(pListBoxHelper->GetBoundingRectangle(static_cast<sal_uInt16>(m_nIndexInParent))); aRect.Move(-aRect.Left(), -aRect.Top()); - bInside = aRect.IsInside( VCLPoint( _aPoint ) ); + bInside = aRect.Contains( VCLPoint( _aPoint ) ); } return bInside; } diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx b/accessibility/source/standard/vclxaccessibletabpage.cxx index 3c0a9ada8e1d..8dd5a24199f7 100644 --- a/accessibility/source/standard/vclxaccessibletabpage.cxx +++ b/accessibility/source/standard/vclxaccessibletabpage.cxx @@ -421,7 +421,7 @@ Reference< XAccessible > VCLXAccessibleTabPage::getAccessibleAtPoint( const awt: { tools::Rectangle aRect = VCLRectangle( xComp->getBounds() ); Point aPos = VCLPoint( rPoint ); - if ( aRect.IsInside( aPos ) ) + if ( aRect.Contains( aPos ) ) { xChild = xAcc; break; |