From b9256773b6679164afcada5337648e39261acaea Mon Sep 17 00:00:00 2001 From: donho Date: Sun, 1 Jun 2008 15:22:11 +0000 Subject: [PATCH] [BEHAVIOUR_FIXED] Fix a minor behaviour in shorcutmapper. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@214 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/MISC/SysMsg/SysMsg.cpp | 9 +++++---- PowerEditor/src/MISC/SysMsg/SysMsg.h | 2 +- PowerEditor/src/Notepad_plus.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/MISC/SysMsg/SysMsg.cpp b/PowerEditor/src/MISC/SysMsg/SysMsg.cpp index 1baa96c94..f33a75eed 100644 --- a/PowerEditor/src/MISC/SysMsg/SysMsg.cpp +++ b/PowerEditor/src/MISC/SysMsg/SysMsg.cpp @@ -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; diff --git a/PowerEditor/src/MISC/SysMsg/SysMsg.h b/PowerEditor/src/MISC/SysMsg/SysMsg.h index fd1f62ba9..80cc5ffb9 100644 --- a/PowerEditor/src/MISC/SysMsg/SysMsg.h +++ b/PowerEditor/src/MISC/SysMsg/SysMsg.h @@ -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 diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 746cf54b7..6d97b9e80 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -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()); } }