From 0308f566ea2232525f3dd53995050b78824521cd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 20 Sep 2012 18:01:28 +0000 Subject: fix for the custom menu names git-svn-id: http://svn.miranda-ng.org/main/trunk@1610 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/genmenu.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/modules/clist') diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 62749733d3..92da9dba13 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -76,7 +76,7 @@ LPTSTR GetMenuItemText(PMO_IntMenuItem pimi) { if (pimi->mi.flags & CMIF_KEEPUNTRANSLATED) return pimi->mi.ptszName; - + return TranslateTH(pimi->mi.hLangpack, pimi->mi.ptszName); } @@ -823,7 +823,8 @@ static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *l mii.fType |= MFT_MENUBARBREAK; } - mii.dwTypeData = GetMenuItemText(pimi); + if (!pimi->CustomName) + mii.dwTypeData = GetMenuItemText(pimi); InsertMenuItem(hMenu, uItem, TRUE, &mii); } @@ -923,10 +924,8 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para // mi.pszName mir_snprintf(DBString, SIZEOF(DBString), "%s_name", menuItemName); if ( !DBGetContactSettingTString(NULL, MenuNameItems, DBString, &dbv)) { - if (_tcslen(dbv.ptszVal) > 0) { - if (pmi->CustomName) mir_free(pmi->CustomName); - pmi->CustomName = mir_tstrdup(dbv.ptszVal); - } + if (_tcslen(dbv.ptszVal) > 0) + replaceStrT(pmi->CustomName, dbv.ptszVal); DBFreeVariant(&dbv); } -- cgit v1.2.3