diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-03-10 18:00:58 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-03-11 00:14:56 +0100 |
commit | e9171066136868fe89947dda5095e9479d5e50e7 (patch) | |
tree | eda06f3196145b6f3e66c178425ce86735721a24 /editeng/source/misc/svxacorr.cxx | |
parent | adc6ba2ad502f095dde8f36242fda9aaa6c276fd (diff) |
Use for-range loops in editeng
Change-Id: I6abf56aba1211e1288bd8ee673e0614d1b5dc1d6
Reviewed-on: https://gerrit.libreoffice.org/51050
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'editeng/source/misc/svxacorr.cxx')
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 302c941b06b7..9ba2b3152618 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -2621,12 +2621,12 @@ struct SvxAutocorrWordList::Impl void DeleteAndDestroyAll() { - for (AutocorrWordHashType::const_iterator it = maHash.begin(); it != maHash.end(); ++it) - delete it->second; + for (auto const& elem : maHash) + delete elem.second; maHash.clear(); - for (AutocorrWordSetType::const_iterator it2 = maSet.begin(); it2 != maSet.end(); ++it2) - delete *it2; + for (auto const& elem : maSet) + delete elem; maSet.clear(); } }; @@ -2701,12 +2701,12 @@ SvxAutocorrWordList::Content SvxAutocorrWordList::getSortedContent() const if ( mpImpl->maSet.empty() ) { // This beast has some O(N log(N)) in a terribly slow ICU collate fn. - for (AutocorrWordHashType::const_iterator it = mpImpl->maHash.begin(); it != mpImpl->maHash.end(); ++it) - mpImpl->maSet.insert( it->second ); + for (auto const& elem : mpImpl->maHash) + mpImpl->maSet.insert( elem.second ); mpImpl->maHash.clear(); } - for (AutocorrWordSetType::const_iterator it = mpImpl->maSet.begin(); it != mpImpl->maSet.end(); ++it) - aContent.push_back( *it ); + for (auto const& elem : mpImpl->maSet) + aContent.push_back(elem); return aContent; } @@ -2837,15 +2837,15 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p const SvxAutocorrWord* SvxAutocorrWordList::SearchWordsInList(const OUString& rTxt, sal_Int32& rStt, sal_Int32 nEndPos) const { - for (AutocorrWordHashType::const_iterator it = mpImpl->maHash.begin(); it != mpImpl->maHash.end(); ++it) + for (auto const& elem : mpImpl->maHash) { - if( const SvxAutocorrWord *aTmp = WordMatches( it->second, rTxt, rStt, nEndPos ) ) + if( const SvxAutocorrWord *aTmp = WordMatches( elem.second, rTxt, rStt, nEndPos ) ) return aTmp; } - for (AutocorrWordSetType::const_iterator it2 = mpImpl->maSet.begin(); it2 != mpImpl->maSet.end(); ++it2) + for (auto const& elem : mpImpl->maSet) { - if( const SvxAutocorrWord *aTmp = WordMatches( *it2, rTxt, rStt, nEndPos ) ) + if( const SvxAutocorrWord *aTmp = WordMatches( elem, rTxt, rStt, nEndPos ) ) return aTmp; } return nullptr; |