summaryrefslogtreecommitdiff
path: root/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-02-28 01:12:38 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-02-28 01:12:38 +0000
commit42bc4ba02abebced9fc3e7f91317ae293cbd20dd (patch)
tree133688c2ed85f8efcc717b37d0f276d4ea761c0b /indra/llui/lllineeditor.cpp
parent6d52efe452aa8469e0343da1c7d108f3f52ab651 (diff)
merge Branch_1-19-0-Viewer -r 80279 : 80947 -> release
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r--indra/llui/lllineeditor.cpp36
1 files changed, 12 insertions, 24 deletions
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);