diff options
-rw-r--r-- | lingucomponent/source/lingutil/lingutil.cxx | 6 | ||||
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.cxx | 9 |
2 files changed, 5 insertions, 10 deletions
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index aa1fa92edd62..3038d5a3edad 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -120,11 +120,9 @@ static void GetOldStyleDicsInDir( { // add the dictionary to the resulting vector SvtLinguConfigDictionaryEntry aDicEntry; - aDicEntry.aLocations.realloc(1); - aDicEntry.aLocaleNames.realloc(1); - aDicEntry.aLocations[0] = sPath; + aDicEntry.aLocations = { sPath }; + aDicEntry.aLocaleNames = { aLocaleName }; aDicEntry.aFormatName = aFormatName; - aDicEntry.aLocaleNames[0] = aLocaleName; aRes.push_back( aDicEntry ); } } diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 2bacf9386319..843dcfb28585 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -179,12 +179,9 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() } // ... and add them to the resulting sequence m_aSuppLocales.realloc( aLocaleNamesSet.size() ); - sal_Int32 k = 0; - for (auto const& localeName : aLocaleNamesSet) - { - Locale aTmp( LanguageTag::convertToLocale(localeName)); - m_aSuppLocales[k++] = aTmp; - } + std::transform( + aLocaleNamesSet.begin(), aLocaleNamesSet.end(), m_aSuppLocales.getArray(), + [](auto const& localeName) { return LanguageTag::convertToLocale(localeName); }); //! For each dictionary and each locale we need a separate entry. //! If this results in more than one dictionary per locale than (for now) |