diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-28 10:24:35 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-28 09:31:29 +0000 |
commit | 91adb929d747ef1434fb1732fdbf51283fda78e8 (patch) | |
tree | 928b7d95ab0cb21d8a887f1f6b47d6af261f0d12 /linguistic | |
parent | 43b4903db3e925c652e25c34362490f8adc9c5ec (diff) |
clang-tidy modernize-loop-convert in h-l/*
Change-Id: I843528327b25d18476f8959cabba16371213a48a
Reviewed-on: https://gerrit.libreoffice.org/24460
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/dicimp.cxx | 4 | ||||
-rw-r--r-- | linguistic/source/dlistimp.cxx | 6 | ||||
-rw-r--r-- | linguistic/source/iprcache.cxx | 8 | ||||
-rw-r--r-- | linguistic/source/misc.cxx | 4 |
4 files changed, 10 insertions, 12 deletions
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 2df71c08f171..80e424d8cefc 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -470,9 +470,9 @@ sal_uLong DictionaryNeo::saveEntries(const OUString &rURL) pStream->WriteLine(OString("---")); if (0 != (nErr = pStream->GetError())) return nErr; - for (size_t i = 0; i < aEntries.size(); i++) + for (Reference<XDictionaryEntry> & aEntrie : aEntries) { - OString aOutStr = formatForSave(aEntries[i], eEnc); + OString aOutStr = formatForSave(aEntrie, eEnc); pStream->WriteLine (aOutStr); if (0 != (nErr = pStream->GetError())) break; diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 0bf680bd9501..bba17f95bf55 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -626,10 +626,10 @@ void DicList::CreateDicList() // look for dictionaries const OUString aWriteablePath( GetDictionaryWriteablePath() ); std::vector< OUString > aPaths( GetDictionaryPaths() ); - for (size_t i = 0; i < aPaths.size(); ++i) + for (OUString & aPath : aPaths) { - const bool bIsWriteablePath = (aPaths[i] == aWriteablePath); - SearchForDictionaries( aDicList, aPaths[i], bIsWriteablePath ); + const bool bIsWriteablePath = (aPath == aWriteablePath); + SearchForDictionaries( aDicList, aPath, bIsWriteablePath ); } // create IgnoreAllList dictionary with empty URL (non persistent) diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx index e5b38c0eb183..fbcbb446b25d 100644 --- a/linguistic/source/iprcache.cxx +++ b/linguistic/source/iprcache.cxx @@ -63,10 +63,10 @@ static void lcl_AddAsPropertyChangeListener( { if (xListener.is() && rPropSet.is()) { - for (int i = 0; i < NUM_FLUSH_PROPS; ++i) + for (auto& aFlushPropertie : aFlushProperties) { rPropSet->addPropertyChangeListener( - OUString::createFromAscii(aFlushProperties[i].pPropName), xListener ); + OUString::createFromAscii(aFlushPropertie.pPropName), xListener ); } } } @@ -78,10 +78,10 @@ static void lcl_RemoveAsPropertyChangeListener( { if (xListener.is() && rPropSet.is()) { - for (int i = 0; i < NUM_FLUSH_PROPS; ++i) + for (auto& aFlushPropertie : aFlushProperties) { rPropSet->removePropertyChangeListener( - OUString::createFromAscii(aFlushProperties[i].pPropName), xListener ); + OUString::createFromAscii(aFlushPropertie.pPropName), xListener ); } } } diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 4cb427d805be..1edcdf1ec48e 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -680,16 +680,14 @@ static const sal_uInt32 the_aDigitZeroes [] = bool HasDigits( const OUString &rText ) { - static const int nNumDigitZeroes = SAL_N_ELEMENTS(the_aDigitZeroes); const sal_Int32 nLen = rText.getLength(); sal_Int32 i = 0; while (i < nLen) // for all characters ... { const sal_uInt32 nCodePoint = rText.iterateCodePoints( &i ); // handle unicode surrogates correctly... - for (int j = 0; j < nNumDigitZeroes; ++j) // ... check in all 0..9 ranges + for (unsigned int nDigitZero : the_aDigitZeroes) // ... check in all 0..9 ranges { - sal_uInt32 nDigitZero = the_aDigitZeroes[ j ]; if (nDigitZero > nCodePoint) break; if (/*nDigitZero <= nCodePoint &&*/ nCodePoint <= nDigitZero + 9) |