summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-10-17 12:34:35 +0200
committerEike Rathke <erack@redhat.com>2017-10-17 12:35:09 +0200
commitd728492f4aa195fd4aec3ddb116879de76a95c6d (patch)
tree2943c43ecac3ede545d446a881bebbfd664aca9b /svl
parentd1538ef63863f7a016bd2c3752ccdd9819e41781 (diff)
Add to nPos once instead of in each iteration
Change-Id: I9ab9d5be1edead3a83375d87910bc9128c894b85
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforscan.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 5855f8928220..79212d271461 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -2411,19 +2411,18 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
bDecSep = true;
nTypeArray[i] = NF_SYMBOLTYPE_DIGIT;
OUString& rStr = sStrArray[i];
- nPos = nPos + sStrArray[i].getLength();
nCounter++;
i++;
while (i < nStringsCnt &&
sStrArray[i][0] == '0')
{
rStr += sStrArray[i];
- nPos = nPos + sStrArray[i].getLength();
nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
nResultStringsCnt--;
nCounter++;
i++;
}
+ nPos += rStr.getLength();
}
else
{
@@ -2561,19 +2560,18 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
bDecSep = true;
nTypeArray[i] = NF_SYMBOLTYPE_DIGIT;
OUString& rStr = sStrArray[i];
- nPos = nPos + sStrArray[i].getLength();
- i++;
nCounter++;
+ i++;
while (i < nStringsCnt &&
sStrArray[i][0] == '0')
{
rStr += sStrArray[i];
- nPos = nPos + sStrArray[i].getLength();
nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
nResultStringsCnt--;
nCounter++;
i++;
}
+ nPos += rStr.getLength();
}
else
{