From ac7bf920f219a7aed7eb163c8b3195e66c12e4da Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 16 Jun 2012 12:19:24 +0000 Subject: fix for menu items' translation in the editor git-svn-id: http://svn.miranda-ng.org/main/trunk@445 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/genmenu.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/modules/clist/genmenu.cpp') diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 2399286f72..59fe7a84b2 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -72,6 +72,14 @@ int GetMenuObjbyId( const int id ) return -1; } +LPTSTR GetMenuItemText(PMO_IntMenuItem pimi) +{ + if (pimi->mi.flags & CMIF_KEEPUNTRANSLATED) + return pimi->mi.ptszName; + + return LangPackTranslateStringT(pimi->mi.hLangpack, pimi->mi.ptszName); +} + PMO_IntMenuItem MO_RecursiveWalkMenu( PMO_IntMenuItem parent, pfnWalkFunc func, void* param ) { if ( parent == NULL ) @@ -825,16 +833,14 @@ static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *l mii = *lpmii; int count = GetMenuItemCount( hMenu ); - if (count != 0 && (count % 33 ) == 0) - if ( pimi->mi.root != NULL ) { - if ( !( mii.fMask & MIIM_FTYPE )) - mii.fType = 0; - mii.fMask |= MIIM_FTYPE; - mii.fType |= MFT_MENUBARBREAK; - } + if (count != 0 && (count % 33 ) == 0 && pimi->mi.root != NULL ) { + if ( !( mii.fMask & MIIM_FTYPE )) + mii.fType = 0; + mii.fMask |= MIIM_FTYPE; + mii.fType |= MFT_MENUBARBREAK; + } - if ( !( pimi->mi.flags & CMIF_KEEPUNTRANSLATED)) - mii.dwTypeData = LangPackTranslateStringT(pimi->mi.hLangpack, mii.dwTypeData); + mii.dwTypeData = GetMenuItemText(pimi); InsertMenuItem( hMenu, uItem, TRUE, &mii); } -- cgit v1.2.3