[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Mon Dec 13 12:38:19 PST 2010
sc/source/core/tool/stringutil.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 6946249e5af0c17b9d2dcbb3c96ba9306f7131df
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Dec 13 15:37:45 2010 -0500
We need to reset i to 0 after parsing spaces.
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 136b0be..dbd9306 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)
More information about the Libreoffice-commits
mailing list