summaryrefslogtreecommitdiff
path: root/plugins/Mwclist/CLUIFrames/framesmenu.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-14 17:17:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-14 17:17:39 +0000
commit37e1f0cb88e2344c288064b7d88963ba7ea26955 (patch)
tree5841101832e4c2a95a571c46ea6281c4018d09bf /plugins/Mwclist/CLUIFrames/framesmenu.cpp
parentd5d023f683b23fe26ddea93738cb721d532804f0 (diff)
- clists' menus compatibility issues;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@412 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Mwclist/CLUIFrames/framesmenu.cpp')
-rw-r--r--plugins/Mwclist/CLUIFrames/framesmenu.cpp36
1 files changed, 13 insertions, 23 deletions
diff --git a/plugins/Mwclist/CLUIFrames/framesmenu.cpp b/plugins/Mwclist/CLUIFrames/framesmenu.cpp
index 7a34206512..7ce6bdd2a1 100644
--- a/plugins/Mwclist/CLUIFrames/framesmenu.cpp
+++ b/plugins/Mwclist/CLUIFrames/framesmenu.cpp
@@ -37,34 +37,24 @@ INT_PTR FreeOwnerDataFrameMenu (WPARAM wParam,LPARAM lParam)
static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return 0;
- if (mi->cbSize != sizeof(CLISTMENUITEM)) return 0;
-
- memset(&tmi,0,sizeof(tmi));
+ if ((mi->flags & CMIF_ROOTPOPUP) || (mi->flags & CMIF_CHILDPOPUP))
+ tmi.root = mi->hParentMenu;
- tmi.cbSize = sizeof(tmi);
- tmi.flags = mi->flags;
- tmi.hIcon = mi->hIcon;
- tmi.hotKey = mi->hotKey;
- tmi.position = mi->position;
- tmi.pszName = mi->pszName;
+ lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
+ if (fmep == NULL)
+ return 0;
- if (mi->flags&CMIF_ROOTPOPUP||mi->flags&CMIF_CHILDPOPUP)
- tmi.root = mi->hParentMenu;
- {
- lpFrameMenuExecParam fmep;
- fmep = (lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
- if (fmep == NULL){return 0;}
- fmep->szServiceName = mir_strdup(mi->pszService);
- fmep->Frameid = mi->popupPosition;
- fmep->param1 = (INT_PTR)mi->pszContactOwner;
-
- tmi.ownerdata = fmep;
- }
+ fmep->szServiceName = mir_strdup(mi->pszService);
+ fmep->Frameid = mi->popupPosition;
+ fmep->param1 = (INT_PTR)mi->pszContactOwner;
+ tmi.ownerdata = fmep;
- return(CallService(MO_ADDNEWMENUITEM,(WPARAM)hFrameMenuObject,(LPARAM)&tmi));
+ return CallService(MO_ADDNEWMENUITEM, (WPARAM)hFrameMenuObject, (LPARAM)&tmi);
}
static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam)