summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-10 14:39:07 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-11 06:54:34 +0000
commit265068d65b39688b8a4756dfbcd46453dd1f9b70 (patch)
tree6936185b2f2f46b99646d00e542cdde845ef073d /svtools/source
parent9e0335d1db22bd3ad3f4bb249b30a00fd55558f4 (diff)
clang-tidy modernize-loop-convert in scripting to svtools
Change-Id: I98229d14109cf243839d632feabde1391ea9bad5 Reviewed-on: https://gerrit.libreoffice.org/24847 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx4
-rw-r--r--svtools/source/brwbox/brwbox2.cxx12
-rw-r--r--svtools/source/brwbox/datwin.cxx14
-rw-r--r--svtools/source/contnr/fileview.cxx4
-rw-r--r--svtools/source/contnr/foldertree.cxx8
-rw-r--r--svtools/source/contnr/imivctl1.cxx3
-rw-r--r--svtools/source/contnr/treelist.cxx4
-rw-r--r--svtools/source/contnr/treelistbox.cxx4
-rw-r--r--svtools/source/control/autocmpledit.cxx6
-rw-r--r--svtools/source/control/ctrlbox.cxx15
-rw-r--r--svtools/source/control/headbar.cxx11
-rw-r--r--svtools/source/control/ruler.cxx12
-rw-r--r--svtools/source/control/tabbar.cxx27
-rw-r--r--svtools/source/control/valueset.cxx3
-rw-r--r--svtools/source/dialogs/insdlg.cxx12
-rw-r--r--svtools/source/graphic/grfmgr2.cxx4
-rw-r--r--svtools/source/hatchwindow/ipwin.cxx8
-rw-r--r--svtools/source/misc/imap.cxx10
-rw-r--r--svtools/source/misc/transfer.cxx4
-rw-r--r--svtools/source/uno/framestatuslistener.cxx3
-rw-r--r--svtools/source/uno/statusbarcontroller.cxx3
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx3
22 files changed, 80 insertions, 94 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 5b6229d6d33a..16cbb639603c 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -155,8 +155,8 @@ void BrowseBox::dispose()
aHScroll.disposeAndClear();
// free columns-space
- for ( size_t i = 0, n = pCols->size(); i < n; ++i )
- delete (*pCols)[ i ];
+ for (BrowserColumn* pCol : *pCols)
+ delete pCol;
pCols->clear();
delete pCols;
delete pColSel;
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 32ed1364a788..3625d24af2b4 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -141,11 +141,11 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
pHeaderBar->SetZoom(GetZoom());
// let the columns calculate their new widths and adjust the header bar
- for ( size_t nPos = 0; nPos < pCols->size(); ++nPos )
+ for (BrowserColumn* pCol : *pCols)
{
- (*pCols)[ nPos ]->ZoomChanged(GetZoom());
+ pCol->ZoomChanged(GetZoom());
if ( pHeaderBar )
- pHeaderBar->SetItemSize( (*pCols)[ nPos ]->GetId(), (*pCols)[ nPos ]->Width() );
+ pHeaderBar->SetItemSize( pCol->GetId(), pCol->Width() );
}
// all our controls have to be repositioned
@@ -409,9 +409,9 @@ sal_uInt16 BrowseBox::GetColumnPos( sal_uInt16 nId ) const
bool BrowseBox::IsFrozen( sal_uInt16 nColumnId ) const
{
- for ( size_t nPos = 0; nPos < pCols->size(); ++nPos )
- if ( (*pCols)[ nPos ]->GetId() == nColumnId )
- return (*pCols)[ nPos ]->IsFrozen();
+ for (BrowserColumn* pCol : *pCols)
+ if ( pCol->GetId() == nColumnId )
+ return pCol->IsFrozen();
return false;
}
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index df66e02eabc8..11b43f6a92e6 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -223,8 +223,8 @@ void BrowserDataWin::dispose()
{
bInDtor = true;
- for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i )
- delete aInvalidRegion[ i ];
+ for (Rectangle* i : aInvalidRegion)
+ delete i;
aInvalidRegion.clear();
pHeaderBar.clear();
pEventWin.clear();
@@ -650,9 +650,9 @@ void BrowserDataWin::SetUpdateMode( bool bMode )
void BrowserDataWin::DoOutstandingInvalidations()
{
- for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i ) {
- Control::Invalidate( *aInvalidRegion[ i ] );
- delete aInvalidRegion[ i ];
+ for (Rectangle* i : aInvalidRegion) {
+ Control::Invalidate( *i );
+ delete i;
}
aInvalidRegion.clear();
}
@@ -662,8 +662,8 @@ void BrowserDataWin::Invalidate( InvalidateFlags nFlags )
{
if ( !GetUpdateMode() )
{
- for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i )
- delete aInvalidRegion[ i ];
+ for (Rectangle* i : aInvalidRegion)
+ delete i;
aInvalidRegion.clear();
aInvalidRegion.push_back( new Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
}
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 7e338bef0beb..cd4d62482457 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1356,9 +1356,9 @@ OUString SvtFileView::GetConfigString() const
{
::std::vector< SvtContentEntry > aContent;
- for( ::std::vector< SortingData_Impl* >::size_type i = 0; i < mpImp->maContent.size(); i++ )
+ for(SortingData_Impl* i : mpImp->maContent)
{
- SvtContentEntry aEntry( mpImp->maContent[i]->maTargetURL, mpImp->maContent[i]->mbIsFolder );
+ SvtContentEntry aEntry( i->maTargetURL, i->mbIsFolder );
aContent.push_back( aEntry );
}
diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index d5732e20dc3d..40ed9d538544 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -63,13 +63,13 @@ void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
if ( SUCCESS == eResult )
{
- for( std::vector<SortingData_Impl *>::size_type i = 0; i < aContent.size(); i++ )
+ for(SortingData_Impl* i : aContent)
{
- if( aContent[i]->mbIsFolder )
+ if( i->mbIsFolder )
{
- SvTreeListEntry* pNewEntry = InsertEntry( aContent[i]->GetTitle(), pEntry, true );
+ SvTreeListEntry* pNewEntry = InsertEntry( i->GetTitle(), pEntry, true );
- OUString* sData = new OUString( aContent[i]->maTargetURL );
+ OUString* sData = new OUString( i->maTargetURL );
pNewEntry->SetUserData( static_cast< void* >( sData ) );
}
}
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 0629b613a138..05c2aa479243 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2739,9 +2739,8 @@ void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvxIconChoiceCtrlEntryPtrVec& r
bGo = false;
long nCurRight = 0;
- for( size_t nCur = 0; nCur < rRow.size(); nCur++ )
+ for(SvxIconChoiceCtrlEntry* pCur : rRow)
{
- SvxIconChoiceCtrlEntry* pCur = rRow[ nCur ];
if( !bGo && pCur == pStart )
bGo = true;
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index 8f723f403862..f7d912800b4e 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -93,8 +93,8 @@ void SvTreeList::Broadcast(
void SvTreeList::InsertView( SvListView* pView )
{
- for ( sal_uLong i = 0, n = aViewList.size(); i < n; ++i ) {
- if ( aViewList[ i ] == pView ) {
+ for (SvListView* i : aViewList) {
+ if ( i == pView ) {
return;
}
}
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 7a7e5a24d1df..a7e291d08c46 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3277,8 +3277,8 @@ Size SvTreeListBox::GetOptimalSize() const
{
std::vector<long> aWidths;
Size aRet(0, getPreferredDimensions(aWidths));
- for (size_t i = 0; i < aWidths.size(); ++i)
- aRet.Width() += aWidths[i];
+ for (long aWidth : aWidths)
+ aRet.Width() += aWidth;
if (GetStyle() & WB_BORDER)
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
diff --git a/svtools/source/control/autocmpledit.cxx b/svtools/source/control/autocmpledit.cxx
index 737f14056345..9443aebde78c 100644
--- a/svtools/source/control/autocmpledit.cxx
+++ b/svtools/source/control/autocmpledit.cxx
@@ -67,11 +67,11 @@ bool AutocompleteEdit::Match( const OUString& rText )
m_aMatching.clear();
- for( std::vector< OUString >::size_type i = 0; i < m_aEntries.size(); ++i )
+ for(const OUString & rEntry : m_aEntries)
{
- if( m_aEntries[i].startsWithIgnoreAsciiCase( rText ) )
+ if( rEntry.startsWithIgnoreAsciiCase( rText ) )
{
- m_aMatching.push_back( m_aEntries[i] );
+ m_aMatching.push_back( rEntry );
bRet = true;
}
}
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index e9810ad14b09..e64b0a59770c 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -751,11 +751,8 @@ LineListBox::~LineListBox()
void LineListBox::dispose()
{
- for ( size_t i = 0, n = pLineList->size(); i < n; ++i ) {
- if ( (*pLineList)[ i ] ) {
- delete (*pLineList)[ i ];
- }
- }
+ for (ImpLineListData* p : *pLineList)
+ delete p;
pLineList->clear();
delete pLineList;
ListBox::dispose();
@@ -1217,9 +1214,9 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
USCRIPT_GREEK
};
- for (size_t i = 0; i < SAL_N_ELEMENTS(aScripts); ++i)
+ for (const UScriptCode& rScript : aScripts)
{
- OUString sText = makeShortRepresentativeTextForScript(aScripts[i]);
+ OUString sText = makeShortRepresentativeTextForScript(rScript);
if (!sText.isEmpty())
{
bool bHasSampleTextGlyphs = (-1 == pRenderContext->HasGlyphs(aFont, sText));
@@ -1237,9 +1234,9 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
USCRIPT_GREEK
};
- for (size_t i = 0; i < SAL_N_ELEMENTS(aMinimalScripts); ++i)
+ for (const UScriptCode& rMinimalScript : aMinimalScripts)
{
- OUString sText = makeShortMinimalTextForScript(aMinimalScripts[i]);
+ OUString sText = makeShortMinimalTextForScript(rMinimalScript);
if (!sText.isEmpty())
{
bool bHasSampleTextGlyphs = (-1 == pRenderContext->HasGlyphs(aFont, sText));
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index caa6bb030584..b3281241d23d 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -113,8 +113,8 @@ void HeaderBar::dispose()
{
if (mpItemList)
{
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
- delete (*mpItemList)[ i ];
+ for (ImplHeadItem* i : *mpItemList)
+ delete i;
delete mpItemList;
mpItemList = nullptr;
}
@@ -1192,8 +1192,8 @@ void HeaderBar::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
void HeaderBar::Clear()
{
// delete all items
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
- delete (*mpItemList)[ i ];
+ for (ImplHeadItem* i : *mpItemList) {
+ delete i;
}
mpItemList->clear();
@@ -1349,9 +1349,8 @@ Size HeaderBar::CalcWindowSizePixel() const
long nMaxImageSize = 0;
Size aSize( 0, GetTextHeight() );
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
+ for (ImplHeadItem* pItem : *mpItemList)
{
- ImplHeadItem* pItem = (*mpItemList)[ i ];
// take image size into account
long nImageHeight = pItem->maImage.GetSizePixel().Height();
if ( !(pItem->mnBits & (HeaderBarItemBits::LEFTIMAGE | HeaderBarItemBits::RIGHTIMAGE)) && !pItem->maText.isEmpty() )
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 712735789496..81c551d2deb4 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -421,9 +421,9 @@ void Ruler::ImplInvertLines(vcl::RenderContext& rRenderContext)
aRect.Right() = nY;
// Draw lines
- for (size_t i = 0; i < mpData->pLines.size(); i++)
+ for (RulerLine & rLine : mpData->pLines)
{
- const long n = mpData->pLines[i].nPos + nNullWinOff;
+ const long n = rLine.nPos + nNullWinOff;
if ((n >= nRulX1) && (n < nRulX2))
{
if (mnWinStyle & WB_HORZ )
@@ -1020,17 +1020,17 @@ void Ruler::ImplDrawTab(vcl::RenderContext& rRenderContext, const Point& rPos, s
void Ruler::ImplDrawTabs(vcl::RenderContext& rRenderContext, long nMin, long nMax, long nVirTop, long nVirBottom)
{
- for (size_t i = 0; i < mpData->pTabs.size(); i++)
+ for (RulerTab & rTab : mpData->pTabs)
{
- if (mpData->pTabs[i].nStyle & RULER_STYLE_INVISIBLE)
+ if (rTab.nStyle & RULER_STYLE_INVISIBLE)
continue;
long aPosition;
- aPosition = mpData->pTabs[i].nPos;
+ aPosition = rTab.nPos;
aPosition += +mpData->nNullVirOff;
long nTopBottom = (GetStyle() & WB_RIGHT_ALIGNED) ? nVirTop : nVirBottom;
if (nMin <= aPosition && aPosition <= nMax)
- ImplDrawTab(rRenderContext, Point( aPosition, nTopBottom ), mpData->pTabs[i].nStyle);
+ ImplDrawTab(rRenderContext, Point( aPosition, nTopBottom ), rTab.nStyle);
}
}
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 9405c5611e0c..faa4ebf935f1 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -506,9 +506,9 @@ struct TabBar_Impl
~TabBar_Impl()
{
- for (size_t i = 0; i < mpItemList.size(); ++i)
+ for (ImplTabBarItem* i : mpItemList)
{
- delete mpItemList[i];
+ delete i;
}
mpItemList.clear();
}
@@ -708,9 +708,8 @@ bool TabBar::ImplCalcWidth()
mnCurMaxWidth = 0;
bool bChanged = false;
- for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
+ for (ImplTabBarItem* pItem : mpImpl->mpItemList)
{
- ImplTabBarItem* pItem = mpImpl->mpItemList[i];
long nNewWidth = GetTextWidth(pItem->maText);
if (mnCurMaxWidth && (nNewWidth > mnCurMaxWidth))
{
@@ -747,9 +746,8 @@ void TabBar::ImplFormat()
sal_uInt16 n = 0;
long x = mnOffX;
- for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
+ for (ImplTabBarItem* pItem : mpImpl->mpItemList)
{
- ImplTabBarItem* pItem = mpImpl->mpItemList[i];
// At all non-visible tabs an empty rectangle is set
if ((n + 1 < mnFirstPos) || (x > mnLastOffX))
pItem->maRect.SetEmpty();
@@ -1149,9 +1147,9 @@ void TabBar::MouseButtonDown(const MouseEvent& rMEvt)
bUpdate = true;
// deselect all selected items
- for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
+ for (ImplTabBarItem* i : mpImpl->mpItemList)
{
- pItem = mpImpl->mpItemList[i];
+ pItem = i;
if (pItem->mbSelect || (pItem->mnId == mnCurPageId))
{
pItem->mbSelect = false;
@@ -1800,9 +1798,9 @@ void TabBar::MovePage(sal_uInt16 nPageId, sal_uInt16 nNewPos)
void TabBar::Clear()
{
// delete all items
- for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
+ for (ImplTabBarItem* i : mpImpl->mpItemList)
{
- delete mpImpl->mpItemList[i];
+ delete i;
}
mpImpl->mpItemList.clear();
@@ -1882,9 +1880,8 @@ sal_uInt16 TabBar::GetPagePos(sal_uInt16 nPageId) const
sal_uInt16 TabBar::GetPageId(const Point& rPos) const
{
- for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
+ for (ImplTabBarItem* pItem : mpImpl->mpItemList)
{
- ImplTabBarItem* pItem = mpImpl->mpItemList[i];
if (pItem->maRect.IsInside(rPos))
return pItem->mnId;
}
@@ -2084,9 +2081,8 @@ void TabBar::SelectPage(sal_uInt16 nPageId, bool bSelect)
sal_uInt16 TabBar::GetSelectPageCount() const
{
sal_uInt16 nSelected = 0;
- for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
+ for (ImplTabBarItem* pItem : mpImpl->mpItemList)
{
- ImplTabBarItem* pItem = mpImpl->mpItemList[i];
if (pItem->mbSelect)
nSelected++;
}
@@ -2566,9 +2562,8 @@ Size TabBar::CalcWindowSizePixel() const
if (mpImpl->mpItemList.size() > 0)
{
const_cast<TabBar*>(this)->ImplCalcWidth();
- for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
+ for (ImplTabBarItem* pItem : mpImpl->mpItemList)
{
- ImplTabBarItem* pItem = mpImpl->mpItemList[i];
nWidth += pItem->mnWidth;
}
}
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index b2f58c2b0832..e3bdbebd087c 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -2318,9 +2318,8 @@ Size ValueSet::GetLargestItemSize()
{
Size aLargestItem;
- for (size_t i = 0, n = mItemList.size(); i < n; ++i)
+ for (ValueSetItem* pItem : mItemList)
{
- const ValueSetItem* pItem = mItemList[i];
if (!pItem->mbVisible)
continue;
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index 6033a74f03db..b9a6f535a1a3 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -57,20 +57,20 @@ struct OleObjectDescriptor
const SvObjectServer * SvObjectServerList::Get( const OUString & rHumanName ) const
{
- for( size_t i = 0; i < aObjectServerList.size(); i++ )
+ for(const auto & i : aObjectServerList)
{
- if( rHumanName == aObjectServerList[ i ].GetHumanName() )
- return &aObjectServerList[ i ];
+ if( rHumanName == i.GetHumanName() )
+ return &i;
}
return nullptr;
}
const SvObjectServer * SvObjectServerList::Get( const SvGlobalName & rName ) const
{
- for( size_t i = 0; i < aObjectServerList.size(); i++ )
+ for(const auto & i : aObjectServerList)
{
- if( rName == aObjectServerList[ i ].GetClassName() )
- return &aObjectServerList[ i ];
+ if( rName == i.GetClassName() )
+ return &i;
}
return nullptr;
}
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index 145f0facf373..079dc9343bfb 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -49,8 +49,8 @@ GraphicManager::GraphicManager( sal_uLong nCacheSize, sal_uLong nMaxObjCacheSize
GraphicManager::~GraphicManager()
{
- for( size_t i = 0, n = maObjList.size(); i < n; ++i )
- maObjList[ i ]->GraphicManagerDestroyed();
+ for(GraphicObject* i : maObjList)
+ i->GraphicManagerDestroyed();
delete mpCache;
}
diff --git a/svtools/source/hatchwindow/ipwin.cxx b/svtools/source/hatchwindow/ipwin.cxx
index 786119b0fcef..adb8df123552 100644
--- a/svtools/source/hatchwindow/ipwin.cxx
+++ b/svtools/source/hatchwindow/ipwin.cxx
@@ -142,8 +142,8 @@ void SvResizeHelper::InvalidateBorder( vcl::Window * pWin )
{
Rectangle aMoveRects[ 4 ];
FillMoveRectsPixel( aMoveRects );
- for( sal_uInt16 i = 0; i < 4; i++ )
- pWin->Invalidate( aMoveRects[ i ] );
+ for(const auto & rMoveRect : aMoveRects)
+ pWin->Invalidate( rMoveRect );
}
/*************************************************************************
@@ -186,8 +186,8 @@ short SvResizeHelper::SelectMove( vcl::Window * pWin, const Point & rPos )
// Move-Rect overlaps Handles
Rectangle aMoveRects[ 4 ];
FillMoveRectsPixel( aMoveRects );
- for( sal_uInt16 i = 0; i < 4; i++ )
- if( aMoveRects[ i ].IsInside( rPos ) )
+ for(const auto & rMoveRect : aMoveRects)
+ if( rMoveRect.IsInside( rPos ) )
return 8;
}
else
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index e1e5c5964c8c..544a5ee22a9e 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -611,8 +611,8 @@ ImageMap::~ImageMap()
void ImageMap::ClearImageMap()
{
- for( size_t i = 0, n = maList.size(); i < n; ++i )
- delete maList[ i ];
+ for(IMapObject* i : maList)
+ delete i;
maList.clear();
aName.clear();
@@ -788,9 +788,9 @@ IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize,
// walk over all objects and execute HitTest
IMapObject* pObj = nullptr;
- for( size_t i = 0, n = maList.size(); i < n; ++i ) {
- if ( maList[ i ]->IsHit( aRelPoint ) ) {
- pObj = maList[ i ];
+ for(IMapObject* i : maList) {
+ if ( i->IsHit( aRelPoint ) ) {
+ pObj = i;
break;
}
}
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index dc77cf5ff539..b00facbbb1a3 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -126,8 +126,8 @@ static OUString ImplGetParameterString( const TransferableObjectDescriptor& rObj
// the display name might contain unacceptable characters, encode all of them
// this seems to be the only parameter currently that might contain such characters
sal_Bool pToAccept[128];
- for ( sal_Int32 nBInd = 0; nBInd < 128; nBInd++ )
- pToAccept[nBInd] = false;
+ for (sal_Bool & rb : pToAccept)
+ rb = 0;
const char aQuotedParamChars[] =
"()<>@,;:/[]?=!#$&'*+-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz{|}~. ";
diff --git a/svtools/source/uno/framestatuslistener.cxx b/svtools/source/uno/framestatuslistener.cxx
index aed11138467f..314934c943fb 100644
--- a/svtools/source/uno/framestatuslistener.cxx
+++ b/svtools/source/uno/framestatuslistener.cxx
@@ -283,9 +283,8 @@ void FrameStatusListener::bindListener()
{
try
{
- for ( size_t i = 0; i < aDispatchVector.size(); i++ )
+ for (Listener & rListener : aDispatchVector)
{
- Listener& rListener = aDispatchVector[i];
if ( rListener.xDispatch.is() )
rListener.xDispatch->addStatusListener( xStatusListener, rListener.aURL );
}
diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx
index 430e22a7709f..619e175f7626 100644
--- a/svtools/source/uno/statusbarcontroller.cxx
+++ b/svtools/source/uno/statusbarcontroller.cxx
@@ -482,11 +482,10 @@ void StatusbarController::bindListener()
if ( !xStatusListener.is() )
return;
- for ( size_t i = 0; i < aDispatchVector.size(); i++ )
+ for (Listener & rListener : aDispatchVector)
{
try
{
- Listener& rListener = aDispatchVector[i];
if ( rListener.xDispatch.is() )
rListener.xDispatch->addStatusListener( xStatusListener, rListener.aURL );
else if ( rListener.aURL.Complete == m_aCommandURL )
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index ef779f3bd8ca..eb455e56df97 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -545,9 +545,8 @@ void ToolboxController::bindListener()
{
try
{
- for ( size_t i = 0; i < aDispatchVector.size(); i++ )
+ for (Listener & rListener : aDispatchVector)
{
- Listener& rListener = aDispatchVector[i];
if ( rListener.xDispatch.is() )
rListener.xDispatch->addStatusListener( xStatusListener, rListener.aURL );
else if ( rListener.aURL.Complete == m_aCommandURL )