[BEHAVIOUR_FIXED] Fix a minor behaviour in shorcutmapper.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@214 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
a3b344bbc2
commit
b9256773b6
@ -55,7 +55,7 @@ void writeLog(const char *logFileName, const char *log2write)
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string purgeMenuItemString(const char * menuItemStr)
|
std::string purgeMenuItemString(const char * menuItemStr, bool keepAmpersand)
|
||||||
{
|
{
|
||||||
char cleanedName[64] = "";
|
char cleanedName[64] = "";
|
||||||
size_t j = 0;
|
size_t j = 0;
|
||||||
@ -69,12 +69,13 @@ std::string purgeMenuItemString(const char * menuItemStr)
|
|||||||
}
|
}
|
||||||
else if (menuItemStr[k] == '&')
|
else if (menuItemStr[k] == '&')
|
||||||
{
|
{
|
||||||
//skip
|
if (keepAmpersand)
|
||||||
|
cleanedName[j++] = menuItemStr[k];
|
||||||
|
//else skip
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cleanedName[j] = menuItemStr[k];
|
cleanedName[j++] = menuItemStr[k];
|
||||||
j++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cleanedName[j] = 0;
|
cleanedName[j] = 0;
|
||||||
|
@ -26,6 +26,6 @@ void systemMessage(const char *title);
|
|||||||
void printInt(int int2print);
|
void printInt(int int2print);
|
||||||
void printStr(const char *str2print);
|
void printStr(const char *str2print);
|
||||||
void writeLog(const char *logFileName, const char *log2write);
|
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
|
#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])
|
if (!csc.getName()[0])
|
||||||
{ //no predefined name, get name from menu and use that
|
{ //no predefined name, get name from menu and use that
|
||||||
::GetMenuString(_mainMenuHandle, csc.getID(), menuName, 64, MF_BYCOMMAND);
|
::GetMenuString(_mainMenuHandle, csc.getID(), menuName, 64, MF_BYCOMMAND);
|
||||||
csc.setName(purgeMenuItemString(menuName).c_str());
|
csc.setName(purgeMenuItemString(menuName, true).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user