diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lllineeditor.cpp | 36 | ||||
-rw-r--r-- | indra/llui/llpanel.cpp | 8 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 32 |
3 files changed, 28 insertions, 48 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); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 4c16683704..cb732a17c6 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -212,10 +212,16 @@ void LLPanel::draw() } updateDefaultBtn(); + + LLView::draw(); } void LLPanel::updateDefaultBtn() { + // This method does not call LLView::draw() so callers will need + // to take care of that themselves at the appropriate place in + // their rendering sequence + if( mDefaultBtn) { if (gFocusMgr.childHasKeyboardFocus( this ) && mDefaultBtn->getEnabled()) @@ -230,8 +236,6 @@ void LLPanel::updateDefaultBtn() mDefaultBtn->setBorderEnabled(FALSE); } } - - LLView::draw(); } void LLPanel::refresh() 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); |