diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-03 11:12:07 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-03 11:12:07 (GMT) |
commit | 49c4c8372cd6bf194c1a36029844eefe94393da0 (patch) | |
tree | 77975968f0b89983ec1fd60910df5147fc27b485 /src/corelib/tools/qstring.cpp | |
parent | a8829a52d65a9759d5dffe98fb07b384c54db1c8 (diff) | |
parent | 1d87017c4681c9d5da14d613b5b84d25620642fe (diff) | |
download | Qt-49c4c8372cd6bf194c1a36029844eefe94393da0.zip Qt-49c4c8372cd6bf194c1a36029844eefe94393da0.tar.gz Qt-49c4c8372cd6bf194c1a36029844eefe94393da0.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fix compilation: disable -no-feature-* for bootstrapped
QString: Fix severals bugs when comparing with QStringRef
QProgressBar: make accessors const.
Changes: add patch for artificial emboldening
Added static version of QGLFramebufferObject::release().
Fix compilation on WinXP MinGW32;
Add a new qconfig feature GESTURES
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index a0dbb8e..1172a7b 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -113,7 +113,7 @@ int qFindStringBoyerMoore(const QChar *haystack, int haystackLen, int from, static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const ushort *be) { if (a == b) - return 0; + return (ae - be); if (a == 0) return 1; if (b == 0) @@ -125,7 +125,7 @@ static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const u uint alast = 0; uint blast = 0; - while (a != e) { + while (a < e) { // qDebug() << hex << alast << blast; // qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast); // qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast); @@ -154,7 +154,7 @@ static int ucstricmp(const ushort *a, const ushort *ae, const uchar *b) if (b == 0) return -1; - while (a != ae && *b) { + while (a < ae && *b) { int diff = foldCase(*a) - foldCase(*b); if ((diff)) return diff; @@ -4640,9 +4640,12 @@ int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2, return length1; if (cs == Qt::CaseSensitive) { - while (uc != e && *c && *uc == *c) + while (uc < e && *c && *uc == *c) uc++, c++; + if (uc == e) + return -*c; + return *uc - *c; } else { return ucstricmp(uc, e, c); |