diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-07-01 19:24:01 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-07-01 19:24:01 +0200 |
commit | 745ecfd8925716d962c97a4415881377faf6bdd5 (patch) | |
tree | c4f78b3bd143af52372064cd3ba5c0ae440813c5 /src/corelib/tools/qstring.cpp | |
parent | bda164303570629e44185e8baa52908ced6da301 (diff) | |
parent | 8968c79c575755cdb52d5e615ed19e4529047464 (diff) | |
download | qt4-tools-745ecfd8925716d962c97a4415881377faf6bdd5.tar.gz |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
bin/syncqt
src/gui/text/qtextlayout.cpp
tools/assistant/tools/assistant/helpviewer_qwv.cpp
tools/assistant/tools/assistant/helpviewer_qwv.h
tools/configure/configureapp.cpp
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index c8d641acc6..07240bea4d 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -4793,6 +4793,10 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1, CFRelease(thisString); CFRelease(otherString); return result; +#elif defined(Q_OS_SYMBIAN) + TPtrC p1 = TPtrC16(reinterpret_cast<const TUint16 *>(data1), length1); + TPtrC p2 = TPtrC16(reinterpret_cast<const TUint16 *>(data2), length2); + return p1.CompareC(p2); #elif defined(Q_OS_UNIX) // declared in <string.h> int delta = strcoll(toLocal8Bit_helper(data1, length1), toLocal8Bit_helper(data2, length2)); @@ -6941,20 +6945,23 @@ void QString::updateProperties() const p++; } - p = d->data; - d->righttoleft = false; + d->righttoleft = isRightToLeft(); + d->clean = true; +} + +bool QString::isRightToLeft() const +{ + ushort *p = d->data; + const ushort * const end = p + d->size; + bool righttoleft = false; while (p < end) { switch(QChar::direction(*p)) { case QChar::DirL: - case QChar::DirLRO: - case QChar::DirLRE: goto end; case QChar::DirR: case QChar::DirAL: - case QChar::DirRLO: - case QChar::DirRLE: - d->righttoleft = true; + righttoleft = true; goto end; default: break; @@ -6962,8 +6969,7 @@ void QString::updateProperties() const ++p; } end: - d->clean = true; - return; + return righttoleft; } /*! \fn bool QString::isSimpleText() const |