summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-24 19:23:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-24 19:23:21 +0000
commit87e6c8808ddda005f96fb9244ccf04adf72f46f4 (patch)
tree316ab9a4bafd5b46793da86a63fc91b6b1349e68 /src
parentc796381b41c3db711caccd3b0c629b41a723ea19 (diff)
fix for the perverted genmenu logic
git-svn-id: http://svn.miranda-ng.org/main/trunk@611 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/modules/clist/genmenu.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index f61921b4e1..b6f78c80ef 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -822,18 +822,17 @@ static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *l
if (p != NULL && fType != MFT_SEPARATOR) {
if ((p->mi.position / SEPARATORPOSITIONINTERVAL) != (pimi->mi.position / SEPARATORPOSITIONINTERVAL)) {
//but might be supposed to be after the next one instead
- if (uItem < GetMenuItemCount(hMenu) && GetMenuItemType(hMenu, uItem) != MFT_SEPARATOR)
+ if ( !(uItem < GetMenuItemCount(hMenu) && GetMenuItemType(hMenu, uItem) == MFT_SEPARATOR))
InsertSeparator(hMenu, uItem);
-
uItem++;
- } } }
+ } } }
//check for separator after
if (uItem < GetMenuItemCount(hMenu)) {
UINT fType = GetMenuItemTypeData(hMenu, uItem, p);
if (p != NULL && fType != MFT_SEPARATOR)
if ((p->mi.position / SEPARATORPOSITIONINTERVAL) != (pimi->mi.position / SEPARATORPOSITIONINTERVAL))
- InsertSeparator(hMenu, uItem);
+ InsertSeparator(hMenu, uItem);
}
// create local copy *lpmii so we can change some flags
@@ -888,11 +887,8 @@ void GetMenuItemName(PMO_IntMenuItem pMenuItem, char* pszDest, size_t cbDestSize
{
if (pMenuItem->UniqName)
mir_snprintf(pszDest, cbDestSize, "{%s}", pMenuItem->UniqName);
- else if (pMenuItem->mi.flags & CMIF_UNICODE) {
- char* name = mir_t2a(pMenuItem->mi.ptszName);
- mir_snprintf(pszDest, cbDestSize, "{%s}", name);
- mir_free(name);
- }
+ else if (pMenuItem->mi.flags & CMIF_UNICODE)
+ mir_snprintf(pszDest, cbDestSize, "{%s}", (char*)_T2A(pMenuItem->mi.ptszName));
else
mir_snprintf(pszDest, cbDestSize, "{%s}", pMenuItem->mi.pszName);
}