summaryrefslogtreecommitdiffstats
path: root/src/widgets/tqlineedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/tqlineedit.cpp')
-rw-r--r--src/widgets/tqlineedit.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/widgets/tqlineedit.cpp b/src/widgets/tqlineedit.cpp
index 2267706d4..94cc54bc8 100644
--- a/src/widgets/tqlineedit.cpp
+++ b/src/widgets/tqlineedit.cpp
@@ -860,10 +860,18 @@ void TQLineEdit::backspace()
if ( d->hasSelectedText() ) {
d->removeSelectedText();
} else if ( d->cursor ) {
+ --d->cursor;
+ if ( d->maskData ) {
+ d->cursor = d->prevMaskBlank( d->cursor );
+ }
+ // second half of a surrogate, check if we have the first half as well,
+ // if yes delete both at once
+ if (d->cursor > 0 && d->text.at(d->cursor).isLowSurrogate() &&
+ d->text.at(d->cursor - 1).isHighSurrogate()) {
+ d->del(true);
--d->cursor;
- if ( d->maskData )
- d->cursor = d->prevMaskBlank( d->cursor );
- d->del( TRUE );
+ }
+ d->del(true);
}
d->finishChange( priorState );
}