From b22d4785310eac35696df771803dfba0871a50ac Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 17 Sep 2021 21:49:21 +0200 Subject: clean up ambiguous confusing rectangle APIs like IsInside() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Luboš Luňák Tested-by: Jenkins --- sw/source/uibase/misc/swruler.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/source/uibase/misc') diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx index e26e9aa41d5c..cfedd2ea011e 100644 --- a/sw/source/uibase/misc/swruler.cxx +++ b/sw/source/uibase/misc/swruler.cxx @@ -193,7 +193,7 @@ void SwCommentRuler::Command(const CommandEvent& rCEvt) Point aMousePos = rCEvt.GetMousePosPixel(); // Ignore command request if it is inside Comment Control if (!mpViewShell->GetPostItMgr() || !mpViewShell->GetPostItMgr()->HasNotes() - || !GetCommentControlRegion().IsInside(aMousePos)) + || !GetCommentControlRegion().Contains(aMousePos)) SvxRuler::Command(rCEvt); } @@ -207,7 +207,7 @@ void SwCommentRuler::MouseMove(const MouseEvent& rMEvt) Point aMousePos = rMEvt.GetPosPixel(); bool bWasHighlighted = mbIsHighlighted; - mbIsHighlighted = GetCommentControlRegion().IsInside(aMousePos); + mbIsHighlighted = GetCommentControlRegion().Contains(aMousePos); if (mbIsHighlighted != bWasHighlighted) // Do start fading maFadeTimer.Start(); @@ -216,7 +216,7 @@ void SwCommentRuler::MouseMove(const MouseEvent& rMEvt) void SwCommentRuler::MouseButtonDown(const MouseEvent& rMEvt) { Point aMousePos = rMEvt.GetPosPixel(); - if (!rMEvt.IsLeft() || IsTracking() || !GetCommentControlRegion().IsInside(aMousePos)) + if (!rMEvt.IsLeft() || IsTracking() || !GetCommentControlRegion().Contains(aMousePos)) { SvxRuler::MouseButtonDown(rMEvt); return; -- cgit