aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/lllineeditor.cpp')
-rw-r--r--linden/indra/llui/lllineeditor.cpp36
1 files changed, 12 insertions, 24 deletions
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp
index 88c8d75..b091bb7 100644
--- a/linden/indra/llui/lllineeditor.cpp
+++ b/linden/indra/llui/lllineeditor.cpp
@@ -2418,6 +2418,12 @@ void LLLineEditor::resetPreedit()
2418{ 2418{
2419 if (hasPreeditString()) 2419 if (hasPreeditString())
2420 { 2420 {
2421 if (hasSelection())
2422 {
2423 llwarns << "Preedit and selection!" << llendl;
2424 deselect();
2425 }
2426
2421 const S32 preedit_pos = mPreeditPositions.front(); 2427 const S32 preedit_pos = mPreeditPositions.front();
2422 mText.erase(preedit_pos, mPreeditPositions.back() - preedit_pos); 2428 mText.erase(preedit_pos, mPreeditPositions.back() - preedit_pos);
2423 mText.insert(preedit_pos, mPreeditOverwrittenWString); 2429 mText.insert(preedit_pos, mPreeditOverwrittenWString);
@@ -2427,11 +2433,10 @@ void LLLineEditor::resetPreedit()
2427 mPreeditOverwrittenWString.clear(); 2433 mPreeditOverwrittenWString.clear();
2428 mPreeditPositions.clear(); 2434 mPreeditPositions.clear();
2429 2435
2430 mKeystrokeTimer.reset(); 2436 // Don't reset key stroke timer nor invoke keystroke callback,
2431 if (mKeystrokeCallback) 2437 // because a call to updatePreedit should be follow soon in
2432 { 2438 // normal course of operation, and timer and callback will be
2433 mKeystrokeCallback(this, mCallbackUserData); 2439 // maintained there. Doing so here made an odd sound. (VWR-3410)
2434 }
2435 } 2440 }
2436} 2441}
2437 2442
@@ -2444,27 +2449,10 @@ void LLLineEditor::updatePreedit(const LLWString &preedit_string,
2444 return; 2449 return;
2445 } 2450 }
2446 2451
2447 if (hasSelection()) 2452 // Note that call to updatePreedit is always preceeded by resetPreedit,
2448 { 2453 // so we have no existing selection/preedit.
2449 if (hasPreeditString())
2450 {
2451 llwarns << "Preedit and selection!" << llendl;
2452 deselect();
2453 }
2454 else
2455 {
2456 deleteSelection();
2457 }
2458 }
2459 2454
2460 S32 insert_preedit_at = getCursor(); 2455 S32 insert_preedit_at = getCursor();
2461 if (hasPreeditString())
2462 {
2463 insert_preedit_at = mPreeditPositions.front();
2464 //mText.replace(insert_preedit_at, mPreeditPositions.back() - insert_preedit_at, mPreeditOverwrittenWString);
2465 mText.erase(insert_preedit_at, mPreeditPositions.back() - insert_preedit_at);
2466 mText.insert(insert_preedit_at, mPreeditOverwrittenWString);
2467 }
2468 2456
2469 mPreeditWString = preedit_string; 2457 mPreeditWString = preedit_string;
2470 mPreeditPositions.resize(preedit_segment_lengths.size() + 1); 2458 mPreeditPositions.resize(preedit_segment_lengths.size() + 1);