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>2018-01-25 19:29:50 +0100
commit28265db967d90680c1fd754bb746751b849373b3 (patch)
tree8bd4c52cccab62d0b8f349c207a30ac6c8927e3e /svl
parent378d7d68d9e842039bcf797a8b95c2e85768e1e7 (diff)
Add to nPos once instead of in each iteration
(cherry picked from commit d728492f4aa195fd4aec3ddb116879de76a95c6d) Change-Id: I9ab9d5be1edead3a83375d87910bc9128c894b85 Reviewed-on: https://gerrit.libreoffice.org/48302 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
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 cd09a444c81f..74a765238518 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -2412,19 +2412,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 < nAnzStrings &&
sStrArray[i][0] == '0')
{
rStr += sStrArray[i];
- nPos = nPos + sStrArray[i].getLength();
nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
nAnzResStrings--;
nCounter++;
i++;
}
+ nPos += rStr.getLength();
}
else
{
@@ -2562,19 +2561,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 < nAnzStrings &&
sStrArray[i][0] == '0')
{
rStr += sStrArray[i];
- nPos = nPos + sStrArray[i].getLength();
nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
nAnzResStrings--;
nCounter++;
i++;
}
+ nPos += rStr.getLength();
}
else
{