summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-12-13 15:37:45 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-12-14 12:21:03 -0500
commitc2e6be18f38240106a3811445d993d35be12a790 (patch)
tree34766e51eaea42c03ba3172b1d9c12b505ce536a
parent6a28e8397ae7a913dc7af1d2bcb3590ce975c1ac (diff)
We need to reset i to 0 after parsing spaces.
-rw-r--r--sc/source/core/tool/stringutil.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 136b0beff..dbd930620 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -74,7 +74,13 @@ bool ScStringUtil::parseSimpleNumber(
break;
}
- for (; i < n; ++i, ++p)
+ if (i == n)
+ // the whole string is space. Fail.
+ return false;
+
+ n -= i; // Subtract the length of preceding space.
+
+ for (sal_Int32 i = 0; i < n; ++i, ++p)
{
sal_Unicode c = *p;
if (c == 0x00A0)