summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-06-18 13:53:04 +0200
committerEike Rathke <erack@redhat.com>2018-06-18 23:17:15 +0200
commitd0d0beb5f515ca6f6b777e0e64575e4e7f4626dc (patch)
tree50889daa33beaeee911e4f1662434bd8c882b82c /sal
parentb422d6598fdba05d3a47be0809afbb85516f3c54 (diff)
Resolves: tdf#118073 one leading 0 is significant for 0.
Regression from commit 9a6527a98fb968b3fe6bc293ff7520a9480d43d0 CommitDate: Mon Jun 27 21:57:52 2016 +0200 stringToDouble() do not parse separator without digit as 0.0 Change-Id: I9d90aedc324ef0938297224297d89817e3fd1e90 Reviewed-on: https://gerrit.libreoffice.org/56028 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 5c0783cecb0b141885a25ca26220614ad3125f8e) Reviewed-on: https://gerrit.libreoffice.org/56043
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/math.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx
index eef48b57e74e..7b172f1ee1d2 100644
--- a/sal/rtl/math.cxx
+++ b/sal/rtl/math.cxx
@@ -817,7 +817,7 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd,
++p;
}
- CharT const * pFirstSignificant = p;
+ CharT const * pFirstSignificant = ((p > pBegin && *(p-1) == CharT('0')) ? p-1 : p);
long nValExp = 0; // carry along exponent of mantissa
// integer part of mantissa