summaryrefslogtreecommitdiff
path: root/src/modules/clist/genmenu.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-06 23:05:29 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-06 23:05:29 +0000
commit6640a8f419a9ef61ad7af41a419615c2d07b872e (patch)
tree6dfecb48ccc82c0c372ced9be59255c7408ebafd /src/modules/clist/genmenu.cpp
parent06823b967ab360de98fa2c9e685695e1dff6f78a (diff)
menu item flag CMIF_ICONFROMICOLIB is ignored by the core from now on
git-svn-id: http://svn.miranda-ng.org/main/trunk@4354 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist/genmenu.cpp')
-rw-r--r--src/modules/clist/genmenu.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index b7df40afcb..47909e8d1b 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -316,15 +316,16 @@ int MO_ModifyMenuItem(PMO_IntMenuItem menuHandle, PMO_MenuItem pmi)
}
if (pmi->flags & CMIM_FLAGS) {
- oldflags = pimi->mi.flags & (CMIF_ROOTHANDLE | CMIF_ICONFROMICOLIB);
+ oldflags = (pimi->mi.flags & CMIF_ROOTHANDLE);
pimi->mi.flags = (pmi->flags & ~CMIM_ALL) | oldflags;
}
if ((pmi->flags & CMIM_ICON) && !bIconsDisabled) {
- if (pimi->mi.flags & CMIF_ICONFROMICOLIB) {
- HICON hIcon = IcoLib_GetIconByHandle(pmi->hIcolibItem, false);
+ HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
+ if (hIcolibItem) {
+ HICON hIcon = IcoLib_GetIconByHandle(hIcolibItem, false);
if (hIcon != NULL) {
- pimi->hIcolibItem = pmi->hIcolibItem;
+ pimi->hIcolibItem = hIcolibItem;
pimi->iconId = ImageList_ReplaceIcon(pimi->parent->m_hMenuIcons, pimi->iconId, hIcon);
IcoLib_ReleaseIcon(hIcon, 0);
}
@@ -648,20 +649,14 @@ PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi)
p->mi.ptszName = mir_a2u(pmi->pszName);
if (pmi->hIcon != NULL && !bIconsDisabled) {
- if (pmi->flags & CMIF_ICONFROMICOLIB) {
- HICON hIcon = IcoLib_GetIconByHandle(pmi->hIcolibItem, false);
+ HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
+ if (hIcolibItem != NULL) {
+ HICON hIcon = IcoLib_GetIconByHandle(hIcolibItem, false);
p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, hIcon);
p->hIcolibItem = pmi->hIcolibItem;
IcoLib_ReleaseIcon(hIcon, 0);
}
- else {
- HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
- if (hIcolibItem) {
- p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, pmi->hIcon);
- p->hIcolibItem = hIcolibItem;
- }
- else p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, pmi->hIcon);
- }
+ else p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, pmi->hIcon);
}
if (p->mi.root == HGENMENU_ROOT)