diff --git a/PowerEditor/src/MISC/SysMsg/SysMsg.cpp b/PowerEditor/src/MISC/SysMsg/SysMsg.cpp index 1baa96c9..f33a75ee 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 fd1f62ba..80cc5ffb 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 746cf54b..6d97b9e8 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()); } }