From 6fa6022a3f6d5bf71d97a59ec89929575f2ffd11 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:30 -0500 Subject: Second Life viewer sources 1.19.0.3 --- linden/indra/llwindow/llwindowmacosx.cpp | 18 +++++++++++------- linden/indra/llwindow/llwindowwin32.cpp | 13 +++++++++++-- 2 files changed, 22 insertions(+), 9 deletions(-) (limited to 'linden/indra/llwindow') diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp index f522abb..b458d7f 100644 --- a/linden/indra/llwindow/llwindowmacosx.cpp +++ b/linden/indra/llwindow/llwindowmacosx.cpp @@ -2099,15 +2099,17 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e } // Handle preedit string. - if (preedit_string.length() > 0) + if (preedit_string.length() == 0) { - if (preedit_segment_lengths.size() == 0) - { - preedit_segment_lengths.push_back(preedit_string.length()); - preedit_standouts.push_back(FALSE); - } - mPreeditor->updatePreedit(preedit_string, preedit_segment_lengths, preedit_standouts, caret_position); + preedit_segment_lengths.clear(); + preedit_standouts.clear(); + } + else if (preedit_segment_lengths.size() == 0) + { + preedit_segment_lengths.push_back(preedit_string.length()); + preedit_standouts.push_back(FALSE); } + mPreeditor->updatePreedit(preedit_string, preedit_segment_lengths, preedit_standouts, caret_position); result = noErr; } @@ -3354,6 +3356,8 @@ void LLWindowMacOSX::interruptLanguageTextInput() { FixTSMDocument(mTSMDocument); } + // Don't we need to call resetPreedit here? + // Well, if Apple's TSM document is correct, we don't. } #endif // LL_DARWIN diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index e9315c9..4ad044b 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp @@ -3703,6 +3703,10 @@ void LLWindowWin32::interruptLanguageTextInput() LLWinImm::notifyIME(himc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); LLWinImm::releaseContext(mWindowHandle, himc); } + + // Win32 document says there will be no composition string + // after NI_COMPOSITIONSTR returns. The following call to + // resetPreedit should be a NOP unless IME goes mad... mPreeditor->resetPreedit(); } } @@ -3846,7 +3850,12 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) } } - if (preedit_string.length() > 0) + if (preedit_string.length() == 0) + { + preedit_segment_lengths.clear(); + preedit_standouts.clear(); + } + else { if (preedit_segment_lengths.size() == 0) { @@ -3856,8 +3865,8 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) { preedit_standouts.assign(preedit_segment_lengths.size(), FALSE); } - mPreeditor->updatePreedit(preedit_string, preedit_segment_lengths, preedit_standouts, caret_position); } + mPreeditor->updatePreedit(preedit_string, preedit_segment_lengths, preedit_standouts, caret_position); // Some IME doesn't query char position after WM_IME_COMPOSITION, // so we need to update them actively. -- cgit v1.1