[BEHAVIOUR_FIXED] Fix a minor behaviour in shorcutmapper.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@214 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
donho 17 years ago
parent a3b344bbc2
commit b9256773b6

@ -55,7 +55,7 @@ void writeLog(const char *logFileName, const char *log2write)
fclose(f);
}
std::string purgeMenuItemString(const char * menuItemStr)
std::string purgeMenuItemString(const char * menuItemStr, bool keepAmpersand)
{
char cleanedName[64] = "";
size_t j = 0;
@ -69,12 +69,13 @@ std::string purgeMenuItemString(const char * menuItemStr)
}
else if (menuItemStr[k] == '&')
{
//skip
if (keepAmpersand)
cleanedName[j++] = menuItemStr[k];
//else skip
}
else
{
cleanedName[j] = menuItemStr[k];
j++;
cleanedName[j++] = menuItemStr[k];
}
}
cleanedName[j] = 0;

@ -26,6 +26,6 @@ void systemMessage(const char *title);
void printInt(int int2print);
void printStr(const char *str2print);
void writeLog(const char *logFileName, const char *log2write);
std::string purgeMenuItemString(const char * menuItemStr);
std::string purgeMenuItemString(const char * menuItemStr, bool keepAmpersand = false);
#endif //M30_IDE_COMMUN_H

@ -6071,7 +6071,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
if (!csc.getName()[0])
{ //no predefined name, get name from menu and use that
::GetMenuString(_mainMenuHandle, csc.getID(), menuName, 64, MF_BYCOMMAND);
csc.setName(purgeMenuItemString(menuName).c_str());
csc.setName(purgeMenuItemString(menuName, true).c_str());
}
}

Loading…
Cancel
Save