From 504307b184517248795d3ae4301969bfa93a050a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 18 May 2016 12:31:56 +0000 Subject: unused proprietary services removed from UserInfoEx git-svn-id: http://svn.miranda-ng.org/main/trunk@16848 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SpellChecker/src/utils.cpp | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'plugins/SpellChecker') diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 605fec74c6..15fe69f0e7 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -719,38 +719,34 @@ void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, ch DBVARIANT dbv = { 0 }; dbv.type = DBVT_TCHAR; - DBCONTACTGETSETTING cgs = { 0 }; - cgs.szModule = group; - cgs.szSetting = setting; - cgs.pValue = &dbv; - - INT_PTR rc; - int caps = (isProtocol ? CallProtoService(group, PS_GETCAPS, PFLAGNUM_4, 0) : 0); - if (caps & PF4_INFOSETTINGSVC) - rc = CallProtoService(group, PS_GETINFOSETTING, hContact, (LPARAM)&cgs); + if (caps & PF4_INFOSETTINGSVC) { + DBCONTACTGETSETTING cgs = { 0 }; + cgs.szModule = group; + cgs.szSetting = setting; + cgs.pValue = &dbv; + if (CallProtoService(group, PS_GETINFOSETTING, hContact, (LPARAM)&cgs)) + return; + } else { - rc = CallService(MS_DB_CONTACT_GETSETTING_STR_EX, hContact, (LPARAM)&cgs); - if (rc == CALLSERVICE_NOTFOUND) - rc = db_get_ts(hContact, group, setting, &dbv); + if (db_get_ts(hContact, group, setting, &dbv)) + return; } - if (!rc && dbv.type == DBVT_TCHAR && dbv.ptszVal != NULL) { + if (dbv.type == DBVT_TCHAR && dbv.ptszVal != NULL) { TCHAR *lang = dbv.ptszVal; for (int i = 0; i < languages.getCount(); i++) { Dictionary *dict = languages[i]; if (mir_tstrcmpi(dict->localized_name, lang) == 0 - || mir_tstrcmpi(dict->english_name, lang) == 0 - || mir_tstrcmpi(dict->language, lang) == 0) { + || mir_tstrcmpi(dict->english_name, lang) == 0 + || mir_tstrcmpi(dict->language, lang) == 0) { mir_tstrncpy(dlg->lang_name, dict->language, _countof(dlg->lang_name)); break; } } } - - if (!rc) - db_free(&dbv); + db_free(&dbv); } void GetUserLanguageSetting(Dialog *dlg, char *setting) -- cgit v1.2.3