summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker/src/utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-05-18 12:31:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-05-18 12:31:56 +0000
commit504307b184517248795d3ae4301969bfa93a050a (patch)
treef3a9607ae039da405fc4ad597b96b7fc60122cfb /plugins/SpellChecker/src/utils.cpp
parent8d80538230c30daa2d8742e19421c49e90fdb13d (diff)
unused proprietary services removed from UserInfoEx
git-svn-id: http://svn.miranda-ng.org/main/trunk@16848 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker/src/utils.cpp')
-rw-r--r--plugins/SpellChecker/src/utils.cpp32
1 files changed, 14 insertions, 18 deletions
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)