summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-25 17:34:33 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-04 23:23:21 +0200
commit7ce275e463584283c62b915cb798edcf8f0d8ef1 (patch)
treeb6c6ae72b7415ca51a47940cd4b8be46b8d0cb65 /svtools
parentb1a59ddfc8ad8177fb5310e8c58e2138c2305f20 (diff)
Convert Svptrarr to std::vector<Rectangle*>
And also convert some sal_Bool to bool Change-Id: I9af69118cf1020d806a16b8f0ffdeb01120d404a
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/imivctl.hxx12
-rw-r--r--svtools/source/contnr/imivctl1.cxx26
2 files changed, 19 insertions, 19 deletions
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx
index 21257809a4cd..f3c6aedbf8c7 100644
--- a/svtools/source/contnr/imivctl.hxx
+++ b/svtools/source/contnr/imivctl.hxx
@@ -168,7 +168,7 @@ class SvxIconChoiceCtrl_Impl
ScrollBar aHorSBar;
ScrollBarBox aScrBarBox;
Rectangle aCurSelectionRect;
- SvPtrarr aSelectedRectList;
+ std::vector<Rectangle*> aSelectedRectList;
Timer aEditTimer; // for editing in place
Timer aAutoArrangeTimer;
Timer aDocRectChangedTimer;
@@ -264,7 +264,7 @@ class SvxIconChoiceCtrl_Impl
SvxIconChoiceCtrlEntry* pEntry1,
SvxIconChoiceCtrlEntry* pEntry2,
sal_Bool bAdd = sal_True,
- SvPtrarr* pOtherRects = 0
+ std::vector<Rectangle*>* pOtherRects = 0
);
void SelectRange(
@@ -473,15 +473,15 @@ public:
void HideDDIcon();
- sal_Bool IsOver(
- SvPtrarr* pSelectedRectList,
+ bool IsOver(
+ std::vector<Rectangle*>* pSelectedRectList,
const Rectangle& rEntryBoundRect
) const;
void SelectRect(
const Rectangle&,
- sal_Bool bAdd = sal_True,
- SvPtrarr* pOtherRects = 0
+ bool bAdd = true,
+ std::vector<Rectangle*>* pOtherRects = 0
);
sal_Bool IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos );
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index c5d33ce579a3..26ee6bc16a12 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2743,7 +2743,7 @@ static Rectangle GetHotSpot( const Rectangle& rRect )
}
void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2,
- sal_Bool bAdd, SvPtrarr* pOtherRects )
+ sal_Bool bAdd, std::vector<Rectangle*>* pOtherRects )
{
DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr");
Rectangle aRect( GetEntryBoundRect( pEntry1 ) );
@@ -2751,8 +2751,8 @@ void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIco
SelectRect( aRect, bAdd, pOtherRects );
}
-void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd,
- SvPtrarr* pOtherRects )
+void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, bool bAdd,
+ std::vector<Rectangle*>* pOtherRects )
{
aCurSelectionRect = rRect;
if( !pZOrderList || !pZOrderList->size() )
@@ -2768,7 +2768,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd,
Rectangle aRect( rRect );
aRect.Justify();
- sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False;
+ bool bCalcOverlap = (bAdd && pOtherRects && !pOtherRects->empty()) ? true : false;
sal_Bool bResetClipRegion = sal_False;
if( !pView->IsClipRegion() )
@@ -2894,16 +2894,16 @@ void SvxIconChoiceCtrl_Impl::SelectRange(
}
}
-sal_Bool SvxIconChoiceCtrl_Impl::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
+bool SvxIconChoiceCtrl_Impl::IsOver( std::vector<Rectangle*>* pRectList, const Rectangle& rBoundRect ) const
{
- const sal_uInt16 nCount = pRectList->Count();
+ const sal_uInt16 nCount = pRectList->size();
for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
- Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur );
+ Rectangle* pRect = (*pRectList)[ nCur ];
if( rBoundRect.IsOver( *pRect ))
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
void SvxIconChoiceCtrl_Impl::AddSelectedRect( SvxIconChoiceCtrlEntry* pEntry1,
@@ -2919,18 +2919,18 @@ void SvxIconChoiceCtrl_Impl::AddSelectedRect( const Rectangle& rRect )
{
Rectangle* pRect = new Rectangle( rRect );
pRect->Justify();
- aSelectedRectList.Insert( (void*)pRect, aSelectedRectList.Count() );
+ aSelectedRectList.push_back( pRect );
}
void SvxIconChoiceCtrl_Impl::ClearSelectedRectList()
{
- const sal_uInt16 nCount = aSelectedRectList.Count();
+ const sal_uInt16 nCount = aSelectedRectList.size();
for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
- Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur );
+ Rectangle* pRect = aSelectedRectList[ nCur ];
delete pRect;
}
- aSelectedRectList.Remove( 0, aSelectedRectList.Count() );
+ aSelectedRectList.clear();
}
IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, AutoArrangeHdl)