fix disabling of submenu items

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4956 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-08-13 12:49:10 +00:00
parent 0b210f086d
commit d5bf18637f
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2002-08-13 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Menubar_pimpl.C (create_submenu): fix code to disable submenu
entries.
2002-08-12 Lars Gullik Bjønnes <larsbj@gullik.net>
* FormDocument.C (saveParamsAsDefault): use proper constructment

View File

@ -237,6 +237,7 @@ int Menubar::Pimpl::create_submenu(Window win, XFormsView * view,
it = extra_labels.begin();
size_type count = 0;
all_disabled = true;
int curmenuid = menuid;
for (Menu::const_iterator i = menu.begin(); i != end; ++i, ++it) {
MenuItem const & item = (*i);
@ -318,14 +319,16 @@ int Menubar::Pimpl::create_submenu(Window win, XFormsView * view,
}
case MenuItem::Submenu: {
bool sub_all_disabled;
int submenuid = create_submenu(win, view,
*item.submenu(), smn,
all_disabled);
sub_all_disabled);
all_disabled &= sub_all_disabled;
if (submenuid == -1)
return -1;
string label = fixlabel(item.label());
label += extra_label + "%m";
if (all_disabled)
if (sub_all_disabled)
label += "%i";
string shortcut = item.shortcut();
if (!shortcut.empty()) {