diff options
author | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2011-09-07 11:58:54 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-12 16:03:47 +0200 |
commit | 560e68e2bd470e2f4d4353b4100729f15efc666f (patch) | |
tree | 5947d87316a1bc893dcf6023ab231a1e862d149b /src/gui/text/qtextcursor.cpp | |
parent | 338244e9bfd4d0b8b3bec4b4c1620de71e1d5a7a (diff) | |
download | qtbase-560e68e2bd470e2f4d4353b4100729f15efc666f.tar.gz |
Replace explicit surrogate handlers by inline methods of QChar class
Merge-request: 1284
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
(cherry picked from commit 50af55095afe1ba048dde357b771485ef2188778)
Change-Id: I0b1967145ad62243afc2060a6ae4ca141a9609fd
Reviewed-on: http://codereview.qt-project.org/4587
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/gui/text/qtextcursor.cpp')
-rw-r--r-- | src/gui/text/qtextcursor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index 8bbe86c4f3..2bebf4c861 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -1511,11 +1511,11 @@ void QTextCursor::deletePreviousChar() const QTextFragmentData * const frag = fragIt.value(); int fpos = fragIt.position(); QChar uc = d->priv->buffer().at(d->anchor - fpos + frag->stringPosition); - if (d->anchor > fpos && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) { + if (d->anchor > fpos && uc.isLowSurrogate()) { // second half of a surrogate, check if we have the first half as well, // if yes delete both at once uc = d->priv->buffer().at(d->anchor - 1 - fpos + frag->stringPosition); - if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00) + if (uc.isHighSurrogate()) --d->anchor; } |