From 743dcf2ce8d37fca29baec8f84d03d5578d733ff Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 7 Sep 2013 20:43:04 +0000 Subject: fix for the group index git-svn-id: http://svn.miranda-ng.org/main/trunk@6012 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/addcontact/addcontact.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/modules/addcontact') diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp index d178ec4840..e658ca100d 100644 --- a/src/modules/addcontact/addcontact.cpp +++ b/src/modules/addcontact/addcontact.cpp @@ -88,7 +88,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp TCHAR *grpName; for (int groupId = 1; (grpName = cli.pfnGetGroupName(groupId, NULL)) != NULL; groupId++) { int id = SendDlgItemMessage(hdlg, IDC_GROUP, CB_ADDSTRING, 0, (LPARAM)grpName); - SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETITEMDATA , id, groupId+1); + SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETITEMDATA, id, groupId); } } @@ -126,8 +126,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp case WM_COMMAND: acs = (ADDCONTACTSTRUCT *)GetWindowLongPtr(hdlg, GWLP_USERDATA); - switch (LOWORD(wparam)) - { + switch (LOWORD(wparam)) { case IDC_AUTH: { DWORD flags = CallProtoServiceInt(NULL,acs->szProto, PS_GETCAPS, PFLAGNUM_4, 0); @@ -148,8 +147,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp case IDOK: { HANDLE hContact = INVALID_HANDLE_VALUE; - switch (acs->handleType) - { + switch (acs->handleType) { case HANDLE_EVENT: { DBEVENTINFO dbei = { sizeof(dbei) }; @@ -175,8 +173,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp db_set_ts(hContact, "CList", "MyHandle", szHandle); int item = SendDlgItemMessage(hdlg, IDC_GROUP, CB_GETCURSEL, 0, 0); - if (item > 0) - { + if (item > 0) { item = SendDlgItemMessage(hdlg, IDC_GROUP, CB_GETITEMDATA, item, 0); CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)hContact, item); } @@ -186,13 +183,11 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp if (IsDlgButtonChecked(hdlg, IDC_ADDED)) CallContactService(hContact, PSS_ADDED, 0, 0); - if (IsDlgButtonChecked(hdlg, IDC_AUTH)) - { + if (IsDlgButtonChecked(hdlg, IDC_AUTH)) { DWORD flags = CallProtoServiceInt(NULL,acs->szProto, PS_GETCAPS, PFLAGNUM_4, 0); if (flags & PF4_NOCUSTOMAUTH) CallContactService(hContact, PSS_AUTHREQUESTT, 0, 0); - else - { + else { TCHAR szReason[512]; GetDlgItemText(hdlg, IDC_AUTHREQ, szReason, SIZEOF(szReason)); CallContactService(hContact, PSS_AUTHREQUESTT, 0, (LPARAM)szReason); -- cgit v1.2.3