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(
/***********************************************************************
* ImmSetConversionStatus (IMM32.@)
*/
BOOL WINAPI ImmSetConversionStatus(
HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
BOOL WINAPI ImmSetConversionStatus( HIMC himc, DWORD conversion, DWORD sentence )
{
DWORD oldConversion, oldSentence;
struct imc *data = get_imc_data( hIMC );
TRACE("%p %ld %ld\n", hIMC, fdwConversion, fdwSentence);
DWORD old_conversion, old_sentence;
INPUTCONTEXT *ctx;
if (!data)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
TRACE( "himc %p, conversion %#lx, sentence %#lx\n", himc, conversion, sentence );
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;
data->IMC.fdwConversion = fdwConversion;
ImmNotifyIME(hIMC, NI_CONTEXTUPDATED, oldConversion, IMC_SETCONVERSIONMODE);
imc_notify_ime( data, IMN_SETCONVERSIONMODE, 0 );
old_conversion = ctx->fdwConversion;
ctx->fdwConversion = conversion;
ImmNotifyIME( himc, NI_CONTEXTUPDATED, old_conversion, IMC_SETCONVERSIONMODE );
SendMessageW( ctx->hWnd, WM_IME_NOTIFY, IMN_SETCONVERSIONMODE, 0 );
}
if ( fdwSentence != data->IMC.fdwSentence )
if (sentence != ctx->fdwSentence)
{
oldSentence = data->IMC.fdwSentence;
data->IMC.fdwSentence = fdwSentence;
ImmNotifyIME(hIMC, NI_CONTEXTUPDATED, oldSentence, IMC_SETSENTENCEMODE);
imc_notify_ime( data, IMN_SETSENTENCEMODE, 0 );
old_sentence = ctx->fdwSentence;
ctx->fdwSentence = sentence;
ImmNotifyIME( himc, NI_CONTEXTUPDATED, old_sentence, IMC_SETSENTENCEMODE );
SendMessageW( ctx->hWnd, WM_IME_NOTIFY, IMN_SETSENTENCEMODE, 0 );
}
ImmUnlockIMC( himc );
return TRUE;
}
......
......@@ -4219,7 +4219,6 @@ static void test_ImmSetConversionStatus(void)
.hkl = expect_ime, .himc = default_himc,
.func = IME_NOTIFY, .notify = {.action = NI_CONTEXTUPDATED, .index = 0xdeadbeef, .value = IMC_SETCONVERSIONMODE},
},
{.todo = TRUE}, /* spurious calls */
{0},
};
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