summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qlinecontrol.cpp
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2011-09-07 09:58:54 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-09-07 09:58:54 (GMT)
commit50af55095afe1ba048dde357b771485ef2188778 (patch)
treec686d323fdcc1c2f9c64ca3cf6c02f072eb453ee /src/gui/widgets/qlinecontrol.cpp
parent0f9b98736ceedebece6c9cd4ce2e669300f882c7 (diff)
downloadQt-50af55095afe1ba048dde357b771485ef2188778.zip
Qt-50af55095afe1ba048dde357b771485ef2188778.tar.gz
Qt-50af55095afe1ba048dde357b771485ef2188778.tar.bz2
Replace explicit surrogate handlers by inline methods of QChar class
Merge-request: 1284 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/gui/widgets/qlinecontrol.cpp')
-rw-r--r--src/gui/widgets/qlinecontrol.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index b6e2f90..873630a 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -198,12 +198,10 @@ void QLineControl::backspace()
--m_cursor;
if (m_maskData)
m_cursor = prevMaskBlank(m_cursor);
- QChar uc = m_text.at(m_cursor);
- if (m_cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) {
+ if (m_cursor > 0 && m_text.at(m_cursor).isLowSurrogate()) {
// second half of a surrogate, check if we have the first half as well,
// if yes delete both at once
- uc = m_text.at(m_cursor - 1);
- if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00) {
+ if (m_text.at(m_cursor - 1).isHighSurrogate()) {
internalDelete(true);
--m_cursor;
}