summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextcursor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtextcursor.cpp')
-rw-r--r--src/gui/text/qtextcursor.cpp4
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;
}