diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-13 17:26:45 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-13 17:26:45 +0000 |
commit | 5e686292c537275c8ea1399f311c082d905e8a63 (patch) | |
tree | 88a4f3921ff70323775f3329c8820a0fe947d74f /src/modules/userinfo | |
parent | 90c154b4be566ec4a804217d0f1e50fb1e259b72 (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@398 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/userinfo')
-rw-r--r-- | src/modules/userinfo/contactinfo.cpp | 50 | ||||
-rw-r--r-- | src/modules/userinfo/stdinfo.cpp | 54 | ||||
-rw-r--r-- | src/modules/userinfo/userinfo.cpp | 50 |
3 files changed, 77 insertions, 77 deletions
diff --git a/src/modules/userinfo/contactinfo.cpp b/src/modules/userinfo/contactinfo.cpp index b8dd841835..8b8c7ae66d 100644 --- a/src/modules/userinfo/contactinfo.cpp +++ b/src/modules/userinfo/contactinfo.cpp @@ -43,7 +43,7 @@ static INT_PTR CALLBACK EditUserEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar case IDCANCEL:
EndDialog(hwndDlg,wParam);
case IDC_EMAIL:
- if (HIWORD(wParam)==EN_CHANGE)
+ if (HIWORD(wParam) == EN_CHANGE)
EnableWindow(GetDlgItem(hwndDlg,IDOK),GetWindowTextLength(GetDlgItem(hwndDlg,IDC_EMAIL)));
break;
}
@@ -73,7 +73,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar SendDlgItemMessage(hwndDlg,IDC_NUMBER,EM_LIMITTEXT,63,0);
CallService(MS_UTILS_GETCOUNTRYLIST,(WPARAM)&countryCount,(LPARAM)&countries);
for (i=0;i<countryCount;i++) {
- if (countries[i].id==0 || countries[i].id==0xFFFF) continue;
+ if (countries[i].id == 0 || countries[i].id == 0xFFFF) continue;
item=SendDlgItemMessageA(hwndDlg,IDC_COUNTRY,CB_ADDSTRING,0,(LPARAM)Translate(countries[i].szName));
SendDlgItemMessage(hwndDlg,IDC_COUNTRY,CB_SETITEMDATA,item,countries[i].id);
}
@@ -86,7 +86,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar { char *szText=(char*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
int isValid=1;
GetDlgItemTextA(hwndDlg,IDC_PHONE,szText,252);
- if (lstrlenA(szText)<7 || szText[0]!='+') isValid=0;
+ if (lstrlenA(szText)<7 || szText[0] != '+') isValid=0;
if (isValid) isValid=(lstrlenA(szText+1) == (int)strspn(szText+1,"0123456789 ()-"));
if (!isValid) {
MessageBox(hwndDlg,TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."),TranslateT("Invalid Phone Number"),MB_OK);
@@ -98,10 +98,10 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar case IDCANCEL:
EndDialog(hwndDlg,wParam);
case IDC_COUNTRY:
- if (HIWORD(wParam)!=CBN_SELCHANGE) break;
+ if (HIWORD(wParam) != CBN_SELCHANGE) break;
case IDC_AREA:
case IDC_NUMBER:
- if (LOWORD(wParam)!=IDC_COUNTRY && HIWORD(wParam)!=EN_CHANGE) break;
+ if (LOWORD(wParam) != IDC_COUNTRY && HIWORD(wParam) != EN_CHANGE) break;
if (noRecursion) break;
EnableWindow(GetDlgItem(hwndDlg,IDOK),TRUE);
{ char szPhone[96],szArea[32],szNumber[64];
@@ -114,7 +114,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar }
break;
case IDC_PHONE:
- if (HIWORD(wParam)!=EN_UPDATE) break;
+ if (HIWORD(wParam) != EN_UPDATE) break;
if (noRecursion) break;
noRecursion=1;
{
@@ -178,7 +178,7 @@ static int IsOverEmail(HWND hwndDlg,TCHAR* szEmail,int cchEmail) GetClientRect(hwndEmails,&rc);
if (!PtInRect(&rc,hti.pt)) return 0;
if (ListView_SubItemHitTest(hwndEmails,&hti) == -1) return 0;
- if (hti.iSubItem!=1) return 0;
+ if (hti.iSubItem != 1) return 0;
if (!(hti.flags&LVHT_ONITEMLABEL)) return 0;
ListView_GetSubItemRect(hwndEmails,hti.iItem,1,LVIR_LABEL,&rc);
szText[0] = 0;
@@ -207,7 +207,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lf.lfUnderline=1;
hEmailFont=CreateFontIndirect(&lf);
}
- if (hHandCursor==NULL) {
+ if (hHandCursor == NULL) {
if (IsWinVer2000Plus()) hHandCursor=LoadCursor(NULL,IDC_HAND);
else hHandCursor=LoadCursor(hMirandaInst,MAKEINTRESOURCE(IDC_HYPERLINKHAND));
}
@@ -246,7 +246,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (hContact != NULL) {
szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if (szProto==NULL) break;
+ if (szProto == NULL) break;
//e-mails
ListView_DeleteAllItems(GetDlgItem(hwndDlg,IDC_EMAILS));
lvi.mask=LVIF_TEXT|LVIF_PARAM;
@@ -254,7 +254,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.iSubItem=0;
lvi.iItem=0;
for (i=-1;;i++) {
- if (i==-1) {
+ if (i == -1) {
if (DBGetContactSettingTString(hContact,szProto,"e-mail",&dbv))
continue;
lvi.pszText=TranslateT("Primary");
@@ -378,7 +378,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
RECT rc;
ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom,nm->nmcd.dwItemSpec,nm->iSubItem,LVIR_LABEL,&rc);
- if (nm->iSubItem==1 && nm->nmcd.hdr.idFrom==IDC_EMAILS) {
+ if (nm->iSubItem == 1 && nm->nmcd.hdr.idFrom == IDC_EMAILS) {
HFONT hoFont;
TCHAR szText[256] = {0};
ListView_GetItemText(nm->nmcd.hdr.hwndFrom,nm->nmcd.dwItemSpec,nm->iSubItem,szText,SIZEOF(szText));
@@ -391,16 +391,16 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
HICON hIcon = NULL;
- if (nm->nmcd.lItemlParam==(LPARAM)(-2) && nm->iSubItem-3==(nm->nmcd.hdr.idFrom==IDC_PHONES))
+ if (nm->nmcd.lItemlParam == (LPARAM)(-2) && nm->iSubItem-3 == (nm->nmcd.hdr.idFrom == IDC_PHONES))
hIcon = LoadSkinIcon( SKINICON_OTHER_ADDCONTACT );
- else if (nm->iSubItem>1 && nm->nmcd.lItemlParam!=(LPARAM)(-1) && nm->nmcd.lItemlParam!=(LPARAM)(-2)) {
+ else if (nm->iSubItem>1 && nm->nmcd.lItemlParam != (LPARAM)(-1) && nm->nmcd.lItemlParam != (LPARAM)(-2)) {
static int iconResources[3]={SKINICON_OTHER_RENAME,SKINICON_OTHER_DELETE};
- if (nm->iSubItem==2 && nm->nmcd.hdr.idFrom==IDC_PHONES) {
+ if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) {
TCHAR szText[2];
ListView_GetItemText(nm->nmcd.hdr.hwndFrom,nm->nmcd.dwItemSpec,nm->iSubItem,szText,SIZEOF(szText));
if (szText[0]) hIcon = LoadSkinIcon( SKINICON_OTHER_SMS );
}
- else hIcon = LoadSkinIcon( iconResources[nm->iSubItem-3+(nm->nmcd.hdr.idFrom==IDC_EMAILS)] );
+ else hIcon = LoadSkinIcon( iconResources[nm->iSubItem-3+(nm->nmcd.hdr.idFrom == IDC_EMAILS)] );
}
else break;
DrawIconEx(nm->nmcd.hdc,(rc.left+rc.right-GetSystemMetrics(SM_CXSMICON))/2,(rc.top+rc.bottom-GetSystemMetrics(SM_CYSMICON))/2,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
@@ -416,7 +416,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP LVITEM lvi;
TCHAR szEmail[256];
HANDLE hContact=(HANDLE)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
- char *szIdTemplate=nm->hdr.idFrom==IDC_PHONES?"MyPhone%d":"Mye-mail%d";
+ char *szIdTemplate=nm->hdr.idFrom == IDC_PHONES?"MyPhone%d":"Mye-mail%d";
LVHITTESTINFO hti;
if (IsOverEmail(hwndDlg,szEmail,SIZEOF(szEmail))) {
@@ -434,14 +434,14 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.iItem=hti.iItem;
lvi.iSubItem=0;
ListView_GetItem(nm->hdr.hwndFrom,&lvi);
- if (lvi.lParam==(LPARAM)(-1)) break;
- if (lvi.lParam==(LPARAM)(-2)) {
- if (hti.iSubItem-3==(nm->hdr.idFrom==IDC_PHONES)) {
+ if (lvi.lParam == (LPARAM)(-1)) break;
+ if (lvi.lParam == (LPARAM)(-2)) {
+ if (hti.iSubItem-3 == (nm->hdr.idFrom == IDC_PHONES)) {
//add
char szNewData[256]="",idstr[33];
int i;
DBVARIANT dbv;
- if (IDOK!=DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(nm->hdr.idFrom==IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL),hwndDlg,nm->hdr.idFrom==IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc,(LPARAM)szNewData))
+ if (IDOK != DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL),hwndDlg,nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc,(LPARAM)szNewData))
break;
for (i=0;;i++) {
mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate,i);
@@ -453,7 +453,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
}
else {
- if (hti.iSubItem-3==(nm->hdr.idFrom==IDC_PHONES)) {
+ if (hti.iSubItem-3 == (nm->hdr.idFrom == IDC_PHONES)) {
//delete
int i;
char idstr[33];
@@ -469,7 +469,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DBDeleteContactSetting(hContact,"UserInfo",idstr);
SendMessage(hwndDlg,M_REMAKELISTS,0,0);
}
- else if (hti.iSubItem-2==(nm->hdr.idFrom==IDC_PHONES)) {
+ else if (hti.iSubItem-2 == (nm->hdr.idFrom == IDC_PHONES)) {
//edit
char szText[256],idstr[33];
DBVARIANT dbv;
@@ -477,7 +477,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (DBGetContactSettingString(hContact,"UserInfo",idstr,&dbv)) break;
lstrcpynA(szText,dbv.pszVal,SIZEOF(szText));
DBFreeVariant(&dbv);
- if (IDOK!=DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(nm->hdr.idFrom==IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL),hwndDlg,nm->hdr.idFrom==IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc,(LPARAM)szText))
+ if (IDOK != DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL),hwndDlg,nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc,(LPARAM)szText))
break;
DBWriteContactSettingString(hContact,"UserInfo",idstr,szText);
SendMessage(hwndDlg,M_REMAKELISTS,0,0);
@@ -490,8 +490,8 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
break;
case WM_SETCURSOR:
- if (LOWORD(lParam)!=HTCLIENT) break;
- if (GetForegroundWindow()==GetParent(hwndDlg)) {
+ if (LOWORD(lParam) != HTCLIENT) break;
+ if (GetForegroundWindow() == GetParent(hwndDlg)) {
POINT pt;
GetCursorPos(&pt);
ScreenToClient(hwndDlg,&pt);
diff --git a/src/modules/userinfo/stdinfo.cpp b/src/modules/userinfo/stdinfo.cpp index 976c590ac4..7af6334a9b 100644 --- a/src/modules/userinfo/stdinfo.cpp +++ b/src/modules/userinfo/stdinfo.cpp @@ -72,38 +72,38 @@ static void SetValue(HWND hwndDlg,int idCtrl,HANDLE hContact,char *szModule,char bool proto_service = szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC);
dbv.type=DBVT_DELETED;
- if (szModule==NULL) unspecified=1;
+ if (szModule == NULL) unspecified=1;
else if (proto_service) unspecified=Proto_GetContactInfoSetting(hContact,szProto,szModule,szSetting,&dbv,0);
else unspecified=DBGetContactSettingW(hContact,szModule,szSetting,&dbv);
if (!unspecified) {
switch(dbv.type) {
case DBVT_BYTE:
- if (special==SVS_GENDER) {
- if (dbv.cVal=='M') ptstr=TranslateT("Male");
- else if (dbv.cVal=='F') ptstr=TranslateT("Female");
+ if (special == SVS_GENDER) {
+ if (dbv.cVal == 'M') ptstr=TranslateT("Male");
+ else if (dbv.cVal == 'F') ptstr=TranslateT("Female");
else unspecified=1;
}
- else if (special==SVS_MONTH) {
+ else if (special == SVS_MONTH) {
if (dbv.bVal>0 && dbv.bVal<=12) {
pstr=str;
GetLocaleInfoA(LOCALE_USER_DEFAULT,LOCALE_SABBREVMONTHNAME1-1+dbv.bVal,str,SIZEOF(str));
}
else unspecified=1;
}
- else if (special==SVS_TIMEZONE) {
- if (dbv.cVal==-100) unspecified=1;
+ else if (special == SVS_TIMEZONE) {
+ if (dbv.cVal == -100) unspecified=1;
else {
pstr=str;
mir_snprintf(str, SIZEOF(str), dbv.cVal?"UTC%+d:%02d":"UTC",-dbv.cVal/2,(dbv.cVal&1)*30);
}
}
else {
- unspecified=(special==SVS_ZEROISUNSPEC && dbv.bVal==0);
- pstr=_itoa(special==SVS_SIGNED?dbv.cVal:dbv.bVal,str,10);
+ unspecified=(special == SVS_ZEROISUNSPEC && dbv.bVal == 0);
+ pstr=_itoa(special == SVS_SIGNED?dbv.cVal:dbv.bVal,str,10);
}
break;
case DBVT_WORD:
- if (special==SVS_COUNTRY) {
+ if (special == SVS_COUNTRY) {
WORD wSave = dbv.wVal;
if (wSave == ( WORD )-1) {
char szSettingName[100];
@@ -116,29 +116,29 @@ static void SetValue(HWND hwndDlg,int idCtrl,HANDLE hContact,char *szModule,char }
pstr = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,wSave,0));
- unspecified=pstr==NULL;
+ unspecified=pstr == NULL;
}
else {
- unspecified=(special==SVS_ZEROISUNSPEC && dbv.wVal==0);
- pstr=_itoa(special==SVS_SIGNED?dbv.sVal:dbv.wVal,str,10);
+ unspecified=(special == SVS_ZEROISUNSPEC && dbv.wVal == 0);
+ pstr=_itoa(special == SVS_SIGNED?dbv.sVal:dbv.wVal,str,10);
}
break;
case DBVT_DWORD:
- unspecified=(special==SVS_ZEROISUNSPEC && dbv.dVal==0);
- if (special==SVS_IP) {
+ unspecified=(special == SVS_ZEROISUNSPEC && dbv.dVal == 0);
+ if (special == SVS_IP) {
struct in_addr ia;
ia.S_un.S_addr=htonl(dbv.dVal);
pstr=inet_ntoa(ia);
- if (dbv.dVal==0) unspecified=1;
+ if (dbv.dVal == 0) unspecified=1;
}
- else pstr=_itoa(special==SVS_SIGNED?dbv.lVal:dbv.dVal,str,10);
+ else pstr=_itoa(special == SVS_SIGNED?dbv.lVal:dbv.dVal,str,10);
break;
case DBVT_ASCIIZ:
- unspecified=(special==SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
+ unspecified=(special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
pstr=dbv.pszVal;
break;
case DBVT_UTF8:
- unspecified=(special==SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
+ unspecified=(special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
#if defined( _UNICODE )
if ( !unspecified )
{ WCHAR* wszStr;
@@ -186,7 +186,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if (szProto==NULL) break;
+ if (szProto == NULL) break;
SetValue(hwndDlg,IDC_NICK,hContact,szProto,"Nick",0);
SetValue(hwndDlg,IDC_FIRSTNAME,hContact,szProto,"FirstName",0);
SetValue(hwndDlg,IDC_LASTNAME,hContact,szProto,"LastName",0);
@@ -262,7 +262,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if (szProto==NULL) break;
+ if (szProto == NULL) break;
SetValue(hwndDlg,IDC_STREET,hContact,szProto,"Street",SVS_ZEROISUNSPEC);
SetValue(hwndDlg,IDC_CITY,hContact,szProto,"City",SVS_ZEROISUNSPEC);
SetValue(hwndDlg,IDC_STATE,hContact,szProto,"State",SVS_ZEROISUNSPEC);
@@ -310,7 +310,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if (szProto==NULL) break;
+ if (szProto == NULL) break;
SetValue(hwndDlg,IDC_COMPANY,hContact,szProto,"Company",SVS_ZEROISUNSPEC);
SetValue(hwndDlg,IDC_DEPARTMENT,hContact,szProto,"CompanyDepartment",SVS_ZEROISUNSPEC);
SetValue(hwndDlg,IDC_POSITION,hContact,szProto,"CompanyPosition",SVS_ZEROISUNSPEC);
@@ -348,7 +348,7 @@ void ResizeColumns(HWND hwndLV) {
int nCol = 0; LVCOLUMN lvCol;
lvCol.mask = LVCF_WIDTH;
- while(ListView_GetColumn(hwndLV, nCol++, &lvCol))
+ while (ListView_GetColumn(hwndLV, nCol++, &lvCol))
ListView_SetColumnWidth(hwndLV, nCol-1, LVSCW_AUTOSIZE);
}
@@ -385,7 +385,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (hContact != NULL) {
char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if (szProto==NULL) break;
+ if (szProto == NULL) break;
bool proto_service = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC) == PF4_INFOSETTINGSVC;
SetValue(hwndDlg,IDC_WEBPAGE,hContact,szProto,"Homepage",SVS_ZEROISUNSPEC);
@@ -524,7 +524,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if (szProto==NULL) break;
+ if (szProto == NULL) break;
SetValue(hwndDlg,IDC_ABOUT,hContact,szProto,"About",0);
}
break;
@@ -544,9 +544,9 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
break;
case WM_COMMAND:
- if (wParam==MAKEWPARAM(IDC_MYNOTES,EN_CHANGE))
+ if (wParam == MAKEWPARAM(IDC_MYNOTES,EN_CHANGE))
SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
- else if (LOWORD(wParam)==IDCANCEL)
+ else if (LOWORD(wParam) == IDCANCEL)
SendMessage(GetParent(hwndDlg),msg,wParam,lParam);
break;
case WM_DESTROY:
diff --git a/src/modules/userinfo/userinfo.cpp b/src/modules/userinfo/userinfo.cpp index 38947bec2b..7dd3a1a121 100644 --- a/src/modules/userinfo/userinfo.cpp +++ b/src/modules/userinfo/userinfo.cpp @@ -88,7 +88,7 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam,LPARAM) opi.pageCount=0;
opi.odp=NULL;
NotifyEventHooks(hDetailsInitEvent,(WPARAM)&opi,wParam);
- if (opi.pageCount==0) return 0;
+ if (opi.pageCount == 0) return 0;
qsort(opi.odp,opi.pageCount,sizeof(OPTIONSDIALOGPAGE),(int (*)(const void*,const void*))PageSortProc);
ZeroMemory(&psh,sizeof(psh));
@@ -105,7 +105,7 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam,LPARAM) //cleanup moved to WM_DESTROY
//mir_free((char*)opi.odp[i].pszTitle);
//mir_free((char*)opi.odp[i].pszTab);
- if (opi.odp[i].pszGroup!=NULL) mir_free(opi.odp[i].pszGroup);
+ if (opi.odp[i].pszGroup != NULL) mir_free(opi.odp[i].pszGroup);
if ((DWORD_PTR)opi.odp[i].pszTemplate&0xFFFF0000) mir_free((char*)opi.odp[i].pszTemplate);
}
mir_free(opi.odp);
@@ -117,8 +117,8 @@ static INT_PTR AddDetailsPage(WPARAM wParam,LPARAM lParam) OPTIONSDIALOGPAGE *odp=(OPTIONSDIALOGPAGE*)lParam, *dst;
struct DetailsPageInit *opi=(struct DetailsPageInit*)wParam;
- if (odp==NULL||opi==NULL) return 1;
- if (odp->cbSize!=sizeof(OPTIONSDIALOGPAGE)
+ if (odp == NULL||opi == NULL) return 1;
+ if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE)
&& odp->cbSize != OPTIONPAGE_OLD_SIZE2
&& odp->cbSize != OPTIONPAGE_OLD_SIZE3)
return 1;
@@ -135,16 +135,16 @@ static INT_PTR AddDetailsPage(WPARAM wParam,LPARAM lParam) #if defined(_UNICODE)
if ( odp->flags & ODPF_UNICODE )
{
- dst->ptszTitle = (odp->ptszTitle==0) ? NULL : mir_wstrdup(odp->ptszTitle);
+ dst->ptszTitle = (odp->ptszTitle == 0) ? NULL : mir_wstrdup(odp->ptszTitle);
dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->ptszTab) ? NULL : mir_wstrdup(odp->ptszTab);
}
else
#endif
{
if ( odp->flags & ODPF_DONTTRANSLATE )
- dst->ptszTitle = (odp->pszTitle==0) ? NULL : mir_a2t(odp->pszTitle);
+ dst->ptszTitle = (odp->pszTitle == 0) ? NULL : mir_a2t(odp->pszTitle);
else
- dst->ptszTitle = (odp->pszTitle==0) ? NULL : LangPackPcharToTchar(odp->pszTitle);
+ dst->ptszTitle = (odp->pszTitle == 0) ? NULL : LangPackPcharToTchar(odp->pszTitle);
dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pszTab) ? NULL : LangPackPcharToTchar(odp->pszTab);
}
@@ -215,7 +215,7 @@ static int UserInfoContactDelete(WPARAM wParam,LPARAM) {
HWND hwnd;
hwnd=WindowList_Find(hWindowList,(HANDLE)wParam);
- if (hwnd!=NULL) DestroyWindow(hwnd);
+ if (hwnd != NULL) DestroyWindow(hwnd);
return 0;
}
@@ -347,7 +347,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP TCHAR str[128];
mir_sntprintf(str,SIZEOF(str), _T("%.*s%s%.*s"),dat->updateAnimFrame%10,_T("........."),dat->szUpdating,dat->updateAnimFrame%10,_T("........."));
SetDlgItemText(hwndDlg,IDC_UPDATING,str);
- if (++dat->updateAnimFrame==UPDATEANIMFRAMES) dat->updateAnimFrame=0;
+ if (++dat->updateAnimFrame == UPDATEANIMFRAMES) dat->updateAnimFrame=0;
break;
}
case WM_CTLCOLORSTATIC:
@@ -388,7 +388,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP pshn.lParam=(LPARAM)dat->hContact;
for (i=0;i<dat->pageCount;i++) {
pshn.hdr.hwndFrom=dat->opd[i].hwnd;
- if (dat->opd[i].hwnd!=NULL)
+ if (dat->opd[i].hwnd != NULL)
SendMessage(dat->opd[i].hwnd,WM_NOTIFY,0,(LPARAM)&pshn);
}
break;
@@ -398,7 +398,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP char *szProto;
if (dat->hContact != NULL) {
szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
- if (szProto==NULL) {EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),FALSE); break;}
+ if (szProto == NULL) {EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),FALSE); break;}
if (CallProtoService(szProto,PS_GETSTATUS,0,0)<ID_STATUS_ONLINE) EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),FALSE);
else EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),!IsWindowVisible(GetDlgItem(hwndDlg,IDC_UPDATING)));
}
@@ -409,12 +409,12 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP ACKDATA *ack=(ACKDATA*)lParam;
int i;
- if (ack->hContact==NULL && ack->type==ACKTYPE_STATUS) {
+ if (ack->hContact == NULL && ack->type == ACKTYPE_STATUS) {
SendMessage(hwndDlg,M_CHECKONLINE,0,0);
break;
}
- if (ack->hContact!=dat->hContact) break;
- if (ack->type!=ACKTYPE_GETINFO) break;
+ if (ack->hContact != dat->hContact) break;
+ if (ack->type != ACKTYPE_GETINFO) break;
SendMessage(hwndDlg,PSM_FORCECHANGED,0,0);
/* if they're not gonna send any more ACK's don't let that mean we should crash */
if (!ack->hProcess && !ack->lParam) {
@@ -423,11 +423,11 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendMessage(hwndDlg,M_CHECKONLINE,0,0);
break;
} //if
- if (dat->infosUpdated==NULL) dat->infosUpdated=(int*)mir_calloc(sizeof(int)*(INT_PTR)ack->hProcess);
- if (ack->result==ACKRESULT_SUCCESS || ack->result==ACKRESULT_FAILED) dat->infosUpdated[ack->lParam]=1;
+ if (dat->infosUpdated == NULL) dat->infosUpdated=(int*)mir_calloc(sizeof(int)*(INT_PTR)ack->hProcess);
+ if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED) dat->infosUpdated[ack->lParam]=1;
for (i=0;i<(int)ack->hProcess;i++)
- if (dat->infosUpdated[i]==0) break;
- if (i==(int)ack->hProcess) {
+ if (dat->infosUpdated[i] == 0) break;
+ if (i == (int)ack->hProcess) {
ShowWindow(GetDlgItem(hwndDlg,IDC_UPDATING),SW_HIDE);
KillTimer(hwndDlg,1);
SendMessage(hwndDlg,M_CHECKONLINE,0,0);
@@ -518,7 +518,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP pshn.lParam=(LPARAM)dat->hContact;
pshn.hdr.code=PSN_RESET;
for (i=0;i<dat->pageCount;i++) {
- if (dat->opd[i].hwnd==NULL || !dat->opd[i].changed) continue;
+ if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
pshn.hdr.hwndFrom=dat->opd[i].hwnd;
SendMessage(dat->opd[i].hwnd,WM_NOTIFY,0,(LPARAM)&pshn);
}
@@ -531,7 +531,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP PSHNOTIFY pshn;
pshn.hdr.idFrom=0;
pshn.lParam=(LPARAM)dat->hContact;
- if (dat->currentPage!=-1) {
+ if (dat->currentPage != -1) {
pshn.hdr.code=PSN_KILLACTIVE;
pshn.hdr.hwndFrom=dat->opd[dat->currentPage].hwnd;
if (SendMessage(dat->opd[dat->currentPage].hwnd,WM_NOTIFY,0,(LPARAM)&pshn))
@@ -540,11 +540,11 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP pshn.hdr.code=PSN_APPLY;
for (i=0;i<dat->pageCount;i++) {
- if (dat->opd[i].hwnd==NULL || !dat->opd[i].changed) continue;
+ if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
pshn.hdr.hwndFrom=dat->opd[i].hwnd;
- if (SendMessage(dat->opd[i].hwnd,WM_NOTIFY,0,(LPARAM)&pshn)==PSNRET_INVALID_NOCHANGEPAGE) {
+ if (SendMessage(dat->opd[i].hwnd,WM_NOTIFY,0,(LPARAM)&pshn) == PSNRET_INVALID_NOCHANGEPAGE) {
TreeView_Select(GetDlgItem(hwndDlg,IDC_PAGETREE), dat->opd[i].hItem, TVGN_CARET);
- if (dat->currentPage!=-1) ShowWindow(dat->opd[dat->currentPage].hwnd,SW_HIDE);
+ if (dat->currentPage != -1) ShowWindow(dat->opd[dat->currentPage].hwnd,SW_HIDE);
dat->currentPage=i;
ShowWindow(dat->opd[dat->currentPage].hwnd,SW_SHOW);
return 0;
@@ -554,7 +554,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
}
case IDC_UPDATE:
- if (dat->infosUpdated!=NULL) {mir_free(dat->infosUpdated); dat->infosUpdated=NULL;}
+ if (dat->infosUpdated != NULL) {mir_free(dat->infosUpdated); dat->infosUpdated=NULL;}
if (dat->hContact != NULL) {
if (!CallContactService(dat->hContact,PSS_GETINFO,0,0)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),FALSE);
@@ -589,7 +589,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP { int i;
for (i=0;i<dat->pageCount;i++)
{
- if (dat->opd[i].hwnd!=NULL) DestroyWindow(dat->opd[i].hwnd);
+ if (dat->opd[i].hwnd != NULL) DestroyWindow(dat->opd[i].hwnd);
mir_free(dat->opd[i].ptszTitle);
mir_free(dat->opd[i].ptszTab);
}
|