From d7b15f5f89319f1a9077efb50bd3a242a5dc2b52 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Feb 2013 16:03:04 +0000 Subject: fixes for various hangups & crashes on exit git-svn-id: http://svn.miranda-ng.org/main/trunk@3652 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Popup/src/actions.cpp | 56 ++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 36 deletions(-) (limited to 'plugins/Popup/src/actions.cpp') diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp index 72abf53be8..d0ed93e550 100644 --- a/plugins/Popup/src/actions.cpp +++ b/plugins/Popup/src/actions.cpp @@ -108,39 +108,39 @@ DWORD MouseOverride(HWND hCombo, int number) { DWORD dwItem = 0; DWORD ItemActive = 0; - if(number<0 || number >7) + if (number<0 || number >7) number = 0; dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("no overwrite")); SendMessage(hCombo, CB_SETITEMDATA, dwItem, 0); - if(number == 0) + if (number == 0) ItemActive = dwItem; dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Send message")); SendMessage(hCombo, CB_SETITEMDATA, dwItem, 1); - if(number == 1) + if (number == 1) ItemActive = dwItem; dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Quick reply")); SendMessage(hCombo, CB_SETITEMDATA, dwItem, 2); - if(number == 2) + if (number == 2) ItemActive = dwItem; dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("User details")); SendMessage(hCombo, CB_SETITEMDATA, dwItem, 3); - if(number == 3) + if (number == 3) ItemActive = dwItem; dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Contact menu")); SendMessage(hCombo, CB_SETITEMDATA, dwItem, 4); - if(number == 4) + if (number == 4) ItemActive = dwItem; dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Dismiss popup")); SendMessage(hCombo, CB_SETITEMDATA, dwItem, 5); - if(number == 5) + if (number == 5) ItemActive = dwItem; dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Pin popup")); SendMessage(hCombo, CB_SETITEMDATA, dwItem, 6); - if(number == 6) + if (number == 6) ItemActive = dwItem; dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Copy to clipboard")); SendMessage(hCombo, CB_SETITEMDATA, dwItem, 7); - if(number == 7) + if (number == 7) ItemActive = dwItem; return ItemActive; } @@ -266,35 +266,19 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM groups.insert(mir_strdup(szGroup), groups.getCount()); } - if (g_popup.isOsUnicode) - { - LVITEMW item = {0}; - item.mask = LVIF_IMAGE|LVIF_PARAM|LVIF_TEXT|LVIF_STATE|LVIF_INDENT; - item.iItem = i; - LPWSTR wszName = mir_a2u(szName); - item.pszText = TranslateW(wszName); - item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon); - item.lParam = i; - if (IsWinVerXPPlus()) - { - item.mask |= LVIF_GROUPID; - item.iGroupId = grpId; - } - item.iIndent = 0; - ListView_InsertItemW(hwndList, &item); - mir_free(wszName); - } else - { - LVITEMA item = {0}; - item.mask = LVIF_IMAGE|LVIF_PARAM|LVIF_TEXT|LVIF_STATE|LVIF_GROUPID|LVIF_INDENT; - item.iItem = i; - item.pszText = Translate(szName); - item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon); - item.lParam = i; + LVITEM item = {0}; + item.mask = LVIF_IMAGE|LVIF_PARAM|LVIF_TEXT|LVIF_STATE|LVIF_INDENT; + item.iItem = i; + mir_ptr tszName( mir_a2t(szName)); + item.pszText = TranslateTS(tszName); + item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon); + item.lParam = i; + if (IsWinVerXPPlus()) { + item.mask |= LVIF_GROUPID; item.iGroupId = grpId; - item.iIndent = 0; - ListView_InsertItem(hwndList, &item); } + item.iIndent = 0; + ListView_InsertItemW(hwndList, &item); ListView_SetItemState(hwndList, i, (gActions[i]->flags & PAF_ENABLED) ? 0x2000 : 0x1000, LVIS_STATEIMAGEMASK); } -- cgit v1.2.3