diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 09:46:58 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-30 18:27:34 +0200 |
commit | 6d4a6abab3bc610c8bceb9e7d322565f5614c3c5 (patch) | |
tree | e35ac89c41505e3ae6c3f8110fc4ffe23fd7e025 /lingucomponent | |
parent | 91399f5d9d9990d2e249155f4810cdaa5051e72b (diff) |
Prepare for removal of non-const operator[] from Sequence in lingucomponent
Change-Id: Ibce58dc277a703881de91bebdfd8b328c820a28e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124373
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'lingucomponent')
-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) |