[BUG_FIXED] If plugin function pointer is null, then it'll be added in menu as separator, but it won't be added in shortcut mapper list.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@162 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-04-05 22:11:25 +00:00
parent a80ee0d2fa
commit a4f36f3685
1 changed files with 8 additions and 2 deletions

View File

@ -204,7 +204,14 @@ void PluginsManager::setMenu(HMENU hMenu, const char *menuName)
for (int j = 0 ; j < _pluginInfos[i]->_nbFuncItem ; j++)
{
if (_pluginInfos[i]->_funcItems[j]._pFunc == NULL)
{
::InsertMenu(_pluginInfos[i]->_pluginMenu, j, MF_BYPOSITION | MF_SEPARATOR, 0, "");
continue;
}
_pluginsCommands.push_back(PluginCommand(_pluginInfos[i]->_moduleName, j, _pluginInfos[i]->_funcItems[j]._pFunc));
int cmdID = ID_PLUGINS_CMD + (_pluginsCommands.size() - 1);
_pluginInfos[i]->_funcItems[j]._cmdID = (_pluginInfos[i]->_funcItems[j]._pFunc == NULL)?0:cmdID;
string itemName = _pluginInfos[i]->_funcItems[j]._itemName;
@ -222,8 +229,7 @@ void PluginsManager::setMenu(HMENU hMenu, const char *menuName)
PluginCmdShortcut pcs(Shortcut(itemName.c_str(), false, false, false, 0x00), cmdID, _pluginInfos[i]->_moduleName, j); //VK_NULL and everything disabled, the menu name is left alone
pluginCmdSCList.push_back(pcs);
}
unsigned int flag = MF_BYPOSITION | ((_pluginInfos[i]->_funcItems[j]._pFunc == NULL)?MF_SEPARATOR:0);
::InsertMenu(_pluginInfos[i]->_pluginMenu, j, flag, (_pluginInfos[i]->_funcItems[j]._pFunc == NULL)?0:cmdID, itemName.c_str());
::InsertMenu(_pluginInfos[i]->_pluginMenu, j, MF_BYPOSITION, cmdID, itemName.c_str());
if (_pluginInfos[i]->_funcItems[j]._init2Check)
::CheckMenuItem(_hPluginsMenu, cmdID, MF_BYCOMMAND | MF_CHECKED);