diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-20 08:48:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-20 21:31:13 +0200 |
commit | b33ff1a083d95388997cf301d8a1538a41c08255 (patch) | |
tree | 35c773fc0be7c6e4c4b479c9594fb1e8843ef183 /editeng | |
parent | fb149c68db909e6ec17520e277583ed759a0d49a (diff) |
use for-range on Sequence in e*
Change-Id: I77dc12356ee45b1dee9acaf8a73dea81588822d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94554
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/qa/unit/core-test.cxx | 4 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 5 | ||||
-rw-r--r-- | editeng/source/uno/unonrule.cxx | 4 |
3 files changed, 5 insertions, 8 deletions
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index b5b133f047a6..a91565bce2a9 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -231,8 +231,8 @@ void Test::testConstruction() bool includes(const uno::Sequence<OUString>& rSeq, const OUString& rVal) { - for (sal_Int32 i = 0, n = rSeq.getLength(); i < n; ++i) - if (rSeq[i] == rVal) + for (OUString const & s : rSeq) + if (s == rVal) return true; return false; diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 1242852d6213..71f6efc2e33f 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -502,10 +502,9 @@ bool SvxAutoCorrect::FnChgOrdinalNumber( uno::Reference< i18n::XOrdinalSuffix > xOrdSuffix = i18n::OrdinalSuffix::create(comphelper::getProcessComponentContext()); - uno::Sequence< OUString > aSuffixes = xOrdSuffix->getOrdinalSuffix(nNum, rCC.getLanguageTag().getLocale()); - for (sal_Int32 nSuff = 0; nSuff < aSuffixes.getLength(); nSuff++) + const uno::Sequence< OUString > aSuffixes = xOrdSuffix->getOrdinalSuffix(nNum, rCC.getLanguageTag().getLocale()); + for (OUString const & sSuffix : aSuffixes) { - OUString sSuffix(aSuffixes[nSuff]); OUString sEnd = rTxt.copy(nNumEnd + 1, nEndPos - nNumEnd - 1); if (sSuffix == sEnd) diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index 03c051ebaeed..57b68a0de1d3 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -270,10 +270,8 @@ Sequence<beans::PropertyValue> SvxUnoNumberingRules::getNumberingRuleByIndex(sal void SvxUnoNumberingRules::setNumberingRuleByIndex(const Sequence<beans::PropertyValue >& rProperties, sal_Int32 nIndex) { SvxNumberFormat aFmt(maRule.GetLevel( static_cast<sal_uInt16>(nIndex) )); - const beans::PropertyValue* pPropArray = rProperties.getConstArray(); - for(int i = 0; i < rProperties.getLength(); i++) + for(const beans::PropertyValue& rProp : rProperties) { - const beans::PropertyValue& rProp = pPropArray[i]; const OUString& rPropName = rProp.Name; const Any& aVal = rProp.Value; |