diff options
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r-- | indra/llui/lltexteditor.cpp | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index c76576895c..0b6f5d75cc 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -4335,6 +4335,12 @@ void LLTextEditor::resetPreedit() { if (hasPreeditString()) { + if (hasSelection()) + { + llwarns << "Preedit and selection!" << llendl; + deselect(); + } + mCursorPos = mPreeditPositions.front(); removeStringNoUndo(mCursorPos, mPreeditPositions.back() - mCursorPos); insertStringNoUndo(mCursorPos, mPreeditOverwrittenWString); @@ -4343,9 +4349,10 @@ void LLTextEditor::resetPreedit() mPreeditOverwrittenWString.clear(); mPreeditPositions.clear(); - updateLineStartList(); - setCursorPos(mCursorPos); - // updateScrollFromCursor(); + // A call to updatePreedit should soon follow under a + // normal course of operation, so we don't need to + // maintain internal variables such as line start + // positions now. } } @@ -4358,28 +4365,9 @@ void LLTextEditor::updatePreedit(const LLWString &preedit_string, return; } - if (hasSelection()) - { - if (hasPreeditString()) - { - llwarns << "Preedit and selection!" << llendl; - deselect(); - } - else - { - deleteSelection(TRUE); - } - } - getWindow()->hideCursorUntilMouseMove(); S32 insert_preedit_at = mCursorPos; - if (hasPreeditString()) - { - insert_preedit_at = mPreeditPositions.front(); - removeStringNoUndo(insert_preedit_at, mPreeditPositions.back() - insert_preedit_at); - insertStringNoUndo(insert_preedit_at, mPreeditOverwrittenWString); - } mPreeditWString = preedit_string; mPreeditPositions.resize(preedit_segment_lengths.size() + 1); |