summaryrefslogtreecommitdiff
path: root/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx')
-rw-r--r--lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx30
1 files changed, 14 insertions, 16 deletions
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index 5503333c18ce..1a9c1d628a14 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -47,7 +47,7 @@
#include <string.h>
#include <cassert>
-#include <list>
+#include <vector>
#include <set>
#include <memory>
@@ -117,7 +117,7 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales()
// get list of dictionaries-to-use
// (or better speaking: the list of dictionaries using the
// new configuration entries).
- std::list< SvtLinguConfigDictionaryEntry > aDics;
+ std::vector< SvtLinguConfigDictionaryEntry > aDics;
uno::Sequence< OUString > aFormatList;
aLinguCfg.GetSupportedDictionaryFormatsFor( "Hyphenators",
"org.openoffice.lingu.LibHnjHyphenator", aFormatList );
@@ -146,10 +146,9 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales()
// get supported locales from the dictionaries-to-use...
sal_Int32 k = 0;
std::set<OUString> aLocaleNamesSet;
- std::list< SvtLinguConfigDictionaryEntry >::const_iterator aDictIt;
- for (aDictIt = aDics.begin(); aDictIt != aDics.end(); ++aDictIt)
+ for (auto const& dict : aDics)
{
- uno::Sequence< OUString > aLocaleNames( aDictIt->aLocaleNames );
+ uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames );
sal_Int32 nLen2 = aLocaleNames.getLength();
for (k = 0; k < nLen2; ++k)
{
@@ -158,11 +157,10 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales()
}
// ... and add them to the resulting sequence
aSuppLocales.realloc( aLocaleNamesSet.size() );
- std::set<OUString>::const_iterator aItB;
k = 0;
- for (aItB = aLocaleNamesSet.begin(); aItB != aLocaleNamesSet.end(); ++aItB)
+ for (auto const& localeName : aLocaleNamesSet)
{
- Locale aTmp( LanguageTag::convertToLocale( *aItB ));
+ Locale aTmp( LanguageTag::convertToLocale(localeName));
aSuppLocales[k++] = aTmp;
}
@@ -172,19 +170,19 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales()
//! In the future the implementation should support using several dictionaries
//! for one locale.
numdict = 0;
- for (aDictIt = aDics.begin(); aDictIt != aDics.end(); ++aDictIt)
- numdict = numdict + aDictIt->aLocaleNames.getLength();
+ for (auto const& dict : aDics)
+ numdict = numdict + dict.aLocaleNames.getLength();
// add dictionary information
aDicts = new HDInfo[numdict];
k = 0;
- for (aDictIt = aDics.begin(); aDictIt != aDics.end(); ++aDictIt)
+ for (auto const& dict : aDics)
{
- if (aDictIt->aLocaleNames.getLength() > 0 &&
- aDictIt->aLocations.getLength() > 0)
+ if (dict.aLocaleNames.getLength() > 0 &&
+ dict.aLocations.getLength() > 0)
{
- uno::Sequence< OUString > aLocaleNames( aDictIt->aLocaleNames );
+ uno::Sequence< OUString > aLocaleNames(dict.aLocaleNames);
sal_Int32 nLocales = aLocaleNames.getLength();
// currently only one language per dictionary is supported in the actual implementation...
@@ -192,7 +190,7 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales()
// Once for each of its supported locales.
for (sal_Int32 i = 0; i < nLocales; ++i)
{
- LanguageTag aLanguageTag( aDictIt->aLocaleNames[i] );
+ LanguageTag aLanguageTag(dict.aLocaleNames[i]);
aDicts[k].aPtr = nullptr;
aDicts[k].eEnc = RTL_TEXTENCODING_DONTKNOW;
aDicts[k].aLoc = aLanguageTag.getLocale();
@@ -200,7 +198,7 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales()
// also both files have to be in the same directory and the
// file names must only differ in the extension (.aff/.dic).
// Thus we use the first location only and strip the extension part.
- OUString aLocation = aDictIt->aLocations[0];
+ OUString aLocation = dict.aLocations[0];
sal_Int32 nPos = aLocation.lastIndexOf( '.' );
aLocation = aLocation.copy( 0, nPos );
aDicts[k].aName = aLocation;