From 78c0815c4118fe24ab78cce2dc48a6232dcd824a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 2 Jun 2012 20:55:18 +0000 Subject: - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Sessions/Src/Main.cpp | 24 ++++++++++++------------ plugins/Sessions/Src/Options.cpp | 20 ++++++++++---------- plugins/Sessions/Src/Utils.cpp | 34 +++++++++++++++++----------------- 3 files changed, 39 insertions(+), 39 deletions(-) (limited to 'plugins/Sessions/Src') diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 47ec1b98bb..4f0e230704 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -252,7 +252,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar DestroyWindow(hdlg); g_hSDlg=0; } - else if(!SaveUserSessionName(szUserSessionName)) + else if (!SaveUserSessionName(szUserSessionName)) { SaveSessionHandles(0,1); @@ -297,7 +297,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar { ses_count=0; TranslateDialogDefault(hdlg); - if((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit) + if ((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit) EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),TRUE); if(LoadSessionToCombobox(hdlg,0,255,"UserSessionDsc",ses_limit)==0 && ses_count!=0) @@ -371,7 +371,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),FALSE); SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0); - if((ses_count=LoadSessionToCombobox(hdlg,1,ses_limit,"SessionDate",0))==ses_limit) + if ((ses_count=LoadSessionToCombobox(hdlg,1,ses_limit,"SessionDate",0))==ses_limit) EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),TRUE); if(LoadSessionToCombobox(hdlg,1,255,"UserSessionDsc",ses_limit)==0 && ses_count!=0) @@ -387,7 +387,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),FALSE); SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0); - if((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit) + if ((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit) EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),TRUE); if(LoadSessionToCombobox(hdlg,0,255,"UserSessionDsc",ses_limit)==0 && ses_count!=0) @@ -402,7 +402,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar DeleteAutoSession(ses_count); EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),FALSE); SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0); - if((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit) + if ((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit) EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),TRUE); if(LoadSessionToCombobox(hdlg,0,255,"UserSessionDsc",ses_limit)==0 && ses_count!=0) @@ -420,7 +420,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar case IDOK: { - if(!LoadSession(0,ses_count)) + if (!LoadSession(0,ses_count)) { SavePosition(hdlg, "LoadDlg"); DestroyWindow(hdlg); @@ -586,7 +586,7 @@ int SaveUserSessionName(TCHAR *szUSessionName) { szUserSessionName = mir_tstrdup(szUSessionName); mir_snprintf(szUserSessionNameBuf, SIZEOF(szUserSessionNameBuf), "%s_%u", "UserSessionDsc", 0); - if(!DBGetContactSettingTString(NULL, __INTERNAL_NAME, szUserSessionNameBuf, &dbv)) + if (!DBGetContactSettingTString(NULL, __INTERNAL_NAME, szUserSessionNameBuf, &dbv)) { szUserSessionNameBuf_1 = mir_tstrdup(dbv.ptszVal); DBFreeVariant(&dbv); @@ -646,7 +646,7 @@ int LoadSession(WPARAM wparam,LPARAM lparam) CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)session_list_t[i], 0); else if(g_bWarnOnHidden) { - if(!CheckContactVisibility((HANDLE)session_list_t[i])) + if (!CheckContactVisibility((HANDLE)session_list_t[i])) { hidden[j]=i+1; j++; @@ -664,13 +664,13 @@ int LoadSession(WPARAM wparam,LPARAM lparam) } else if(dup==i) { - if(!hidden) + if (!hidden) { if(g_bOtherWarnings) MessageBox(NULL, TranslateT("This Session already opened"), TranslateT("Sessions Manager"), MB_OK|MB_ICONWARNING); return 1; } - else if(!g_bWarnOnHidden&&g_bOtherWarnings) + else if (!g_bWarnOnHidden&&g_bOtherWarnings) { MessageBox(NULL, TranslateT("This Session already opened"), TranslateT("Sessions Manager"), MB_OK|MB_ICONWARNING); return 1; @@ -847,7 +847,7 @@ static int GetContactHandle(WPARAM wparam,LPARAM lParam) } else if(MWeventdata->uType == MSG_WINDOW_EVT_CLOSE) { - if(!DONT) DelFromCurSession((DWORD)MWeventdata->hContact,0); + if (!DONT) DelFromCurSession((DWORD)MWeventdata->hContact,0); if(g_bCrashRecovery) DBWriteContactSettingByte(MWeventdata->hContact, __INTERNAL_NAME, "wasInLastSession", 0); } @@ -906,7 +906,7 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) session_list_recovered[i++]=(DWORD)hContact; } } - if(!session_list_recovered[0]) g_bIncompletedSave=FALSE; + if (!session_list_recovered[0]) g_bIncompletedSave=FALSE; DBWriteContactSettingByte(NULL, __INTERNAL_NAME, "lastSaveCompleted", 0); if (!DBGetContactSettingByte(NULL, __INTERNAL_NAME, "lastempty", 1)||g_bIncompletedSave) isLastTRUE=TRUE; diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index 3998f2de2c..b52e2d92d7 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -80,18 +80,18 @@ static LRESULT CALLBACK ComboBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return TRUE; case EM_SETSEL: - if(!hOpClistControl) + if (!hOpClistControl) return HideCaret(hwnd); break; case WM_GETDLGCODE: - if(!hOpClistControl) + if (!hOpClistControl) return DLGC_WANTARROWS; break; case WM_SETCURSOR: { - if(!hOpClistControl) + if (!hOpClistControl) { SetCursor(LoadCursor(NULL, IDC_ARROW)); return TRUE; @@ -111,7 +111,7 @@ static LRESULT CALLBACK ComboBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_NCLBUTTONDBLCLK: case WM_NCLBUTTONDOWN: - if(!bChecked) + if (!bChecked) { MarkUserDefSession(opses_count,1); hIcon=hMarked; @@ -238,7 +238,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) { EnableWindow(GetDlgItem(hdlg,IDC_EDIT),TRUE); SendDlgItemMessage(hdlg, IDC_LIST, CB_SETCURSEL, (WPARAM)0, 0); - if(!OpLoadSessionContacts(0,opses_count)) + if (!OpLoadSessionContacts(0,opses_count)) EnableWindow(GetDlgItem(hdlg,IDC_DEL),FALSE); } @@ -280,7 +280,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) if(IsDlgButtonChecked(hdlg, IDC_STARTDIALOG)) { - if(!IsDlgButtonChecked(hdlg, IDC_CHECKLAST)) + if (!IsDlgButtonChecked(hdlg, IDC_CHECKLAST)) DBWriteContactSettingByte(NULL, __INTERNAL_NAME, "StartupMode", 1); else DBWriteContactSettingByte(NULL, __INTERNAL_NAME, "StartupMode", 3); } @@ -345,7 +345,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) RedrawWindow(hComboBoxEdit, NULL, NULL, RDW_INVALIDATE|RDW_NOCHILDREN|RDW_UPDATENOW|RDW_FRAME); } OpLoadSessionContacts(0,opses_count); - if(!hOpClistControl) + if (!hOpClistControl) EnableWindow(GetDlgItem(hdlg,IDC_DEL),TRUE); else { @@ -368,7 +368,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) case IDC_EDIT: { - if(!hOpClistControl) + if (!hOpClistControl) { int i; HANDLE hItem; @@ -455,7 +455,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) { EnableWindow(GetDlgItem(hdlg,IDC_EDIT),TRUE); SendDlgItemMessage(hdlg, IDC_LIST, CB_SETCURSEL, (WPARAM)0, 0); - if(!OpLoadSessionContacts(0,opses_count)) + if (!OpLoadSessionContacts(0,opses_count)) EnableWindow(GetDlgItem(hdlg,IDC_DEL),FALSE); } else @@ -528,7 +528,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) HideCaret(hComboBoxEdit); } - if((HIWORD(wparam)!=CBN_DROPDOWN)&&(LOWORD(wparam)==IDC_LIST)&&!hOpClistControl) + if ((HIWORD(wparam)!=CBN_DROPDOWN)&&(LOWORD(wparam)==IDC_LIST)&&!hOpClistControl) { SendMessage(hComboBoxEdit,EM_SCROLLCARET ,0,0); HideCaret(hComboBoxEdit); diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 4b5ba065a0..a4859e7874 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -29,7 +29,7 @@ void AddSessionMark(HANDLE hContact,int mode,char bit) if(mode==0) { DBVARIANT dbv; - if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal) + if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal) { temp_1[0]=dbv.pszVal[0]; for (i=0;i