summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-10 16:12:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-11 12:50:55 +0200
commit20571c472528c4f98fe3f55700d134915d32a49a (patch)
tree9b350824d845b8aaeb13d087ef74febb454b821b /i18npool
parentb401896a56149aa2871b65a330a6f601a9830ccd (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 'i18npool')
-rw-r--r--i18npool/source/transliteration/transliterationImpl.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx
index 7b5478186671..cadc35d1504c 100644
--- a/i18npool/source/transliteration/transliterationImpl.cxx
+++ b/i18npool/source/transliteration/transliterationImpl.cxx
@@ -304,10 +304,8 @@ TransliterationImpl::transliterate( const OUString& inStr, sal_Int32 startPos, s
tmpStr = bodyCascade[0]->transliterate(tmpStr, 0, nCount, offset);
if ( startPos )
{
- sal_Int32 * pArr = offset.getArray();
- nCount = offset.getLength();
- for (sal_Int32 j = 0; j < nCount; j++)
- pArr[j] += startPos;
+ for (sal_Int32 & j : offset)
+ j += startPos;
}
return tmpStr;
}
@@ -319,7 +317,7 @@ TransliterationImpl::transliterate( const OUString& inStr, sal_Int32 startPos, s
for (sal_Int32 j = 0; j < nCount; j++)
pArr[j] = startPos + j;
- sal_Int16 from = 0, to = 1, tmp;
+ sal_Int16 from = 0, to = 1;
Sequence<sal_Int32> off[2];
off[to] = offset;
@@ -330,7 +328,7 @@ TransliterationImpl::transliterate( const OUString& inStr, sal_Int32 startPos, s
nCount = tmpStr.getLength();
assert(off[from].getLength() == nCount);
- tmp = from; from = to; to = tmp;
+ std::swap(from, to);
// tdf#89665: don't use operator[] to write - too slow!
// interestingly gcc 4.9 -Os won't even inline the const operator[]
sal_Int32 const*const pFrom(off[from].getConstArray());
@@ -366,10 +364,8 @@ TransliterationImpl::folding( const OUString& inStr, sal_Int32 startPos, sal_Int
tmpStr = bodyCascade[0]->folding(tmpStr, 0, nCount, offset);
if ( startPos )
{
- sal_Int32 * pArr = offset.getArray();
- nCount = offset.getLength();
- for (sal_Int32 j = 0; j < nCount; j++)
- pArr[j] += startPos;
+ for (sal_Int32 & j : offset)
+ j += startPos;
}
return tmpStr;
}