summaryrefslogtreecommitdiff
path: root/plugins/Modernb/modern_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/Modernb/modern_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/Modernb/modern_framesmenu.cpp')
-rw-r--r--plugins/Modernb/modern_framesmenu.cpp44
1 files changed, 17 insertions, 27 deletions
diff --git a/plugins/Modernb/modern_framesmenu.cpp b/plugins/Modernb/modern_framesmenu.cpp
index 5a8552f0cb..766adf4974 100644
--- a/plugins/Modernb/modern_framesmenu.cpp
+++ b/plugins/Modernb/modern_framesmenu.cpp
@@ -10,7 +10,8 @@ typedef struct{
char *szServiceName;
int Frameid;
INT_PTR param1;
-}FrameMenuExecParam,*lpFrameMenuExecParam;
+}
+ FrameMenuExecParam,*lpFrameMenuExecParam;
void FreeAndNil( void **p )
{
@@ -20,41 +21,30 @@ void FreeAndNil( void **p )
if ( *p != NULL ) {
mir_free( *p );
*p = NULL;
- } }
+} }
static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi=(CLISTMENUITEM*)lParam;
- TMO_MenuItem tmi={0};
+ TMO_MenuItem tmi;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- if(mi->cbSize!=sizeof(CLISTMENUITEM)) return 0;
+ tmi.root = (mi->flags & CMIF_ROOTHANDLE) ? mi->hParentMenu : NULL;
- memset(&tmi,0,sizeof(tmi));
+ lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
+ if (fmep == NULL)
+ return 0;
- tmi.cbSize=sizeof(tmi);
- tmi.flags=mi->flags;
- tmi.hIcon=mi->hIcon;
- tmi.hotKey=mi->hotKey;
- tmi.position=mi->position;
- tmi.pszName=mi->pszName;
+ memset(fmep, 0, sizeof(FrameMenuExecParam));
+ fmep->szServiceName = mir_strdup(mi->pszService);
+ fmep->Frameid = mi->popupPosition;
+ fmep->param1 = (INT_PTR)mi->pszContactOwner;
+ tmi.ownerdata = fmep;
- if ( mi->flags & CMIF_ROOTHANDLE ) tmi.root = mi->hParentMenu;
- {
- lpFrameMenuExecParam fmep;
- fmep=(lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
- if (fmep==NULL){return(0);};
- memset(fmep,0,sizeof(FrameMenuExecParam));
- 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)
{
lpFrameMenuExecParam fmep;