[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:59:47 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 0831f0c7d69f5736b7566c7eceae4b6d01111bd6
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Mar 31 15:33:13 2002 +0000
* src/kwq/KWQString.mm: (QString::toDouble): Fix to properly handle
an empty string.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 71ae462..2b6c174 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,8 @@
+2002-03-31 Darin Adler <darin at apple.com>
+
+ * src/kwq/KWQString.mm: (QString::toDouble): Fix to properly handle
+ an empty string.
+
2002-03-30 Darin Adler <darin at apple.com>
* src/kdelibs/khtml/xml/dom_docimpl.cpp: (DocumentImpl::setTitle):
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 71ae462..2b6c174 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,8 @@
+2002-03-31 Darin Adler <darin at apple.com>
+
+ * src/kwq/KWQString.mm: (QString::toDouble): Fix to properly handle
+ an empty string.
+
2002-03-30 Darin Adler <darin at apple.com>
* src/kdelibs/khtml/xml/dom_docimpl.cpp: (DocumentImpl::setTitle):
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 71ae462..2b6c174 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,8 @@
+2002-03-31 Darin Adler <darin at apple.com>
+
+ * src/kwq/KWQString.mm: (QString::toDouble): Fix to properly handle
+ an empty string.
+
2002-03-30 Darin Adler <darin at apple.com>
* src/kdelibs/khtml/xml/dom_docimpl.cpp: (DocumentImpl::setTitle):
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index 406afc8..35cae9d 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -614,11 +614,7 @@ ulong QString::toULong(bool *ok, int base) const
double QString::toDouble(bool *ok) const
{
double n;
- if (s) {
- n = CFStringGetDoubleValue(s);
- } else {
- n = 0.0;
- }
+ n = CFStringGetDoubleValue(s);
if (ok) {
// NOTE: since CFStringGetDoubleValue returns 0.0 on error there is no
// way to know if "n" is valid in that case
@@ -626,10 +622,12 @@ double QString::toDouble(bool *ok) const
// EXTRA NOTE: We can't assume 0.0 is bad, since it totally breaks
// html like border="0". So, only trigger breakage if the char
// at index 0 is neither a '0' nor a '.' nor a '-'.
- UniChar uc = CFStringGetCharacterAtIndex(s,0);
*ok = true;
- if (n == 0.0 && uc != '0' && uc != '.' && uc != '-') {
- *ok = false;
+ if (n == 0.0) {
+ UniChar uc = CFStringGetLength(s) == 0 ? 0 : CFStringGetCharacterAtIndex(s, 0);
+ if (uc != '0' && uc != '.' && uc != '-') {
+ *ok = false;
+ }
}
}
return n;
diff --git a/WebCore/src/kwq/KWQString.mm b/WebCore/src/kwq/KWQString.mm
index 406afc8..35cae9d 100644
--- a/WebCore/src/kwq/KWQString.mm
+++ b/WebCore/src/kwq/KWQString.mm
@@ -614,11 +614,7 @@ ulong QString::toULong(bool *ok, int base) const
double QString::toDouble(bool *ok) const
{
double n;
- if (s) {
- n = CFStringGetDoubleValue(s);
- } else {
- n = 0.0;
- }
+ n = CFStringGetDoubleValue(s);
if (ok) {
// NOTE: since CFStringGetDoubleValue returns 0.0 on error there is no
// way to know if "n" is valid in that case
@@ -626,10 +622,12 @@ double QString::toDouble(bool *ok) const
// EXTRA NOTE: We can't assume 0.0 is bad, since it totally breaks
// html like border="0". So, only trigger breakage if the char
// at index 0 is neither a '0' nor a '.' nor a '-'.
- UniChar uc = CFStringGetCharacterAtIndex(s,0);
*ok = true;
- if (n == 0.0 && uc != '0' && uc != '.' && uc != '-') {
- *ok = false;
+ if (n == 0.0) {
+ UniChar uc = CFStringGetLength(s) == 0 ? 0 : CFStringGetCharacterAtIndex(s, 0);
+ if (uc != '0' && uc != '.' && uc != '-') {
+ *ok = false;
+ }
}
}
return n;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list