diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-10 14:39:07 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-11 06:54:34 +0000 |
commit | 265068d65b39688b8a4756dfbcd46453dd1f9b70 (patch) | |
tree | 6936185b2f2f46b99646d00e542cdde845ef073d /svl/source/misc | |
parent | 9e0335d1db22bd3ad3f4bb249b30a00fd55558f4 (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 'svl/source/misc')
-rw-r--r-- | svl/source/misc/sharecontrolfile.cxx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index 1630dd24643b..ca95115e3ca6 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.cxx @@ -205,11 +205,11 @@ void ShareControlFile::SetUsersDataAndStore( const std::vector< LockFileEntry >& m_xSeekable->seek( 0 ); OUStringBuffer aBuffer; - for ( size_t nInd = 0; nInd < aUsersData.size(); nInd++ ) + for (const auto & rData : aUsersData) { for ( LockFileComponent nEntryInd : o3tl::enumrange<LockFileComponent>() ) { - aBuffer.append( EscapeCharacters( aUsersData[nInd][nEntryInd] ) ); + aBuffer.append( EscapeCharacters( rData[nEntryInd] ) ); if ( nEntryInd < LockFileComponent::LAST ) aBuffer.append( ',' ); else @@ -237,11 +237,11 @@ LockFileEntry ShareControlFile::InsertOwnEntry() bool bExists = false; sal_Int32 nNewInd = 0; - for ( size_t nInd = 0; nInd < m_aUsersData.size(); nInd++ ) + for (LockFileEntry & rEntry : m_aUsersData) { - if ( m_aUsersData[nInd][LockFileComponent::LOCALHOST] == aNewEntry[LockFileComponent::LOCALHOST] - && m_aUsersData[nInd][LockFileComponent::SYSUSERNAME] == aNewEntry[LockFileComponent::SYSUSERNAME] - && m_aUsersData[nInd][LockFileComponent::USERURL] == aNewEntry[LockFileComponent::USERURL] ) + if ( rEntry[LockFileComponent::LOCALHOST] == aNewEntry[LockFileComponent::LOCALHOST] + && rEntry[LockFileComponent::SYSUSERNAME] == aNewEntry[LockFileComponent::SYSUSERNAME] + && rEntry[LockFileComponent::USERURL] == aNewEntry[LockFileComponent::USERURL] ) { if ( !bExists ) { @@ -251,7 +251,7 @@ LockFileEntry ShareControlFile::InsertOwnEntry() } else { - aNewData[nNewInd] = m_aUsersData[nInd]; + aNewData[nNewInd] = rEntry; } nNewInd++; @@ -278,11 +278,11 @@ bool ShareControlFile::HasOwnEntry() GetUsersData(); LockFileEntry aEntry = GenerateOwnEntry(); - for ( size_t nInd = 0; nInd < m_aUsersData.size(); ++nInd ) + for (LockFileEntry & rEntry : m_aUsersData) { - if ( m_aUsersData[nInd][LockFileComponent::LOCALHOST] == aEntry[LockFileComponent::LOCALHOST] && - m_aUsersData[nInd][LockFileComponent::SYSUSERNAME] == aEntry[LockFileComponent::SYSUSERNAME] && - m_aUsersData[nInd][LockFileComponent::USERURL] == aEntry[LockFileComponent::USERURL] ) + if ( rEntry[LockFileComponent::LOCALHOST] == aEntry[LockFileComponent::LOCALHOST] && + rEntry[LockFileComponent::SYSUSERNAME] == aEntry[LockFileComponent::SYSUSERNAME] && + rEntry[LockFileComponent::USERURL] == aEntry[LockFileComponent::USERURL] ) { return true; } @@ -308,13 +308,13 @@ void ShareControlFile::RemoveEntry( const LockFileEntry& aEntry ) std::vector< LockFileEntry > aNewData; - for ( size_t nInd = 0; nInd < m_aUsersData.size(); nInd++ ) + for (LockFileEntry & rEntry : m_aUsersData) { - if ( m_aUsersData[nInd][LockFileComponent::LOCALHOST] != aEntry[LockFileComponent::LOCALHOST] - || m_aUsersData[nInd][LockFileComponent::SYSUSERNAME] != aEntry[LockFileComponent::SYSUSERNAME] - || m_aUsersData[nInd][LockFileComponent::USERURL] != aEntry[LockFileComponent::USERURL] ) + if ( rEntry[LockFileComponent::LOCALHOST] != aEntry[LockFileComponent::LOCALHOST] + || rEntry[LockFileComponent::SYSUSERNAME] != aEntry[LockFileComponent::SYSUSERNAME] + || rEntry[LockFileComponent::USERURL] != aEntry[LockFileComponent::USERURL] ) { - aNewData.push_back( m_aUsersData[nInd] ); + aNewData.push_back( rEntry ); } } |