summaryrefslogtreecommitdiff
path: root/src/modules/clist/clcmsgs.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-10 20:18:48 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-10 20:18:48 +0000
commit22377c8be5548d37deee4258b315c2e5f1b42bca (patch)
tree359febdaa0dbc9efaf6384259ce43a3fcb03fadb /src/modules/clist/clcmsgs.cpp
parent2e57f9842aa2da2985bfc36bcc85d1124f2dbb3f (diff)
- fixed crazy drawing bug in nicer;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@2281 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist/clcmsgs.cpp')
-rw-r--r--src/modules/clist/clcmsgs.cpp44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp
index c6f7ad3157..b34eafc52c 100644
--- a/src/modules/clist/clcmsgs.cpp
+++ b/src/modules/clist/clcmsgs.cpp
@@ -29,7 +29,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
{
switch (msg) {
case CLM_ADDCONTACT:
- cli.pfnAddContactToTree(hwnd, dat, (HANDLE) wParam, 1, 0);
+ cli.pfnAddContactToTree(hwnd, dat, (HANDLE)wParam, 1, 0);
cli.pfnRecalcScrollBar(hwnd, dat);
cli.pfnSortCLC(hwnd, dat, 1);
break;
@@ -77,7 +77,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
break;
case CLM_DELETEITEM:
- cli.pfnDeleteItemFromTree(hwnd, (HANDLE) wParam);
+ cli.pfnDeleteItemFromTree(hwnd, (HANDLE)wParam);
cli.pfnSortCLC(hwnd, dat, 1);
cli.pfnRecalcScrollBar(hwnd, dat);
break;
@@ -95,7 +95,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
{
ClcContact *contact;
ClcGroup *group, *tgroup;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
@@ -106,7 +106,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_EXPAND:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
if (contact->type != CLCIT_GROUP)
break;
@@ -115,7 +115,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
}
case CLM_FINDCONTACT:
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, NULL, NULL, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, NULL, NULL, NULL))
return (LRESULT)(HANDLE) NULL;
return wParam;
@@ -130,7 +130,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_GETCHECKMARK:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
return (contact->flags & CONTACTF_CHECKED) != 0;
}
@@ -144,7 +144,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_GETEXPAND:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return CLE_INVALID;
if (contact->type != CLCIT_GROUP)
return CLE_INVALID;
@@ -162,7 +162,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_GETEXTRAIMAGE:
if (LOWORD(lParam) < dat->extraColumnsCount) {
ClcContact *contact;
- if ( cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return contact->iExtraImage[LOWORD(lParam)];
}
return EMPTY_EXTRA_ICON;
@@ -188,7 +188,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_GETITEMTEXT:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
lstrcpy((TCHAR*) lParam, contact->szText);
return lstrlen(contact->szText);
@@ -197,7 +197,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_GETITEMTYPE:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return CLCIT_INVALID;
return contact->type;
}
@@ -318,7 +318,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
{
ClcContact *contact;
ClcGroup *group, *tgroup;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
@@ -351,7 +351,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_SETCHECKMARK:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
if (lParam)
contact->flags |= CONTACTF_CHECKED;
@@ -365,23 +365,21 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_SETEXTRACOLUMNS:
if (wParam > EXTRA_ICON_COUNT)
return 0;
+
dat->extraColumnsCount = wParam;
cli.pfnInvalidateRect(hwnd, NULL, FALSE);
break;
case CLM_SETEXTRAIMAGE:
- {
- if (LOWORD(lParam) >= dat->extraColumnsCount)
- return 0;
-
- ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
- return 0;
+ if ( LOWORD(lParam) < dat->extraColumnsCount) {
+ ClcContact *contact;
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ return 0;
- contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam);
- cli.pfnInvalidateRect(hwnd, NULL, FALSE);
+ contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam);
+ cli.pfnInvalidateRect(hwnd, NULL, FALSE);
+ }
break;
- }
case CLM_SETEXTRAIMAGELIST:
dat->himlExtraColumns = (HIMAGELIST) lParam;
@@ -433,7 +431,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_SETITEMTEXT:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
lstrcpyn(contact->szText, (TCHAR*)lParam, SIZEOF(contact->szText));
cli.pfnSortCLC(hwnd, dat, 1);