summaryrefslogtreecommitdiff
path: root/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
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/AccessibleDocumentPagePreview.cxx
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/AccessibleDocumentPagePreview.cxx')
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx14
1 files changed, 7 insertions, 7 deletions
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())