QTextEngine: minor clean-up

Change-Id: I7e21d5cf0130b412f8053b35abdd3420ed006c1c
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
This commit is contained in:
Konstantin Ritt 2012-05-21 14:21:19 +03:00 committed by Qt by Nokia
parent 9428481bca
commit a40e0f6c7a

View File

@ -2231,7 +2231,7 @@ void QTextEngine::addRequiredBoundaries() const
bool QTextEngine::atWordSeparator(int position) const bool QTextEngine::atWordSeparator(int position) const
{ {
const QChar c = layoutData->string.at(position); const QChar c = layoutData->string.at(position);
switch (c.toLatin1()) { switch (c.unicode()) {
case '.': case '.':
case ',': case ',':
case '?': case '?':
@ -2264,19 +2264,24 @@ bool QTextEngine::atWordSeparator(int position) const
case '|': case '|':
return true; return true;
default: default:
return false; break;
} }
return false;
} }
bool QTextEngine::atSpace(int position) const bool QTextEngine::atSpace(int position) const
{ {
const QChar c = layoutData->string.at(position); const QChar c = layoutData->string.at(position);
switch (c.unicode()) {
return c == QLatin1Char(' ') case QChar::Tabulation:
|| c == QChar::Nbsp case QChar::Space:
|| c == QChar::LineSeparator case QChar::Nbsp:
|| c == QLatin1Char('\t') case QChar::LineSeparator:
; return true;
default:
break;
}
return false;
} }
@ -2317,7 +2322,7 @@ static inline bool prevCharJoins(const QString &string, int pos)
return (joining == QChar::Dual || joining == QChar::Center); return (joining == QChar::Dual || joining == QChar::Center);
} }
static bool isRetainableControlCode(const QChar &c) static inline bool isRetainableControlCode(QChar c)
{ {
return (c.unicode() == 0x202a // LRE return (c.unicode() == 0x202a // LRE
|| c.unicode() == 0x202b // LRE || c.unicode() == 0x202b // LRE