From 42bc4ba02abebced9fc3e7f91317ae293cbd20dd Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 28 Feb 2008 01:12:38 +0000 Subject: merge Branch_1-19-0-Viewer -r 80279 : 80947 -> release --- indra/llui/lllineeditor.cpp | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'indra/llui/lllineeditor.cpp') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 391b28a21f..6d5e589b04 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -2317,6 +2317,12 @@ void LLLineEditor::resetPreedit() { if (hasPreeditString()) { + if (hasSelection()) + { + llwarns << "Preedit and selection!" << llendl; + deselect(); + } + const S32 preedit_pos = mPreeditPositions.front(); mText.erase(preedit_pos, mPreeditPositions.back() - preedit_pos); mText.insert(preedit_pos, mPreeditOverwrittenWString); @@ -2326,11 +2332,10 @@ void LLLineEditor::resetPreedit() mPreeditOverwrittenWString.clear(); mPreeditPositions.clear(); - mKeystrokeTimer.reset(); - if (mKeystrokeCallback) - { - mKeystrokeCallback(this, mCallbackUserData); - } + // Don't reset key stroke timer nor invoke keystroke callback, + // because a call to updatePreedit should be follow soon in + // normal course of operation, and timer and callback will be + // maintained there. Doing so here made an odd sound. (VWR-3410) } } @@ -2343,27 +2348,10 @@ void LLLineEditor::updatePreedit(const LLWString &preedit_string, return; } - if (hasSelection()) - { - if (hasPreeditString()) - { - llwarns << "Preedit and selection!" << llendl; - deselect(); - } - else - { - deleteSelection(); - } - } + // Note that call to updatePreedit is always preceeded by resetPreedit, + // so we have no existing selection/preedit. S32 insert_preedit_at = getCursor(); - if (hasPreeditString()) - { - insert_preedit_at = mPreeditPositions.front(); - //mText.replace(insert_preedit_at, mPreeditPositions.back() - insert_preedit_at, mPreeditOverwrittenWString); - mText.erase(insert_preedit_at, mPreeditPositions.back() - insert_preedit_at); - mText.insert(insert_preedit_at, mPreeditOverwrittenWString); - } mPreeditWString = preedit_string; mPreeditPositions.resize(preedit_segment_lengths.size() + 1); -- cgit v1.2.3