[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svl/source
Eike Rathke
erack at redhat.com
Tue Oct 17 07:51:51 UTC 2017
svl/source/numbers/zforscan.cxx | 38 ++++++++++++++++----------------------
1 file changed, 16 insertions(+), 22 deletions(-)
New commits:
commit 35fcdb14e5d8af2f9770fc1994ad47b0774b9a55
Author: Eike Rathke <erack at redhat.com>
Date: Mon Oct 16 22:08:27 2017 +0200
Resolves: tdf#112933 correct number of one decimal in fraction of seconds
Regression from
commit 0ac1e2ad19d4fdb46dcf54f67db2df081f4675bb
Date: Wed Aug 2 09:39:43 2017 +0100
Resolves: ofz#2833 null deref
and similar for date+time
commit 42b894f80a6d0c39bb0f7092eb204a15c22c4f38
Date: Sat Aug 5 19:15:36 2017 +0100
ofz#2867 null deref
Effectively revert the code changes of those, leaving the test
case files intact, and "do the right thing" (switching two lines,
to
nPos = nPos + sStrArray[i].getLength();
i++;
nPos actually had always to be incremented by the length of the
*current* string position but was used after only as an error
position indicator, meaningless if there was no error.
(cherry picked from commit 4f72d2ec6c210232e0abd4965e215611e807c125)
Conflicts:
svl/source/numbers/zforscan.cxx
Backported.
Change-Id: I9bc4e5e56d70a275d26df0b72ed6a19e9297e0fa
Reviewed-on: https://gerrit.libreoffice.org/43440
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 5a5019d12e7c..b3fae53899e7 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -2408,21 +2408,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++;
- if (i < nAnzStrings)
+ while (i < nAnzStrings &&
+ sStrArray[i][0] == '0')
{
+ rStr += sStrArray[i];
nPos = nPos + sStrArray[i].getLength();
+ nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
nCounter++;
- while (i < nAnzStrings &&
- sStrArray[i][0] == '0')
- {
- rStr += sStrArray[i];
- nPos = nPos + sStrArray[i].getLength();
- nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
- nAnzResStrings--;
- nCounter++;
- i++;
- }
+ i++;
}
}
else
@@ -2561,21 +2558,18 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
bDecSep = true;
nTypeArray[i] = NF_SYMBOLTYPE_DIGIT;
OUString& rStr = sStrArray[i];
+ nPos = nPos + sStrArray[i].getLength();
i++;
- if (i < nAnzStrings)
+ nCounter++;
+ while (i < nAnzStrings &&
+ sStrArray[i][0] == '0')
{
+ rStr += sStrArray[i];
nPos = nPos + sStrArray[i].getLength();
+ nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
nCounter++;
- while (i < nAnzStrings &&
- sStrArray[i][0] == '0')
- {
- rStr += sStrArray[i];
- nPos = nPos + sStrArray[i].getLength();
- nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
- nAnzResStrings--;
- nCounter++;
- i++;
- }
+ i++;
}
}
else
More information about the Libreoffice-commits
mailing list