lingucomponent/source/lingutil/lingutil.cxx | 6 ++---- lingucomponent/source/spellcheck/spell/sspellimp.cxx | 9 +++------ linguistic/source/defs.hxx | 3 +-- linguistic/source/gciterator.cxx | 3 +-- 4 files changed, 7 insertions(+), 14 deletions(-)
New commits: commit 8d1ebf5336c8194977d807e43c46b41b0cbcf88d Author: Mike Kaganski <[email protected]> AuthorDate: Fri Oct 29 09:48:15 2021 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Sat Oct 30 18:27:43 2021 +0200 Prepare for removal of non-const operator[] from Sequence in linguistic Change-Id: I6eda1416ca0421a48bf9811343850aa504019d57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124374 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/linguistic/source/defs.hxx b/linguistic/source/defs.hxx index 38909e82362c..7e3d658956e5 100644 --- a/linguistic/source/defs.hxx +++ b/linguistic/source/defs.hxx @@ -45,8 +45,7 @@ struct LangSvcEntries explicit LangSvcEntries( const OUString &rSvcImplName ) : nLastTriedSvcIndex(-1) { - aSvcImplNames.realloc(1); - aSvcImplNames[0] = rSvcImplName; + aSvcImplNames = { rSvcImplName }; } void Clear() diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 09e814d97050..b915dee3033a 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -1044,8 +1044,7 @@ uno::Reference< util::XChangesBatch > const & GrammarCheckingIterator::GetUpdate beans::PropertyValue aValue; aValue.Name = "nodepath"; aValue.Value <<= OUString("org.openoffice.Office.Linguistic/ServiceManager"); - uno::Sequence< uno::Any > aProps(1); - aProps[0] <<= aValue; + uno::Sequence< uno::Any > aProps{ uno::Any(aValue) }; m_xUpdateAccess.set( xConfigurationProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aProps ), commit 6d4a6abab3bc610c8bceb9e7d322565f5614c3c5 Author: Mike Kaganski <[email protected]> AuthorDate: Fri Oct 29 09:46:58 2021 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Sat Oct 30 18:27:34 2021 +0200 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 <[email protected]> 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)
