summaryrefslogtreecommitdiffstats
path: root/lingucomponent
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-14 11:14:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-16 09:04:51 +0200
commit7d7a7862a7dccb6764f80258f28685a0da3cbbcb (patch)
treeb7281950f84b12c4868542f103a23c1460d22863 /lingucomponent
parentxmloff: create XMLImpressMetaExportOOO instances with an uno constructor (diff)
downloadcore-7d7a7862a7dccb6764f80258f28685a0da3cbbcb.tar.gz
core-7d7a7862a7dccb6764f80258f28685a0da3cbbcb.zip
new loplugin:sequenceloop
look for places we should be using std::as_const on for-range loops over uno::Sequence, to avoid triggering a copy Change-Id: I7efb641bf09d37c87946f03428ee4eec90298c8a Reviewed-on: https://gerrit.libreoffice.org/77441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 3bbf8cc66f36..1e88d04874c1 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -124,7 +124,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
uno::Sequence< OUString > aFormatList;
aLinguCfg.GetSupportedDictionaryFormatsFor( "SpellCheckers",
"org.openoffice.lingu.MySpellSpellChecker", aFormatList );
- for (auto const& format : aFormatList)
+ for (auto const& format : std::as_const(aFormatList))
{
std::vector< SvtLinguConfigDictionaryEntry > aTmpDic(
aLinguCfg.GetActiveDictionariesByFormat(format) );
@@ -150,7 +150,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
std::set<OUString> aLocaleNamesSet;
for (auto const& dict : aDics)
{
- uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames );
+ const uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames );
uno::Sequence< OUString > aLocations( dict.aLocations );
SAL_WARN_IF(
aLocaleNames.hasElements() && !aLocations.hasElements(),
@@ -200,7 +200,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
if (dict.aLocaleNames.hasElements() &&
dict.aLocations.hasElements())
{
- uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames );
+ const uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames );
// currently only one language per dictionary is supported in the actual implementation...
// Thus here we work-around this by adding the same dictionary several times.
@@ -238,7 +238,7 @@ sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale)
if (!m_aSuppLocales.hasElements())
getLocales();
- for (auto const& suppLocale : m_aSuppLocales)
+ for (auto const& suppLocale : std::as_const(m_aSuppLocales))
{
if (rLocale == suppLocale)
{