diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-05-21 14:21:19 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-22 09:17:34 +0200 |
commit | a40e0f6c7a0df00da79d57509aae0b798705244c (patch) | |
tree | e03004f90cdff64fe47aa6e4e16317c8e571360a /src | |
parent | 9428481bca7fdf4200d49b0050293c8cdb8b72c4 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 1694dd58f2..637fab42de 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2231,7 +2231,7 @@ void QTextEngine::addRequiredBoundaries() const bool QTextEngine::atWordSeparator(int position) const { const QChar c = layoutData->string.at(position); - switch (c.toLatin1()) { + switch (c.unicode()) { case '.': case ',': case '?': @@ -2264,19 +2264,24 @@ bool QTextEngine::atWordSeparator(int position) const case '|': return true; default: - return false; + break; } + return false; } bool QTextEngine::atSpace(int position) const { const QChar c = layoutData->string.at(position); - - return c == QLatin1Char(' ') - || c == QChar::Nbsp - || c == QChar::LineSeparator - || c == QLatin1Char('\t') - ; + switch (c.unicode()) { + case QChar::Tabulation: + case QChar::Space: + case QChar::Nbsp: + 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); } -static bool isRetainableControlCode(const QChar &c) +static inline bool isRetainableControlCode(QChar c) { return (c.unicode() == 0x202a // LRE || c.unicode() == 0x202b // LRE |