diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index 3c1704d31..87ca7afa3 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -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);