From 705230a26ed4c33af2d3af07c160386ded740079 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 22 Oct 2024 13:21:50 +0800 Subject: Revert "IME composition is now replaced by the result" This reverts commit 60592ae0d7a98e071e516fcac70c5bf1427f20be. --- indra/llui/lllineeditor.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'indra/llui/lllineeditor.cpp') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index ac7948f735..87b0c74916 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1031,7 +1031,7 @@ void LLLineEditor::addChar(const llwchar uni_char) getWindow()->hideCursorUntilMouseMove(); } -void LLLineEditor::addString(char *s, bool editing) +void LLLineEditor::addString(char *s) { if (hasSelection()) deleteSelection(); @@ -1040,13 +1040,9 @@ void LLLineEditor::addString(char *s, bool editing) .substr(getCursor(), 1))) return; mText.erase(getCursor(), 1); - } else if (editing) { - mText.clear(); - setCursor(0); } mText.insert(getCursor(), utf8str_to_wstring(s)); - if (editing) setCursor(strlen(s)); - else setCursor(getCursor() + 1); + setCursor(getCursor() + 1); getWindow()->hideCursorUntilMouseMove(); } @@ -1704,7 +1700,7 @@ bool LLLineEditor::handleUnicodeCharHere(llwchar uni_char) return handled; } -bool LLLineEditor::handleUnicodeStringHere(char *uni_str, bool editing) +bool LLLineEditor::handleUnicodeStringHere(char *uni_str) { auto handled = FALSE; @@ -1713,7 +1709,7 @@ bool LLLineEditor::handleUnicodeStringHere(char *uni_str, bool editing) handled = TRUE; LLLineEditorRollback rollback(this); - addString(uni_str, editing); + addString(uni_str); mKeystrokeTimer.reset(); deselect(); -- cgit v1.2.3 From 35ee215d68c891bcbf3fd64709f000c0a8e7f597 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 22 Oct 2024 13:42:22 +0800 Subject: Revert "First attempt to fix unicode input" This reverts commit aaa8cb5a37a720ff67792d0a31fec793b03b3742. --- indra/llui/lllineeditor.cpp | 45 --------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'indra/llui/lllineeditor.cpp') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 87b0c74916..60b6115b34 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1031,21 +1031,6 @@ void LLLineEditor::addChar(const llwchar uni_char) getWindow()->hideCursorUntilMouseMove(); } -void LLLineEditor::addString(char *s) -{ - if (hasSelection()) - deleteSelection(); - else if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode()) { - if (!prevalidateInput(mText.getWString() - .substr(getCursor(), 1))) - return; - mText.erase(getCursor(), 1); - } - mText.insert(getCursor(), utf8str_to_wstring(s)); - setCursor(getCursor() + 1); - getWindow()->hideCursorUntilMouseMove(); -} - // Extends the selection box to the new cursor position void LLLineEditor::extendSelection( S32 new_cursor_pos ) { @@ -1700,36 +1685,6 @@ bool LLLineEditor::handleUnicodeCharHere(llwchar uni_char) return handled; } -bool LLLineEditor::handleUnicodeStringHere(char *uni_str) -{ - auto handled = FALSE; - - if ((gFocusMgr.getKeyboardFocus() == this) - && getVisible() && !mReadOnly) { - handled = TRUE; - LLLineEditorRollback rollback(this); - - addString(uni_str); - - mKeystrokeTimer.reset(); - deselect(); - auto need_to_rollback = mPrevalidator - && !mPrevalidator.validate(mText.getWString()); - - if (need_to_rollback) { - rollback.doRollback(this); - LLUI::getInstance()->reportBadKeystroke(); - mPrevalidator.showLastErrorUsingTimeout(); - } - - if (!need_to_rollback && handled) { - onKeystroke(); - mSpellCheckTimer.setTimerExpirySec(SPELLCHECK_DELAY); - } - } - - return handled; -} bool LLLineEditor::canDoDelete() const { -- cgit v1.2.3