diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-11-26 18:34:26 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-11-26 18:34:26 +0000 |
commit | a5e0714edc8c7dc20d99957f7587b593e53ffba7 (patch) | |
tree | 43ceac82322f4f69a053849dc98520cfc36dc1d6 /plugins/Sessions/Src/Options.cpp | |
parent | 93d6783786b74582dc1451eac4933234b5637144 (diff) |
Sessions: memcpy fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11103 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Sessions/Src/Options.cpp')
-rw-r--r-- | plugins/Sessions/Src/Options.cpp | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index 8ac6acb967..e15609f625 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -128,11 +128,11 @@ static LRESULT CALLBACK ComboBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break;
case WM_NCCALCSIZE:
- {
- NCCALCSIZE_PARAMS *ncsParam = (NCCALCSIZE_PARAMS*)lParam;
- ncsParam->rgrc[0].right -= 16;
- }
- break;
+ {
+ NCCALCSIZE_PARAMS *ncsParam = (NCCALCSIZE_PARAMS*)lParam;
+ ncsParam->rgrc[0].right -= 16;
+ }
+ break;
case WM_NCHITTEST:
LRESULT lr = mir_callNextSubclass(hwnd, ComboBoxSubclassProc, msg, wParam, lParam);
@@ -143,9 +143,9 @@ static LRESULT CALLBACK ComboBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return mir_callNextSubclass(hwnd, ComboBoxSubclassProc, msg, wParam, lParam);
}
-static INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
-{
- switch(msg) {
+static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hdlg);
{
@@ -240,34 +240,34 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar case WM_NOTIFY:
switch (((LPNMHDR)lparam)->code) {
case PSN_APPLY:
- {
- int iDelay = GetDlgItemInt(hdlg, IDC_STARTDELAY, NULL, FALSE);
- db_set_w(0, MODNAME, "StartupModeDelay", (WORD)iDelay);
- db_set_b(0, MODNAME, "TrackCount", (BYTE)(g_ses_limit = GetDlgItemInt(hdlg, IDC_TRACK, NULL, FALSE)));
- if (IsDlgButtonChecked(hdlg, IDC_REXSAVE))
- db_set_b(NULL, MODNAME, "ShutdownMode", 2);
- else if (IsDlgButtonChecked(hdlg, IDC_REXDSAVE))
- db_set_b(NULL, MODNAME, "ShutdownMode", 0);
- else if (IsDlgButtonChecked(hdlg, IDC_REXASK))
- db_set_b(NULL, MODNAME, "ShutdownMode", 1);
-
- if (IsDlgButtonChecked(hdlg, IDC_STARTDIALOG)) {
- if (!IsDlgButtonChecked(hdlg, IDC_CHECKLAST))
- db_set_b(NULL, MODNAME, "StartupMode", 1);
- else
- db_set_b(NULL, MODNAME, "StartupMode", 3);
- }
- else if (IsDlgButtonChecked(hdlg, IDC_RLOADLAST))
- db_set_b(NULL, MODNAME, "StartupMode", 2);
- else if (IsDlgButtonChecked(hdlg, IDC_RNOTHING))
- db_set_b(NULL, MODNAME, "StartupMode", 0);
-
- db_set_b(NULL, MODNAME, "ExclHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_EXCLHIDDEN) ? (g_bExclHidden = 1) : (g_bExclHidden = 0)));
- db_set_b(NULL, MODNAME, "WarnOnHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_LASTHIDDENWARN) ? (g_bWarnOnHidden = 1) : (g_bWarnOnHidden = 0)));
- db_set_b(NULL, MODNAME, "OtherWarnings", (BYTE)(IsDlgButtonChecked(hdlg, IDC_WARNINGS) ? (g_bOtherWarnings = 1) : (g_bOtherWarnings = 0)));
- db_set_b(NULL, MODNAME, "CrashRecovery", (BYTE)(IsDlgButtonChecked(hdlg, IDC_CRASHRECOVERY) ? (g_bCrashRecovery = 1) : (g_bCrashRecovery = 0)));
+ {
+ int iDelay = GetDlgItemInt(hdlg, IDC_STARTDELAY, NULL, FALSE);
+ db_set_w(0, MODNAME, "StartupModeDelay", (WORD)iDelay);
+ db_set_b(0, MODNAME, "TrackCount", (BYTE)(g_ses_limit = GetDlgItemInt(hdlg, IDC_TRACK, NULL, FALSE)));
+ if (IsDlgButtonChecked(hdlg, IDC_REXSAVE))
+ db_set_b(NULL, MODNAME, "ShutdownMode", 2);
+ else if (IsDlgButtonChecked(hdlg, IDC_REXDSAVE))
+ db_set_b(NULL, MODNAME, "ShutdownMode", 0);
+ else if (IsDlgButtonChecked(hdlg, IDC_REXASK))
+ db_set_b(NULL, MODNAME, "ShutdownMode", 1);
+
+ if (IsDlgButtonChecked(hdlg, IDC_STARTDIALOG)) {
+ if (!IsDlgButtonChecked(hdlg, IDC_CHECKLAST))
+ db_set_b(NULL, MODNAME, "StartupMode", 1);
+ else
+ db_set_b(NULL, MODNAME, "StartupMode", 3);
}
- return 1;
+ else if (IsDlgButtonChecked(hdlg, IDC_RLOADLAST))
+ db_set_b(NULL, MODNAME, "StartupMode", 2);
+ else if (IsDlgButtonChecked(hdlg, IDC_RNOTHING))
+ db_set_b(NULL, MODNAME, "StartupMode", 0);
+
+ db_set_b(NULL, MODNAME, "ExclHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_EXCLHIDDEN) ? (g_bExclHidden = 1) : (g_bExclHidden = 0)));
+ db_set_b(NULL, MODNAME, "WarnOnHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_LASTHIDDENWARN) ? (g_bWarnOnHidden = 1) : (g_bWarnOnHidden = 0)));
+ db_set_b(NULL, MODNAME, "OtherWarnings", (BYTE)(IsDlgButtonChecked(hdlg, IDC_WARNINGS) ? (g_bOtherWarnings = 1) : (g_bOtherWarnings = 0)));
+ db_set_b(NULL, MODNAME, "CrashRecovery", (BYTE)(IsDlgButtonChecked(hdlg, IDC_CRASHRECOVERY) ? (g_bCrashRecovery = 1) : (g_bCrashRecovery = 0)));
+ }
+ return 1;
case CLN_CHECKCHANGED:
if (((LPNMHDR)lparam)->idFrom == IDC_EMCLIST) {
@@ -294,38 +294,38 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar break;
case CBN_SELCHANGE:
- {
- HWND hCombo = GetDlgItem(hdlg, IDC_LIST);
- int index = SendMessage(hCombo, CB_GETCURSEL, 0, 0);
- if (index != CB_ERR) {
- opses_count = SendMessage(hCombo, CB_GETITEMDATA, (WPARAM)index, 0);
- SendDlgItemMessage(hdlg, IDC_OPCLIST, LB_RESETCONTENT, 0, 0);
- if (IsMarkedUserDefSession(opses_count)) {
- hIcon = hMarked;
- bChecked = TRUE;
- RedrawWindow(hComboBoxEdit, NULL, NULL, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
- }
- else {
- hIcon = hNotMarked;
- bChecked = FALSE;
- RedrawWindow(hComboBoxEdit, NULL, NULL, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
- }
- OpLoadSessionContacts(0, opses_count);
- if (!hOpClistControl)
- EnableWindow(GetDlgItem(hdlg, IDC_DEL), TRUE);
- else {
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
- SendMessage(hOpClistControl, CLM_SETCHECKMARK, hContact, 0);
-
- for (int i = 0; session_list_t[i] > 0; i++) {
- MCONTACT hContact = (MCONTACT)SendMessage(hOpClistControl, CLM_FINDCONTACT, (WPARAM)session_list_t[i], 0);
- SendMessage(hOpClistControl, CLM_SETCHECKMARK, hContact, 1);
- }
- EnableWindow(GetDlgItem(hdlg, IDC_SAVE), FALSE);
+ {
+ HWND hCombo = GetDlgItem(hdlg, IDC_LIST);
+ int index = SendMessage(hCombo, CB_GETCURSEL, 0, 0);
+ if (index != CB_ERR) {
+ opses_count = SendMessage(hCombo, CB_GETITEMDATA, (WPARAM)index, 0);
+ SendDlgItemMessage(hdlg, IDC_OPCLIST, LB_RESETCONTENT, 0, 0);
+ if (IsMarkedUserDefSession(opses_count)) {
+ hIcon = hMarked;
+ bChecked = TRUE;
+ RedrawWindow(hComboBoxEdit, NULL, NULL, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
+ }
+ else {
+ hIcon = hNotMarked;
+ bChecked = FALSE;
+ RedrawWindow(hComboBoxEdit, NULL, NULL, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
+ }
+ OpLoadSessionContacts(0, opses_count);
+ if (!hOpClistControl)
+ EnableWindow(GetDlgItem(hdlg, IDC_DEL), TRUE);
+ else {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ SendMessage(hOpClistControl, CLM_SETCHECKMARK, hContact, 0);
+
+ for (int i = 0; session_list_t[i] > 0; i++) {
+ MCONTACT hContact = (MCONTACT)SendMessage(hOpClistControl, CLM_FINDCONTACT, (WPARAM)session_list_t[i], 0);
+ SendMessage(hOpClistControl, CLM_SETCHECKMARK, hContact, 1);
}
+ EnableWindow(GetDlgItem(hdlg, IDC_SAVE), FALSE);
}
}
}
+ }
break;
case IDC_EDIT:
@@ -360,34 +360,34 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar break;
case IDC_SAVE:
- {
- int i = 0;
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- BYTE res = (BYTE)SendMessage(GetDlgItem(hdlg, IDC_EMCLIST), CLM_GETCHECKMARK,
- SendMessage(GetDlgItem(hdlg, IDC_EMCLIST), CLM_FINDCONTACT, hContact, 0), 0);
- if (res) {
- SetSessionMark(hContact, 1, '1', opses_count);
- SetInSessionOrder(hContact, 1, opses_count, i);
- i++;
- }
- else {
- SetSessionMark(hContact, 1, '0', opses_count);
- SetInSessionOrder(hContact, 1, opses_count, 0);
- }
+ {
+ int i = 0;
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ BYTE res = (BYTE)SendMessage(GetDlgItem(hdlg, IDC_EMCLIST), CLM_GETCHECKMARK,
+ SendMessage(GetDlgItem(hdlg, IDC_EMCLIST), CLM_FINDCONTACT, hContact, 0), 0);
+ if (res) {
+ SetSessionMark(hContact, 1, '1', opses_count);
+ SetInSessionOrder(hContact, 1, opses_count, i);
+ i++;
}
- if (bSesssionNameChanged) {
- if (GetWindowTextLength(hComboBoxEdit)) {
- TCHAR szUserSessionName[MAX_PATH] = { '\0' };
- GetWindowText(hComboBoxEdit, szUserSessionName, SIZEOF(szUserSessionName));
- RenameUserDefSession(opses_count, szUserSessionName);
- SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0);
- LoadSessionToCombobox(hdlg, 1, 255, "UserSessionDsc", 0);
- }
- bSesssionNameChanged = FALSE;
+ else {
+ SetSessionMark(hContact, 1, '0', opses_count);
+ SetInSessionOrder(hContact, 1, opses_count, 0);
}
- EnableWindow(GetDlgItem(hdlg, IDC_SAVE), FALSE);
}
- break;
+ if (bSesssionNameChanged) {
+ if (GetWindowTextLength(hComboBoxEdit)) {
+ TCHAR szUserSessionName[MAX_PATH] = { '\0' };
+ GetWindowText(hComboBoxEdit, szUserSessionName, SIZEOF(szUserSessionName));
+ RenameUserDefSession(opses_count, szUserSessionName);
+ SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0);
+ LoadSessionToCombobox(hdlg, 1, 255, "UserSessionDsc", 0);
+ }
+ bSesssionNameChanged = FALSE;
+ }
+ EnableWindow(GetDlgItem(hdlg, IDC_SAVE), FALSE);
+ }
+ break;
case IDC_DEL:
DelUserDefSession(opses_count);
|