diff options
Diffstat (limited to 'linden/indra/llui/lltexteditor.cpp')
-rw-r--r-- | linden/indra/llui/lltexteditor.cpp | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index ca9ea0a..9061ca3 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -4439,6 +4439,12 @@ void LLTextEditor::resetPreedit() | |||
4439 | { | 4439 | { |
4440 | if (hasPreeditString()) | 4440 | if (hasPreeditString()) |
4441 | { | 4441 | { |
4442 | if (hasSelection()) | ||
4443 | { | ||
4444 | llwarns << "Preedit and selection!" << llendl; | ||
4445 | deselect(); | ||
4446 | } | ||
4447 | |||
4442 | mCursorPos = mPreeditPositions.front(); | 4448 | mCursorPos = mPreeditPositions.front(); |
4443 | removeStringNoUndo(mCursorPos, mPreeditPositions.back() - mCursorPos); | 4449 | removeStringNoUndo(mCursorPos, mPreeditPositions.back() - mCursorPos); |
4444 | insertStringNoUndo(mCursorPos, mPreeditOverwrittenWString); | 4450 | insertStringNoUndo(mCursorPos, mPreeditOverwrittenWString); |
@@ -4447,9 +4453,10 @@ void LLTextEditor::resetPreedit() | |||
4447 | mPreeditOverwrittenWString.clear(); | 4453 | mPreeditOverwrittenWString.clear(); |
4448 | mPreeditPositions.clear(); | 4454 | mPreeditPositions.clear(); |
4449 | 4455 | ||
4450 | updateLineStartList(); | 4456 | // A call to updatePreedit should soon follow under a |
4451 | setCursorPos(mCursorPos); | 4457 | // normal course of operation, so we don't need to |
4452 | // updateScrollFromCursor(); | 4458 | // maintain internal variables such as line start |
4459 | // positions now. | ||
4453 | } | 4460 | } |
4454 | } | 4461 | } |
4455 | 4462 | ||
@@ -4462,28 +4469,9 @@ void LLTextEditor::updatePreedit(const LLWString &preedit_string, | |||
4462 | return; | 4469 | return; |
4463 | } | 4470 | } |
4464 | 4471 | ||
4465 | if (hasSelection()) | ||
4466 | { | ||
4467 | if (hasPreeditString()) | ||
4468 | { | ||
4469 | llwarns << "Preedit and selection!" << llendl; | ||
4470 | deselect(); | ||
4471 | } | ||
4472 | else | ||
4473 | { | ||
4474 | deleteSelection(TRUE); | ||
4475 | } | ||
4476 | } | ||
4477 | |||
4478 | getWindow()->hideCursorUntilMouseMove(); | 4472 | getWindow()->hideCursorUntilMouseMove(); |
4479 | 4473 | ||
4480 | S32 insert_preedit_at = mCursorPos; | 4474 | S32 insert_preedit_at = mCursorPos; |
4481 | if (hasPreeditString()) | ||
4482 | { | ||
4483 | insert_preedit_at = mPreeditPositions.front(); | ||
4484 | removeStringNoUndo(insert_preedit_at, mPreeditPositions.back() - insert_preedit_at); | ||
4485 | insertStringNoUndo(insert_preedit_at, mPreeditOverwrittenWString); | ||
4486 | } | ||
4487 | 4475 | ||
4488 | mPreeditWString = preedit_string; | 4476 | mPreeditWString = preedit_string; |
4489 | mPreeditPositions.resize(preedit_segment_lengths.size() + 1); | 4477 | mPreeditPositions.resize(preedit_segment_lengths.size() + 1); |