diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-24 11:11:26 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-24 11:11:26 +0300 |
commit | d296f9f99daf102b9af5d56690e2bd00d61c1267 (patch) | |
tree | 39311caaf80abf0b47ecb78cf94dc8157b193575 /plugins/SpellChecker | |
parent | ffc521e5d5e9bd66feb65afe0046b3fc7e073356 (diff) |
database:
- senseless fiels ptszVal removed from DBVARIANT, pwszVal is used instead;
- if you want db_get to return a string, you need to use db_get_s.
Diffstat (limited to 'plugins/SpellChecker')
-rw-r--r-- | plugins/SpellChecker/src/dictionary.cpp | 2 | ||||
-rw-r--r-- | plugins/SpellChecker/src/options.cpp | 2 | ||||
-rw-r--r-- | plugins/SpellChecker/src/utils.cpp | 14 |
3 files changed, 9 insertions, 9 deletions
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index 3127000d69..4b7c517c93 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -778,7 +778,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts) char lang[128]; WideCharToMultiByte(CP_ACP, 0, dict->language, -1, lang, sizeof(lang), nullptr, nullptr); if (!db_get_ws(NULL, MODULENAME, lang, &dbv)) { - mir_wstrncpy(dict->localized_name, dbv.ptszVal, _countof(dict->localized_name)); + mir_wstrncpy(dict->localized_name, dbv.pwszVal, _countof(dict->localized_name)); db_free(&dbv); } diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index 7302be7246..7fafa944e8 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -92,7 +92,7 @@ void LoadOptions() DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "DefaultLanguage", &dbv)) {
- mir_wstrncpy(opts.default_language, dbv.ptszVal, _countof(opts.default_language));
+ mir_wstrncpy(opts.default_language, dbv.pwszVal, _countof(opts.default_language));
db_free(&dbv);
}
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 1902d21b20..217e95daad 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -724,8 +724,8 @@ void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, ch return;
}
- if (dbv.type == DBVT_WCHAR && dbv.ptszVal != nullptr) {
- wchar_t *lang = dbv.ptszVal;
+ if (dbv.type == DBVT_WCHAR && dbv.pwszVal != nullptr) {
+ wchar_t *lang = dbv.pwszVal;
for (auto &dict : languages) {
if (mir_wstrcmpi(dict->localized_name, lang) == 0 || mir_wstrcmpi(dict->english_name, lang) == 0 || mir_wstrcmpi(dict->language, lang) == 0) {
@@ -770,18 +770,18 @@ void GetContactLanguage(Dialog *dlg) if (dlg->hContact == NULL) {
if (!db_get_ws(NULL, MODULENAME, dlg->name, &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
}
else {
if (!db_get_ws(dlg->hContact, MODULENAME, "TalkLanguage", &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
if (dlg->lang_name[0] == '\0' && !db_get_ws(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
@@ -790,12 +790,12 @@ void GetContactLanguage(Dialog *dlg) MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
if (!db_get_ws(hMetaContact, MODULENAME, "TalkLanguage", &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
if (dlg->lang_name[0] == '\0' && !db_get_ws(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
}
|