diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-12 10:05:54 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-13 08:10:29 +0000 |
commit | 0f6725454823a5789f3e1c70dad024c46d3f6fc9 (patch) | |
tree | 370646f32cddb69aadf0d9659e90ed8600d43901 /ucb | |
parent | f12b17867ef8fa2cfc2ddb7ecda9d7acc57cfa59 (diff) |
clang-tidy modernize-loop-convert in toolkit to uui
Change-Id: I805aa1389ef8dde158f0b776d6b59579fa3082e4
Reviewed-on: https://gerrit.libreoffice.org/24921
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/sorter/sortdynres.cxx | 5 | ||||
-rw-r--r-- | ucb/source/sorter/sortresult.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/file/shell.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpcontentprovider.cxx | 24 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpresultsetI.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpurl.cxx | 12 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/ContentProperties.cxx | 9 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx | 4 |
8 files changed, 30 insertions, 37 deletions
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx index e4552ec59bce..65f41326bee1 100644 --- a/ucb/source/sorter/sortdynres.cxx +++ b/ucb/source/sorter/sortdynres.cxx @@ -535,10 +535,9 @@ SortedDynamicResultSetFactory::createSortedDynamicResultSet( void EventList::Clear() { - for ( std::deque< ListAction* >::size_type i = 0; - i < maData.size(); ++i ) + for (ListAction* p : maData) { - delete maData[i]; + delete p; } maData.clear(); diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index f65b89a27c56..95d9c9728d97 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -1801,10 +1801,9 @@ SortListData::SortListData( sal_IntPtr nPos ) void SortedEntryList::Clear() { - for ( std::deque< ListAction* >::size_type i = 0; - i < maData.size(); ++i ) + for (SortListData* p : maData) { - delete maData[i]; + delete p; } maData.clear(); diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index 6db47420440b..029459eccf5c 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -2751,10 +2751,8 @@ shell::getContentExchangedEventListeners( const OUString& aOldPrefix, void SAL_CALL shell::notifyContentExchanged( std::vector< std::list< ContentEventNotifier* >* >* listeners_vec ) { - std::list< ContentEventNotifier* >* listeners; - for( size_t i = 0; i < listeners_vec->size(); ++i ) + for( std::list< ContentEventNotifier* >* listeners : *listeners_vec) { - listeners = (*listeners_vec)[i]; std::list< ContentEventNotifier* >::iterator it = listeners->begin(); while( it != listeners->end() ) { diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx index caa2a34fec53..cb67852db987 100644 --- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx +++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx @@ -244,13 +244,13 @@ bool FTPContentProvider::forHost( const OUString& host, OUString& account) { osl::MutexGuard aGuard(m_aMutex); - for(size_t i = 0; i < m_ServerInfo.size(); ++i) - if(host == m_ServerInfo[i].host && - port == m_ServerInfo[i].port && - username == m_ServerInfo[i].username ) + for(ServerInfo & i : m_ServerInfo) + if(host == i.host && + port == i.port && + username == i.username ) { - password = m_ServerInfo[i].password; - account = m_ServerInfo[i].account; + password = i.password; + account = i.account; return true; } @@ -272,14 +272,14 @@ bool FTPContentProvider::setHost( const OUString& host, bool present(false); osl::MutexGuard aGuard(m_aMutex); - for(size_t i = 0; i < m_ServerInfo.size(); ++i) - if(host == m_ServerInfo[i].host && - port == m_ServerInfo[i].port && - username == m_ServerInfo[i].username) + for(ServerInfo & i : m_ServerInfo) + if(host == i.host && + port == i.port && + username == i.username) { present = true; - m_ServerInfo[i].password = password; - m_ServerInfo[i].account = account; + i.password = password; + i.account = account; } if(!present) diff --git a/ucb/source/ucp/ftp/ftpresultsetI.cxx b/ucb/source/ucp/ftp/ftpresultsetI.cxx index 7c2b5c002362..862fb913f7ca 100644 --- a/ucb/source/ucp/ftp/ftpresultsetI.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetI.cxx @@ -44,8 +44,8 @@ ResultSetI::ResultSetI(const Reference<XComponentContext>& rxContext, const std::vector<FTPDirentry>& dirvec) : ResultSetBase(rxContext,xProvider,seqProp) { - for( size_t i = 0; i < dirvec.size(); ++i) - m_aPath.push_back(dirvec[i].m_aURL); + for(const auto & i : dirvec) + m_aPath.push_back(i.m_aURL); // m_aIdents holds the content identifiers diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index cab116ce7186..9f2ffceb05f3 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -612,9 +612,9 @@ FTPDirentry FTPURL::direntry() const std::vector<FTPDirentry> aList = aURL.list(OpenMode::ALL); - for(size_t i = 0; i < aList.size(); ++i) { - if(aList[i].m_aName == nettitle) { // the relevant file is found - aDirentry = aList[i]; + for(FTPDirentry & d : aList) { + if(d.m_aName == nettitle) { // the relevant file is found + aDirentry = d; break; } } @@ -774,12 +774,14 @@ void FTPURL::del() const if(aDirentry.m_nMode & INETCOREFTP_FILEMODE_ISDIR) { std::vector<FTPDirentry> vec = list(sal_Int16(OpenMode::ALL)); - for( size_t i = 0; i < vec.size(); ++i ) + for(const FTPDirentry & i : vec) + { try { - FTPURL url(vec[i].m_aURL,m_pFCP); + FTPURL url(i.m_aURL,m_pFCP); url.del(); } catch(const curl_exception&) { } + } dele = OString("RMD ") + dele; } else if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index 34a9a0681658..a3bf1ec2fb76 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -538,18 +538,15 @@ namespace OUString( "Date" ) }; - for ( sal_uInt32 n = 0; - n < ( sizeof( aNonCachableProps ) - / sizeof( aNonCachableProps[ 0 ] ) ); - ++n ) + for (const auto & rNonCachableProp : aNonCachableProps) { if ( isCaseSensitive ) { - if ( rName.equals( aNonCachableProps[ n ] ) ) + if ( rName.equals( rNonCachableProp ) ) return false; } else - if ( rName.equalsIgnoreAsciiCase( aNonCachableProps[ n ] ) ) + if ( rName.equalsIgnoreAsciiCase( rNonCachableProp ) ) return false; } return true; diff --git a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx index ab883d519720..7eef0b111b35 100644 --- a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx +++ b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx @@ -411,10 +411,8 @@ bool DataSupplier::getData() aPath = NeonUri::unescape( aPath ); bool bFoundParent = false; - for ( size_t n = 0; n < resources.size(); ++n ) + for (DAVResource & rRes : resources) { - const DAVResource & rRes = resources[ n ]; - // Filter parent, which is contained somewhere(!) in // the vector. if ( !bFoundParent ) |