diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-12-13 15:37:45 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-12-13 15:37:45 -0500 |
commit | e40cd672c6541bc9069a3ac8da90c918bddbeb96 (patch) | |
tree | 12bf5cb30ad95e2c9f3918f4fde605365e13ca9a /sc/source/core/tool/stringutil.cxx | |
parent | 933cb2a05aa9d78323f748af8a8883a1e9d5a2d1 (diff) |
We need to reset i to 0 after parsing spaces.
Diffstat (limited to 'sc/source/core/tool/stringutil.cxx')
-rw-r--r-- | sc/source/core/tool/stringutil.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx index cb550585b081..dd136ef693b1 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) |