msctf: Implement ITfInputProcessorProfiles::ActivateLanguageProfile.

This commit is contained in:
Aric Stewart 2009-05-07 14:27:41 -05:00 committed by Alexandre Julliard
parent aaa15671f4
commit c0233cbc88
2 changed files with 31 additions and 5 deletions

View File

@ -288,9 +288,36 @@ static HRESULT WINAPI InputProcessorProfiles_ActivateLanguageProfile(
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfiles)
{
HRESULT hr;
BOOL enabled;
TF_LANGUAGEPROFILE LanguageProfile;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
TRACE("(%p) %s %x %s\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfiles));
if (langid != This->currentLanguage) return E_INVALIDARG;
if (get_active_textservice(rclsid,NULL))
{
TRACE("Already Active\n");
return E_FAIL;
}
hr = ITfInputProcessorProfiles_IsEnabledLanguageProfile(iface, rclsid,
langid, guidProfiles, &enabled);
if (FAILED(hr) || !enabled)
{
TRACE("Not Enabled\n");
return E_FAIL;
}
LanguageProfile.clsid = *rclsid;
LanguageProfile.langid = langid;
LanguageProfile.guidProfile = *guidProfiles;
hr = add_active_textservice(&LanguageProfile);
return hr;
}
static HRESULT WINAPI InputProcessorProfiles_GetActiveLanguageProfile(
@ -756,8 +783,7 @@ static INT next_LanguageProfile(EnumTfLanguageProfiles *This, CLSID clsid, TF_LA
tflp->clsid = clsid;
tflp->langid = This->langid;
/* FIXME */
tflp->fActive = FALSE;
tflp->fActive = get_active_textservice(&clsid, NULL);
tflp->guidProfile = profile;
if (ITfCategoryMgr_FindClosestCategory(This->catmgr, &clsid,
&tflp->catid, tipcats, 3) != S_OK)

View File

@ -444,7 +444,7 @@ static void test_Activate(void)
HRESULT hr;
hr = ITfInputProcessorProfiles_ActivateLanguageProfile(g_ipp,&CLSID_FakeService,gLangid,&CLSID_FakeService);
todo_wine ok(SUCCEEDED(hr),"Failed to Activate text service\n");
ok(SUCCEEDED(hr),"Failed to Activate text service\n");
}
static inline int check_context_refcount(ITfContext *iface)