summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
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 /sd/source/ui/view
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 'sd/source/ui/view')
-rw-r--r--sd/source/ui/view/drviews4.cxx8
-rw-r--r--sd/source/ui/view/drviewsh.cxx2
-rw-r--r--sd/source/ui/view/sdview2.cxx4
-rw-r--r--sd/source/ui/view/sdview3.cxx6
-rw-r--r--sd/source/ui/view/sdview4.cxx4
5 files changed, 12 insertions, 12 deletions
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 7e4932b29856..05fca2edad19 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -273,7 +273,7 @@ void DrawViewShell::StartRulerDrag (
Point aWPos = GetActiveWindow()->PixelToLogic(GetActiveWindow()->GetPointerPosPixel());
- if ( rRuler.GetExtraRect().IsInside(rMEvt.GetPosPixel()) )
+ if ( rRuler.GetExtraRect().Contains(rMEvt.GetPosPixel()) )
{
mpDrawView->BegSetPageOrg(aWPos);
mbIsRulerDrag = true;
@@ -356,7 +356,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
{
::tools::Rectangle aOutputArea(Point(0,0), GetActiveWindow()->GetOutputSizePixel());
- if ( !aOutputArea.IsInside(rMEvt.GetPosPixel()) )
+ if ( !aOutputArea.Contains(rMEvt.GetPosPixel()) )
{
bool bInsideOtherWindow = false;
@@ -366,7 +366,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
mpContentWindow->GetOutputSizePixel());
Point aPos = mpContentWindow->GetPointerPosPixel();
- if ( aOutputArea.IsInside(aPos) )
+ if ( aOutputArea.Contains(aPos) )
bInsideOtherWindow = true;
}
@@ -467,7 +467,7 @@ void DrawViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin)
{
::tools::Rectangle aOutputArea(Point(0,0), GetActiveWindow()->GetOutputSizePixel());
- if (aOutputArea.IsInside(rMEvt.GetPosPixel()))
+ if (aOutputArea.Contains(rMEvt.GetPosPixel()))
{
mpDrawView->EndAction();
diff --git a/sd/source/ui/view/drviewsh.cxx b/sd/source/ui/view/drviewsh.cxx
index e6c3cc8e7f20..3c8738dc3f53 100644
--- a/sd/source/ui/view/drviewsh.cxx
+++ b/sd/source/ui/view/drviewsh.cxx
@@ -83,7 +83,7 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW
rWin.GetOutDev()->Pop();
Size aVisAreaSize(aVisArea.GetSize());
- if ( aVisArea.IsInside(rRect) )
+ if ( aVisArea.Contains(rRect) )
return;
// object is not entirely in visible area
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 5f305228c1e3..3a40d4065d93 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -456,7 +456,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
aRect.Union( pObj->GetLogicRect() );
}
- if( aRect.IsInside( pOLV->GetWindow()->PixelToLogic( rEvt.maPosPixel ) ) )
+ if( aRect.Contains( pOLV->GetWindow()->PixelToLogic( rEvt.maPosPixel ) ) )
{
bIsInsideOutlinerView = true;
}
@@ -637,7 +637,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt,
Point aPos( pOLV->GetWindow()->PixelToLogic( rEvt.maPosPixel ) );
- if( aRect.IsInside( aPos ) )
+ if( aRect.Contains( aPos ) )
{
bIsInsideOutlinerView = true;
}
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index a7204648ee4d..787c16319fcd 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -114,7 +114,7 @@ static void ImpCheckInsertPos(Point& rPos, const Size& rSize, const ::tools::Rec
::tools::Rectangle aMarkRect(Point(rPos.X() - (rSize.Width() / 2), rPos.Y() - (rSize.Height() / 2)), rSize);
- if(aMarkRect.IsInside(rWorkArea))
+ if(aMarkRect.Contains(rWorkArea))
return;
if(aMarkRect.Left() < rWorkArea.Left())
@@ -1421,7 +1421,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
::tools::Rectangle aRect( pOLV->GetOutputArea() );
Point aPos( pOLV->GetWindow()->PixelToLogic( maDropPos ) );
- if( aRect.IsInside( aPos ) || ( !bDrag && IsTextEdit() ) )
+ if( aRect.Contains( aPos ) || ( !bDrag && IsTextEdit() ) )
{
// mba: clipboard always must contain absolute URLs (could be from alien source)
pOLV->Read( *xStm, EETextFormat::Xml, mpDocSh->GetHeaderAttributes() );
@@ -1459,7 +1459,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
::tools::Rectangle aRect( pOLV->GetOutputArea() );
Point aPos( pOLV->GetWindow()->PixelToLogic( maDropPos ) );
- if( aRect.IsInside( aPos ) || ( !bDrag && IsTextEdit() ) )
+ if( aRect.Contains( aPos ) || ( !bDrag && IsTextEdit() ) )
{
// mba: clipboard always must contain absolute URLs (could be from alien source)
pOLV->Read( *xStm, EETextFormat::Rtf, mpDocSh->GetHeaderAttributes() );
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 00e27a641c01..02febb2823be 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -85,7 +85,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
if(pPV && dynamic_cast< const ::sd::slidesorter::view::SlideSorterView* >(this) != nullptr)
{
- if(!pPV->GetPageRect().IsInside(rPos))
+ if(!pPV->GetPageRect().Contains(rPos))
pPV = nullptr;
}
@@ -313,7 +313,7 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM
if(pPV && dynamic_cast<const ::sd::slidesorter::view::SlideSorterView* >(this) )
{
- if(!pPV->GetPageRect().IsInside(rPos))
+ if(!pPV->GetPageRect().Contains(rPos))
pPV = nullptr;
}