diff options
author | George Hazan <george.hazan@gmail.com> | 2013-05-17 19:23:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-05-17 19:23:37 +0000 |
commit | 1d9fd398b75a5a6eca9d40db2e2abb60c96ebc7d (patch) | |
tree | 8d216553e534f6f34be4374741709aba73fc1739 /plugins/NewsAggregator/Src/Options.cpp | |
parent | c2914d5759e0ba8a3b9a81c8a1f071dba90094b4 (diff) |
some more fixes for MS_DB_CONTACT_DELETE & loops
git-svn-id: http://svn.miranda-ng.org/main/trunk@4710 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregator/Src/Options.cpp')
-rw-r--r-- | plugins/NewsAggregator/Src/Options.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 697d5d8bc7..6a18c492bc 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -491,23 +491,21 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ListView_GetItemText(hwndList, sel, 1, url, MAX_PATH);
for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
- DBVARIANT dbNick = {0};
- if (db_get_ts(hContact, MODULE, "Nick", &dbNick))
+ ptrT dbNick( db_get_tsa(hContact, MODULE, "Nick"));
+ if (dbNick == NULL)
break;
- else if (lstrcmp(dbNick.ptszVal, nick) == 0) {
- db_free(&dbNick);
- DBVARIANT dbURL = {0};
- if (db_get_ts(hContact, MODULE, "URL", &dbURL))
- break;
- else if (lstrcmp(dbURL.ptszVal, url) == 0) {
- db_free(&dbURL);
- CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
- ListView_DeleteItem(hwndList, sel);
- break;
- }
- db_free(&dbURL);
- }
- db_free(&dbNick);
+ if ( lstrcmp(dbNick, nick))
+ continue;
+
+ ptrT dbURL( db_get_tsa(hContact, MODULE, "URL"));
+ if (dbURL == NULL)
+ break;
+ if ( lstrcmp(dbURL, url))
+ continue;
+
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+ ListView_DeleteItem(hwndList, sel);
+ break;
}
}
return FALSE;
|