summaryrefslogtreecommitdiff
path: root/sc/source/ui/Accessibility
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 /sc/source/ui/Accessibility
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 'sc/source/ui/Accessibility')
-rw-r--r--sc/source/ui/Accessibility/AccessibleContextBase.cxx4
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx14
3 files changed, 10 insertions, 10 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
index b1d9cf3dfab6..38620240baaf 100644
--- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
@@ -143,7 +143,7 @@ sal_Bool SAL_CALL ScAccessibleContextBase::containsPoint(const awt::Point& rPoin
{
SolarMutexGuard aGuard;
IsObjectValid();
- return tools::Rectangle (Point(), GetBoundingBox().GetSize()).IsInside(VCLPoint(rPoint));
+ return tools::Rectangle (Point(), GetBoundingBox().GetSize()).Contains(VCLPoint(rPoint));
}
uno::Reference< XAccessible > SAL_CALL ScAccessibleContextBase::getAccessibleAtPoint(
@@ -193,7 +193,7 @@ bool ScAccessibleContextBase::isShowing( )
{
tools::Rectangle aParentBounds(VCLRectangle(xParentComponent->getBounds()));
tools::Rectangle aBounds(VCLRectangle(getBounds()));
- bShowing = aBounds.IsOver(aParentBounds);
+ bShowing = aBounds.Overlaps(aParentBounds);
}
}
return bShowing;
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 3b78798d05c0..0ac7d931d6e6 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1647,7 +1647,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocument::getAccessibleAtPoin
if (xComp.is())
{
tools::Rectangle aBound(VCLRectangle(xComp->getBounds()));
- if (aBound.IsInside(VCLPoint(rPoint)))
+ if (aBound.Contains(VCLPoint(rPoint)))
xAccessible = mxTempAcc;
}
}
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 336fd112af8b..9656b82af035 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -273,7 +273,7 @@ struct ScPointFound
bool operator() (const ScAccNote& rNote)
{
bool bResult(false);
- if (maPoint.IsInside(rNote.maRect))
+ if (maPoint.Contains(rNote.maRect))
bResult = true;
else
mnParagraphs += rNote.mnParaCount;
@@ -918,7 +918,7 @@ struct ScShapePointFound
bool operator() (const ScShapeChild& rShape)
{
bool bResult(false);
- if (VCLRectangle(rShape.mpAccShape->getBounds()).IsInside(maPoint))
+ if (VCLRectangle(rShape.mpAccShape->getBounds()).Contains(maPoint))
bResult = true;
return bResult;
}
@@ -1117,10 +1117,10 @@ ScPagePreviewCountData::ScPagePreviewCountData( const ScPreviewLocationData& rDa
tools::Rectangle aObjRect;
- if ( rData.GetHeaderPosition( aObjRect ) && aObjRect.IsOver( aVisRect ) )
+ if ( rData.GetHeaderPosition( aObjRect ) && aObjRect.Overlaps( aVisRect ) )
nHeaders = 1;
- if ( rData.GetFooterPosition( aObjRect ) && aObjRect.IsOver( aVisRect ) )
+ if ( rData.GetFooterPosition( aObjRect ) && aObjRect.Overlaps( aVisRect ) )
nFooters = 1;
if ( rData.HasCellsInRange( aVisRect ) )
@@ -1289,7 +1289,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces
mpTable = new ScAccessiblePreviewTable( this, mpViewShell, nIndex );
mpTable->Init();
}
- if (mpTable.is() && VCLRectangle(mpTable->getBounds()).IsInside(VCLPoint(rPoint)))
+ if (mpTable.is() && VCLRectangle(mpTable->getBounds()).Contains(VCLPoint(rPoint)))
xAccessible = mpTable.get();
}
if (!xAccessible.is())
@@ -1313,9 +1313,9 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces
Point aPoint(VCLPoint(rPoint));
- if (VCLRectangle(mpHeader->getBounds()).IsInside(aPoint))
+ if (VCLRectangle(mpHeader->getBounds()).Contains(aPoint))
xAccessible = mpHeader.get();
- else if (VCLRectangle(mpFooter->getBounds()).IsInside(aPoint))
+ else if (VCLRectangle(mpFooter->getBounds()).Contains(aPoint))
xAccessible = mpFooter.get();
}
if (!xAccessible.is())