diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 16:12:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 12:50:55 +0200 |
commit | 20571c472528c4f98fe3f55700d134915d32a49a (patch) | |
tree | 9b350824d845b8aaeb13d087ef74febb454b821b /linguistic | |
parent | b401896a56149aa2871b65a330a6f601a9830ccd (diff) |
use more range-for on uno::Sequence
Change-Id: Ifad32425d79be5a22d33d721bdc5fb993f699759
Reviewed-on: https://gerrit.libreoffice.org/39763
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/lngsvcmgr.cxx | 48 |
1 files changed, 16 insertions, 32 deletions
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index e3f91af32ff2..1f62ca871a81 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -576,9 +576,7 @@ namespace if (bFound) { - Sequence< OUString > aNames(1); - OUString &rNodeName = aNames.getArray()[0]; - rNodeName = rLastFoundList + "/" + rCfgLocaleStr; + Sequence< OUString > aNames { rLastFoundList + "/" + rCfgLocaleStr }; Sequence< Any > aValues( rCfg.GetProperties( aNames ) ); if (aValues.getLength()) { @@ -604,12 +602,10 @@ namespace OUString *pRes = aRes.getArray(); sal_Int32 nCnt = 0; - sal_Int32 nEntries = rCfgSvcs.getLength(); - const OUString *pEntry = rCfgSvcs.getConstArray(); - for (sal_Int32 i = 0; i < nEntries; ++i) + for (OUString const & entry : rCfgSvcs) { - if (!pEntry[i].isEmpty() && lcl_FindEntry( pEntry[i], rAvailSvcs )) - pRes[ nCnt++ ] = pEntry[i]; + if (!entry.isEmpty() && lcl_FindEntry( entry, rAvailSvcs )) + pRes[ nCnt++ ] = entry; } aRes.realloc( nCnt ); @@ -1244,13 +1240,10 @@ void LngSvcMgr::SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp ) sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below - OUString aPrefix( aNode ); - aPrefix += "/"; - for (int i = 0; i < nLen; ++i) + OUString aPrefix = aNode + "/"; + for (OUString & name : aNames) { - OUString aTmp( aPrefix ); - aTmp += pNames[i]; - pNames[i] = aTmp; + name = aPrefix + name; } uno::Sequence< uno::Any > aValues( /*aCfg.*/GetProperties( aNames ) ); @@ -1282,13 +1275,10 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp ) sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below - OUString aPrefix( aNode ); - aPrefix += "/"; - for (int i = 0; i < nLen; ++i) + OUString aPrefix = aNode + "/"; + for (OUString & name : aNames) { - OUString aTmp( aPrefix ); - aTmp += pNames[i]; - pNames[i] = aTmp; + name = aPrefix + name; } uno::Sequence< uno::Any > aValues( /*aCfg.*/GetProperties( aNames ) ); @@ -1324,13 +1314,10 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ) sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below - OUString aPrefix( aNode ); - aPrefix += "/"; - for (int i = 0; i < nLen; ++i) + OUString aPrefix = aNode + "/"; + for (OUString & name : aNames) { - OUString aTmp( aPrefix ); - aTmp += pNames[i]; - pNames[i] = aTmp; + name = aPrefix + name; } uno::Sequence< uno::Any > aValues( /*aCfg.*/GetProperties( aNames ) ); @@ -1366,13 +1353,10 @@ void LngSvcMgr::SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ) sal_Int32 nLen = aNames.getLength(); // append path prefix need for 'GetProperties' call below - OUString aPrefix( aNode ); - aPrefix += "/"; - for (int i = 0; i < nLen; ++i) + OUString aPrefix = aNode + "/"; + for (OUString & name : aNames) { - OUString aTmp( aPrefix ); - aTmp += pNames[i]; - pNames[i] = aTmp; + name = aPrefix + name; } uno::Sequence< uno::Any > aValues( /*aCfg.*/GetProperties( aNames ) ); |