summaryrefslogtreecommitdiff
path: root/src/modules/visibility/visibility.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-13 17:26:45 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-13 17:26:45 +0000
commit5e686292c537275c8ea1399f311c082d905e8a63 (patch)
tree88a4f3921ff70323775f3329c8820a0fe947d74f /src/modules/visibility/visibility.cpp
parent90c154b4be566ec4a804217d0f1e50fb1e259b72 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@398 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/visibility/visibility.cpp')
-rw-r--r--src/modules/visibility/visibility.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp
index 984d5e036a..5d5719bfd7 100644
--- a/src/modules/visibility/visibility.cpp
+++ b/src/modules/visibility/visibility.cpp
@@ -32,23 +32,23 @@ static void SetListGroupIcons(HWND hwndList,HANDLE hFirstItem,HANDLE hParentItem
typeOfFirst=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
//check groups
- if (typeOfFirst==CLCIT_GROUP) hItem=hFirstItem;
+ if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
- while(hItem) {
+ while (hItem) {
hChildItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
if (hChildItem) SetListGroupIcons(hwndList,hChildItem,hItem,childCount);
for ( i=0; i < SIZEOF(iconOn); i++)
- if (iconOn[i] && SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,i)==0) iconOn[i]=0;
+ if (iconOn[i] && SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,i) == 0) iconOn[i]=0;
hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
}
//check contacts
- if (typeOfFirst==CLCIT_CONTACT) hItem=hFirstItem;
+ if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
- while(hItem) {
+ while (hItem) {
for ( i=0; i < SIZEOF(iconOn); i++) {
iImage=SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,i);
- if (iconOn[i] && iImage==0) iconOn[i]=0;
- if (iImage!=0xFF) childCount[i]++;
+ if (iconOn[i] && iImage == 0) iconOn[i]=0;
+ if (iImage != 0xFF) childCount[i]++;
}
hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
}
@@ -66,19 +66,19 @@ static void SetAllChildIcons(HWND hwndList,HANDLE hFirstItem,int iColumn,int iIm
typeOfFirst=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
//check groups
- if (typeOfFirst==CLCIT_GROUP) hItem=hFirstItem;
+ if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
- while(hItem) {
+ while (hItem) {
hChildItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
if (hChildItem) SetAllChildIcons(hwndList,hChildItem,iColumn,iImage);
hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
}
//check contacts
- if (typeOfFirst==CLCIT_CONTACT) hItem=hFirstItem;
+ if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
- while(hItem) {
+ while (hItem) {
iOldIcon=SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (iOldIcon!=0xFF && iOldIcon!=iImage) SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
+ if (iOldIcon != 0xFF && iOldIcon != iImage) SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
}
}
@@ -109,21 +109,21 @@ static void SetAllContactIcons(HWND hwndList)
hItem=(HANDLE)SendMessage(hwndList,CLM_FINDCONTACT,(WPARAM)hContact,0);
if (hItem) {
szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if (szProto==NULL) {flags=0; status=0;}
+ if (szProto == NULL) {flags=0; status=0;}
else {
flags=CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_1,0);
status=DBGetContactSettingWord(hContact,szProto,"ApparentMode",0);
}
if (flags&PF1_INVISLIST) {
- if (SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,0))==0xFF)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,status==ID_STATUS_ONLINE?1:0));
+ if (SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,0)) == 0xFF)
+ SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,status == ID_STATUS_ONLINE?1:0));
}
if (flags&PF1_VISLIST) {
- if (SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(1,0))==0xFF)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(1,status==ID_STATUS_OFFLINE?2:0));
+ if (SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(1,0)) == 0xFF)
+ SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(1,status == ID_STATUS_OFFLINE?2:0));
}
}
- } while(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
}
static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
// Update list, making sure that the options are mutually exclusive
if (itemType == CLCIT_CONTACT) { // A contact
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, iImage));
- if (iImage && SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn?0:1,0))!=0xFF)
+ if (iImage && SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn?0:1,0)) != 0xFF)
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn?0:1, 0));
}
else if (itemType == CLCIT_INFO) { // All Contacts
@@ -249,15 +249,15 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
set=0;
for (i=0;i<2;i++) {
iImage=SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0));
- if (iImage==i+1) {
- CallContactService(hContact,PSS_SETAPPARENTMODE,iImage==1?ID_STATUS_ONLINE:ID_STATUS_OFFLINE,0);
+ if (iImage == i+1) {
+ CallContactService(hContact,PSS_SETAPPARENTMODE,iImage == 1?ID_STATUS_ONLINE:ID_STATUS_OFFLINE,0);
set=1;
break;
}
}
if (!set) CallContactService(hContact,PSS_SETAPPARENTMODE,0,0);
}
- } while(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
return TRUE;
}
}