summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-07-01 12:12:03 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2024-07-02 09:58:44 +0200
commit7c467736fd3b08ec7ea0bd930bfd96add9f77a2d (patch)
tree73ec8896cc4c7031d03a7b2169d51098455c0850 /vcl/source/control
parent72ef986133be94fd872ceaef57f3e0ffd7a538d8 (diff)
tdf#161853 vcl: Pass vector by const ref instead of pointer
Pass the vector of rectangles by const ref instead of as pointer for both variants of `SvxIconChoiceCtrl_Impl::SelectRect`, which also makes it clearer that this is never nullptr. Change-Id: I10c9ff27602128eb878d03125d966e1fbf198237 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169797 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/imivctl.hxx4
-rw-r--r--vcl/source/control/imivctl1.cxx14
2 files changed, 9 insertions, 9 deletions
diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index 569e8e456320..a13952904cc8 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -194,7 +194,7 @@ class SvxIconChoiceCtrl_Impl
SvxIconChoiceCtrlEntry* pEntry1,
SvxIconChoiceCtrlEntry* pEntry2,
bool bAdd,
- std::vector<tools::Rectangle>* pOtherRects
+ const std::vector<tools::Rectangle>& rOtherRects
);
void SelectRange(
@@ -365,7 +365,7 @@ public:
void SelectRect(
const tools::Rectangle&,
bool bAdd,
- std::vector<tools::Rectangle>* pOtherRects
+ const std::vector<tools::Rectangle>& rOtherRects
);
void MakeVisible(
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index bb811e187d1a..f8aaf425fd08 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -633,7 +633,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
aRect.Union( aTempRect );
}
aCurSelectionRect = aRect;
- SelectRect( aRect, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList );
+ SelectRect(aRect, bool(nFlags & IconChoiceFlags::AddMode), aSelectedRectList);
}
else if( rMEvt.IsMod1() )
{
@@ -828,7 +828,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor,
if ( nWinBits & WB_ALIGN_LEFT )
SelectRange( pAnchor, pNewCursor, bool(nFlags & IconChoiceFlags::AddMode) );
else
- SelectRect(pAnchor,pNewCursor, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList);
+ SelectRect(pAnchor,pNewCursor, bool(nFlags & IconChoiceFlags::AddMode), aSelectedRectList);
}
else
{
@@ -2219,16 +2219,16 @@ static tools::Rectangle GetHotSpot( const tools::Rectangle& rRect )
}
void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2,
- bool bAdd, std::vector<tools::Rectangle>* pOtherRects )
+ bool bAdd, const std::vector<tools::Rectangle>& rOtherRects)
{
DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr");
tools::Rectangle aRect( GetEntryBoundRect( pEntry1 ) );
aRect.Union( GetEntryBoundRect( pEntry2 ) );
- SelectRect( aRect, bAdd, pOtherRects );
+ SelectRect(aRect, bAdd, rOtherRects);
}
void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAdd,
- std::vector<tools::Rectangle>* pOtherRects )
+ const std::vector<tools::Rectangle>& rOtherRects)
{
aCurSelectionRect = rRect;
if( maZOrderList.empty() )
@@ -2244,7 +2244,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAd
tools::Rectangle aRect( rRect );
aRect.Normalize();
- bool bCalcOverlap = (bAdd && pOtherRects && !pOtherRects->empty());
+ bool bCalcOverlap = (bAdd && !rOtherRects.empty());
bool bResetClipRegion = false;
if( !pView->GetOutDev()->IsClipRegion() )
@@ -2264,7 +2264,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAd
bool bOverlaps;
if( bCalcOverlap )
- bOverlaps = IsOver(*pOtherRects, aBoundRect);
+ bOverlaps = IsOver(rOtherRects, aBoundRect);
else
bOverlaps = false;
bool bOver = aRect.Overlaps( aBoundRect );