summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-09-18 13:03:10 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-09-18 13:03:10 +0300
commit9a2b18ce1d76687094322699b077b0e3d66f1ecd (patch)
tree299e30e9ac41609fb92b1806c7a31d7a3a591c8f /src/mir_app
parentd6edbc9108a3ea183774c84993f679e824ad8a6f (diff)
code cleaning
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/clc.cpp24
-rw-r--r--src/mir_app/src/clcitems.cpp6
-rw-r--r--src/mir_app/src/clcmsgs.cpp28
-rw-r--r--src/mir_app/src/clistmod.cpp2
4 files changed, 30 insertions, 30 deletions
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp
index 6758a23958..fae2dea563 100644
--- a/src/mir_app/src/clc.cpp
+++ b/src/mir_app/src/clc.cpp
@@ -376,7 +376,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
int groupId = atoi(dbcws->szSetting) + 1;
// check name of group and ignore message if just being expanded/collapsed
- if (Clist_FindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group)) {
CMStringW szFullName(contact->szText);
while (group->parent) {
ClcContact *cc = nullptr;
@@ -429,7 +429,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN)
break;
if (dbcws->value.type == DBVT_DELETED || dbcws->value.bVal == 0) {
- if (Clist_FindItem(hwnd, dat, wParam, nullptr, nullptr, nullptr))
+ if (Clist_FindItem(hwnd, dat, wParam, nullptr))
break;
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
Clist_NotifyNewContact(hwnd, wParam);
@@ -445,7 +445,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
{
WORD iExtraImage[EXTRA_ICON_COUNT];
BYTE flags = 0;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
@@ -455,7 +455,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b(wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
@@ -491,12 +491,12 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
contact = nullptr;
group = nullptr;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr)) {
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group)) {
if (shouldShow && db_is_contact(wParam)) {
if (dat->selection >= 0 && g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
- Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr);
+ Clist_FindItem(hwnd, dat, wParam, &contact);
if (contact) {
contact->iImage = (WORD)lParam;
Clist_NotifyNewContact(hwnd, wParam);
@@ -523,7 +523,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
}
if (hSelItem) {
ClcGroup *selgroup;
- if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
+ if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup))
dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
@@ -533,7 +533,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
break;
case INTM_NAMECHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _countof(contact->szText));
@@ -542,7 +542,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
break;
case INTM_PROTOCHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
contact->pce->szProto = GetContactProto(wParam);
@@ -552,7 +552,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
break;
case INTM_NOTONLISTCHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
if (contact->type == CLCIT_CONTACT) {
@@ -570,7 +570,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
break;
case INTM_APPARENTMODECHANGED:
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
char *szProto = GetContactProto(wParam);
if (szProto == nullptr)
break;
@@ -592,7 +592,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
break;
case INTM_IDLECHANGED:
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
char *szProto = GetContactProto(wParam);
if (szProto == nullptr)
break;
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp
index 851dfaf549..12765d49ef 100644
--- a/src/mir_app/src/clcitems.cpp
+++ b/src/mir_app/src/clcitems.cpp
@@ -304,7 +304,7 @@ MIR_APP_DLL(void) Clist_DeleteItemFromTree(HWND hwnd, MCONTACT hItem)
ClcGroup *group;
ClcContact *contact;
- if (!Clist_FindItem(hwnd, dat, hItem, &contact, &group, nullptr)) {
+ if (!Clist_FindItem(hwnd, dat, hItem, &contact, &group)) {
DBVARIANT dbv;
int i, nameOffset;
if (!IsHContactContact(hItem))
@@ -582,7 +582,7 @@ void fnSortCLC(HWND hwnd, ClcData *dat, int useInsertionSort)
if (hSelItem) {
ClcGroup *selgroup;
- if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
+ if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup))
dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
}
@@ -703,7 +703,7 @@ MIR_APP_DLL(void) Clist_SaveStateAndRebuildList(HWND hwnd, ClcData *dat)
group = &dat->list;
else {
ClcContact *contact;
- if (!Clist_FindItem(hwnd, dat, it->parentId | HCONTACT_ISGROUP, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, it->parentId | HCONTACT_ISGROUP, &contact))
continue;
group = contact->group;
}
diff --git a/src/mir_app/src/clcmsgs.cpp b/src/mir_app/src/clcmsgs.cpp
index 27fa517b22..21444b2d10 100644
--- a/src/mir_app/src/clcmsgs.cpp
+++ b/src/mir_app/src/clcmsgs.cpp
@@ -60,7 +60,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
if (cii->hParentGroup == nullptr)
group = &dat->list;
else {
- if (!Clist_FindItem(hwnd, dat, INT_PTR(cii->hParentGroup) | HCONTACT_ISGROUP, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, INT_PTR(cii->hParentGroup) | HCONTACT_ISGROUP, &contact))
return 0;
group = contact->group;
}
@@ -96,7 +96,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
break;
case CLM_ENSUREVISIBLE:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group))
break;
for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
@@ -105,18 +105,18 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
break;
case CLM_EXPAND:
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (Clist_FindItem(hwnd, dat, wParam, &contact))
if (contact->type == CLCIT_GROUP)
g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, lParam);
break;
case CLM_FINDCONTACT:
- if (!Clist_FindItem(hwnd, dat, wParam, nullptr, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, nullptr))
return 0;
return wParam;
case CLM_FINDGROUP:
- if (!Clist_FindItem(hwnd, dat, wParam | HCONTACT_ISGROUP, nullptr, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam | HCONTACT_ISGROUP, nullptr))
return 0;
return wParam | HCONTACT_ISGROUP;
@@ -124,7 +124,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
return dat->bkColour;
case CLM_GETCHECKMARK:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return 0;
return (contact->flags & CONTACTF_CHECKED) != 0;
@@ -135,7 +135,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
return (LRESULT)dat->hwndRenameEdit;
case CLM_GETEXPAND:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return CLE_INVALID;
if (contact->type != CLCIT_GROUP)
return CLE_INVALID;
@@ -151,7 +151,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
case CLM_GETEXTRAIMAGE:
if (LOWORD(lParam) < dat->extraColumnsCount) {
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (Clist_FindItem(hwnd, dat, wParam, &contact))
return contact->iExtraImage[LOWORD(lParam)];
}
return EMPTY_EXTRA_ICON;
@@ -175,13 +175,13 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
return mir_wstrlen(dat->szQuickSearch);
case CLM_GETITEMTEXT:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return 0;
mir_wstrcpy((wchar_t*)lParam, contact->szText);
return mir_wstrlen(contact->szText);
case CLM_GETITEMTYPE:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return CLCIT_INVALID;
return contact->type;
@@ -202,7 +202,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
return 0;
}
- if (!Clist_FindItem(hwnd, dat, lParam, &contact, &group, nullptr))
+ if (!Clist_FindItem(hwnd, dat, lParam, &contact, &group))
return 0;
i = group->cl.indexOf(contact);
@@ -295,7 +295,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
return Clist_ContactToHItem(contact);
case CLM_SELECTITEM:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group))
break;
for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
@@ -326,7 +326,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
break;
case CLM_SETCHECKMARK:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return 0;
if (lParam)
contact->flags |= CONTACTF_CHECKED;
@@ -403,7 +403,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
break;
case CLM_SETITEMTEXT:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
mir_wstrncpy(contact->szText, (wchar_t*)lParam, _countof(contact->szText));
g_clistApi.pfnSortCLC(hwnd, dat, 1);
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp
index 7b31bc49df..9dba34d34a 100644
--- a/src/mir_app/src/clistmod.cpp
+++ b/src/mir_app/src/clistmod.cpp
@@ -375,7 +375,7 @@ MIR_APP_DLL(int) Clist_ContactCompare(MCONTACT hContact1, MCONTACT hContact2)
ClcData *dat = (ClcData*)GetWindowLongPtr(g_clistApi.hwndContactTree, 0);
if (dat != nullptr) {
ClcContact *p1, *p2;
- if (Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact1, &p1, nullptr, nullptr) && Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact2, &p2, nullptr, nullptr))
+ if (Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact1, &p1) && Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact2, &p2))
return g_clistApi.pfnCompareContacts(p1, p2);
}