summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-23 13:29:32 +0200
committerNoel Grandin <noel@peralex.com>2013-11-04 08:06:10 +0200
commit0e6a2601b39cbadaff7f7506ba9e804f108060db (patch)
treeffd6bb4970f689d20087b721eb8dfd4bc86cd53f /linguistic
parent457b349edbaf6d9dc747f3a631fee70e0c035bae (diff)
Convert code that calls OUString::getStr()[] to use the [] operator
This also means that this code now gets bounds checked in debug builds. Change-Id: Id777f85eaee6a737bbcb84625e6e110abe0e0f27
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/hhconvdic.cxx2
-rw-r--r--linguistic/source/misc.cxx8
2 files changed, 5 insertions, 5 deletions
diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx
index 7616f64d6e23..c26353fb2f55 100644
--- a/linguistic/source/hhconvdic.cxx
+++ b/linguistic/source/hhconvdic.cxx
@@ -76,7 +76,7 @@ sal_Bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType )
sal_Bool bIsAll = sal_True;
for (sal_Int32 i = 0; i < rTxt.getLength() && bIsAll; ++i)
{
- if (checkScriptType( rTxt.getStr()[i]) != nScriptType)
+ if (checkScriptType( rTxt[i]) != nScriptType)
bIsAll = sal_False;
}
return bIsAll;
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 1a7f61763db9..d979d531969e 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -178,8 +178,8 @@ sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 )
{
for (k = 1; k <= nLen2; ++k)
{
- sal_Unicode c1i = rTxt1.getStr()[i - 1];
- sal_Unicode c2k = rTxt2.getStr()[k - 1];
+ sal_Unicode c1i = rTxt1[i - 1];
+ sal_Unicode c2k = rTxt2[k - 1];
sal_Int32 nCost = c1i == c2k ? 0 : 1;
sal_Int32 nNew = Minimum( aData.Value(i-1, k ) + 1,
aData.Value(i , k-1) + 1,
@@ -188,9 +188,9 @@ sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 )
if (2 < i && 2 < k)
{
int nT = aData.Value(i-2, k-2) + 1;
- if (rTxt1.getStr()[i - 2] != c1i)
+ if (rTxt1[i - 2] != c1i)
++nT;
- if (rTxt2.getStr()[k - 2] != c2k)
+ if (rTxt2[k - 2] != c2k)
++nT;
if (nT < nNew)
nNew = nT;