summaryrefslogtreecommitdiff
path: root/i18npool/source/transliteration/transliterationImpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool/source/transliteration/transliterationImpl.cxx')
-rw-r--r--i18npool/source/transliteration/transliterationImpl.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx
index b9e4445d63f5..20d22f0bb199 100644
--- a/i18npool/source/transliteration/transliterationImpl.cxx
+++ b/i18npool/source/transliteration/transliterationImpl.cxx
@@ -326,9 +326,17 @@ TransliterationImpl::transliterate( const OUString& inStr, sal_Int32 startPos, s
nCount = tmpStr.getLength();
+ assert(off[from].getLength() == nCount);
tmp = from; from = to; to = tmp;
+ // 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());
+ sal_Int32 *const pTo(off[to].getArray());
for (sal_Int32 j = 0; j < nCount; j++)
- off[to][j] = off[from][off[to][j]];
+ {
+ assert(pTo[j] < off[from].getLength());
+ pTo[j] = pFrom[pTo[j]];
+ }
}
offset = off[to];
return tmpStr;