Commit 1cd71e92 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

imm32: Use INPUTCONTEXT directly in ImmSetConversionStatus.

parent 67ddc314
...@@ -2635,37 +2635,34 @@ BOOL WINAPI ImmSetCompositionWindow( ...@@ -2635,37 +2635,34 @@ BOOL WINAPI ImmSetCompositionWindow(
/*********************************************************************** /***********************************************************************
* ImmSetConversionStatus (IMM32.@) * ImmSetConversionStatus (IMM32.@)
*/ */
BOOL WINAPI ImmSetConversionStatus( BOOL WINAPI ImmSetConversionStatus( HIMC himc, DWORD conversion, DWORD sentence )
HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
{ {
DWORD oldConversion, oldSentence; DWORD old_conversion, old_sentence;
struct imc *data = get_imc_data( hIMC ); INPUTCONTEXT *ctx;
TRACE("%p %ld %ld\n", hIMC, fdwConversion, fdwSentence);
if (!data) TRACE( "himc %p, conversion %#lx, sentence %#lx\n", himc, conversion, sentence );
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (NtUserQueryInputContext( hIMC, NtUserInputContextThreadId ) != GetCurrentThreadId()) return FALSE; if (NtUserQueryInputContext( himc, NtUserInputContextThreadId ) != GetCurrentThreadId()) return FALSE;
if (!(ctx = ImmLockIMC( himc ))) return FALSE;
if ( fdwConversion != data->IMC.fdwConversion ) if (conversion != ctx->fdwConversion)
{ {
oldConversion = data->IMC.fdwConversion; old_conversion = ctx->fdwConversion;
data->IMC.fdwConversion = fdwConversion; ctx->fdwConversion = conversion;
ImmNotifyIME(hIMC, NI_CONTEXTUPDATED, oldConversion, IMC_SETCONVERSIONMODE); ImmNotifyIME( himc, NI_CONTEXTUPDATED, old_conversion, IMC_SETCONVERSIONMODE );
imc_notify_ime( data, IMN_SETCONVERSIONMODE, 0 ); SendMessageW( ctx->hWnd, WM_IME_NOTIFY, IMN_SETCONVERSIONMODE, 0 );
} }
if ( fdwSentence != data->IMC.fdwSentence )
if (sentence != ctx->fdwSentence)
{ {
oldSentence = data->IMC.fdwSentence; old_sentence = ctx->fdwSentence;
data->IMC.fdwSentence = fdwSentence; ctx->fdwSentence = sentence;
ImmNotifyIME(hIMC, NI_CONTEXTUPDATED, oldSentence, IMC_SETSENTENCEMODE); ImmNotifyIME( himc, NI_CONTEXTUPDATED, old_sentence, IMC_SETSENTENCEMODE );
imc_notify_ime( data, IMN_SETSENTENCEMODE, 0 ); SendMessageW( ctx->hWnd, WM_IME_NOTIFY, IMN_SETSENTENCEMODE, 0 );
} }
ImmUnlockIMC( himc );
return TRUE; return TRUE;
} }
......
...@@ -4219,7 +4219,6 @@ static void test_ImmSetConversionStatus(void) ...@@ -4219,7 +4219,6 @@ static void test_ImmSetConversionStatus(void)
.hkl = expect_ime, .himc = default_himc, .hkl = expect_ime, .himc = default_himc,
.func = IME_NOTIFY, .notify = {.action = NI_CONTEXTUPDATED, .index = 0xdeadbeef, .value = IMC_SETCONVERSIONMODE}, .func = IME_NOTIFY, .notify = {.action = NI_CONTEXTUPDATED, .index = 0xdeadbeef, .value = IMC_SETCONVERSIONMODE},
}, },
{.todo = TRUE}, /* spurious calls */
{0}, {0},
}; };
const struct ime_call set_conversion_status_2_seq[] = const struct ime_call set_conversion_status_2_seq[] =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment