summaryrefslogtreecommitdiff
path: root/svx/source/dialog/swframeexample.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 /svx/source/dialog/swframeexample.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 'svx/source/dialog/swframeexample.cxx')
-rw-r--r--svx/source/dialog/swframeexample.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx
index dbb1e0410491..aa82ccecaf7b 100644
--- a/svx/source/dialog/swframeexample.cxx
+++ b/svx/source/dialog/swframeexample.cxx
@@ -639,7 +639,7 @@ void SwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
if (i == (nLines - 1))
aTxt.SetSize(Size(aTxt.GetWidth() / 2, aTxt.GetHeight()));
- if (aTxt.IsOver(aFrmRect) && nAnchor != RndStdIds::FLY_AS_CHAR && !bIgnoreWrap)
+ if (aTxt.Overlaps(aFrmRect) && nAnchor != RndStdIds::FLY_AS_CHAR && !bIgnoreWrap)
{
switch(nWrap)
{
@@ -658,7 +658,7 @@ void SwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
default: break;
}
}
- if (pOuterFrame->IsInside(aTxt))
+ if (pOuterFrame->Contains(aTxt))
DrawRect_Impl(rRenderContext, aTxt, m_aTxtCol, m_aTransColor );
aTxt.Move(0, nStep);
@@ -692,7 +692,7 @@ void SwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
DrawRect_Impl(rRenderContext, aRect, m_aTransColor, m_aAlignColor);
// Frame View
- bool bDontFill = (nAnchor == RndStdIds::FLY_AT_CHAR && aFrmRect.IsOver(aAutoCharFrame)) || bTrans;
+ bool bDontFill = (nAnchor == RndStdIds::FLY_AT_CHAR && aFrmRect.Overlaps(aAutoCharFrame)) || bTrans;
DrawRect_Impl(rRenderContext, aFrmRect, bDontFill? m_aTransColor : m_aBgCol, m_aFrameColor);
}