From 30707c980d1560b358dbf2671a4d2a26a1e8173c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Nov 2012 21:45:37 +0000 Subject: various menu initialization quirks git-svn-id: http://svn.miranda-ng.org/main/trunk@2552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PasteIt/src/PasteIt.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'plugins/PasteIt/src') diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index e2164c2492..d74ed92621 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -337,10 +337,10 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) bool bIsContact = false; char *szProto = GetContactProto((HANDLE)wParam); - if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND) bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) ? true : false; + if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND) + bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) ? true : false; - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(mi); + CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIM_FLAGS; if (!bIsContact) mi.flags |= CMIF_HIDDEN; @@ -385,10 +385,7 @@ void InitIcolib() void InitMenuItems() { - CLISTMENUITEM mi = {0}; - CLISTMENUITEM mi2 = {0}; - - mi.cbSize = sizeof(mi); + CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR; mi.icolibItem = hMainIcon; mi.position = 3000090005; @@ -413,7 +410,7 @@ void InitMenuItems() mi.ptszName = _T("Default web page"); HGENMENU hDefWebMenu = Menu_AddContactMenuItem(&mi); - mi2.cbSize = sizeof(mi2); + CLISTMENUITEM mi2 = { sizeof(mi2) }; mi2.pszService = MS_PASTEIT_CONTACTMENU; mi2.hParentMenu = hDefWebMenu; for(int i = 0 ; i < PasteToWeb::pages; ++i) @@ -431,16 +428,11 @@ void InitMenuItems() void DefWebPageChanged() { - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(mi); - - for (int i = 0; i < PasteToWeb::pages; i++) - { + CLISTMENUITEM mi = { sizeof(mi) }; + for (int i = 0; i < PasteToWeb::pages; i++) { mi.flags = CMIM_FLAGS; if (Options::instance->defWeb == i) - { mi.flags |= CMIF_CHECKED; - } CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hWebPageMenus[i], (LPARAM)&mi); } -- cgit v1.2.3