From 0f6725454823a5789f3e1c70dad024c46d3f6fc9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 12 May 2016 10:05:54 +0200 Subject: clang-tidy modernize-loop-convert in toolkit to uui Change-Id: I805aa1389ef8dde158f0b776d6b59579fa3082e4 Reviewed-on: https://gerrit.libreoffice.org/24921 Tested-by: Jenkins Reviewed-by: Noel Grandin --- tools/source/inet/inetmime.cxx | 6 +++--- tools/source/memtools/multisel.cxx | 20 ++++++++++---------- tools/source/ref/errinf.cxx | 4 ++-- tools/source/stream/stream.cxx | 6 +++--- tools/source/zcodec/zcodec.cxx | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) (limited to 'tools') diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index ce123e8bd49e..5fdbf43342f6 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -2224,9 +2224,9 @@ static EncodingEntry const aEncodingMap[] rtl_TextEncoding getCharsetEncoding(sal_Char const * pBegin, sal_Char const * pEnd) { - for (sal_Size i = 0; i < SAL_N_ELEMENTS(aEncodingMap); ++i) - if (equalIgnoreCase(pBegin, pEnd, aEncodingMap[i].m_aName)) - return aEncodingMap[i].m_eEncoding; + for (const EncodingEntry& i : aEncodingMap) + if (equalIgnoreCase(pBegin, pEnd, i.m_aName)) + return i.m_eEncoding; return RTL_TEXTENCODING_DONTKNOW; } diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx index 9e17b76ff907..ac32e372f8ef 100644 --- a/tools/source/memtools/multisel.cxx +++ b/tools/source/memtools/multisel.cxx @@ -27,8 +27,8 @@ void MultiSelection::ImplClear() // no selected indexes nSelCount = 0; - for ( size_t i = 0, n = aSels.size(); i < n; ++i ) { - delete aSels[ i ]; + for (Range* pSel : aSels) { + delete pSel; } aSels.clear(); } @@ -92,8 +92,8 @@ MultiSelection::MultiSelection( const MultiSelection& rOrig ) : } // copy the sub selections - for ( size_t n = 0; n < rOrig.aSels.size(); ++n ) - aSels.push_back( new Range( *rOrig.aSels[ n ] ) ); + for (const Range* pSel : rOrig.aSels) + aSels.push_back( new Range( *pSel ) ); } MultiSelection::MultiSelection( const Range& rRange ): @@ -109,8 +109,8 @@ MultiSelection::MultiSelection( const Range& rRange ): MultiSelection::~MultiSelection() { - for ( size_t i = 0, n = aSels.size(); i < n; ++i ) - delete aSels[ i ]; + for (Range* pSel : aSels) + delete pSel; aSels.clear(); } @@ -126,8 +126,8 @@ MultiSelection& MultiSelection::operator= ( const MultiSelection& rOrig ) // clear the old and copy the sub selections ImplClear(); - for ( size_t n = 0; n < rOrig.aSels.size(); ++n ) - aSels.push_back( new Range( *rOrig.aSels[ n ] ) ); + for (const Range* pSel : rOrig.aSels) + aSels.push_back( new Range( *pSel ) ); nSelCount = rOrig.nSelCount; return *this; @@ -527,8 +527,8 @@ void MultiSelection::SetTotalRange( const Range& rTotRange ) // re-calculate selection count nSelCount = 0; - for ( size_t i = 0, n = aSels.size(); i < n; ++ i ) - nSelCount += aSels[i]->Len(); + for (Range* pSel : aSels) + nSelCount += pSel->Len(); bCurValid = false; nCurIndex = 0; diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx index 32bfb80b4659..40e7b697c8e2 100644 --- a/tools/source/ref/errinf.cxx +++ b/tools/source/ref/errinf.cxx @@ -63,8 +63,8 @@ EDcrData::EDcrData() , bIsWindowDsp(false) , nNextDcr(0) { - for(sal_uInt16 n=0;n