mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-24 13:48:59 +00:00
Fix disabling of submenus that are empty.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28027 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a16fabfb26
commit
f48e86dedc
@ -339,8 +339,8 @@ void MenuDefinition::addWithStatusCheck(MenuItem const & i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case MenuItem::Submenu: {
|
case MenuItem::Submenu: {
|
||||||
if (i.hasSubmenu()) {
|
|
||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
|
if (i.hasSubmenu()) {
|
||||||
for (const_iterator cit = i.submenu().begin();
|
for (const_iterator cit = i.submenu().begin();
|
||||||
cit != i.submenu().end(); ++cit) {
|
cit != i.submenu().end(); ++cit) {
|
||||||
if ((cit->kind() == MenuItem::Command
|
if ((cit->kind() == MenuItem::Command
|
||||||
@ -350,13 +350,11 @@ void MenuDefinition::addWithStatusCheck(MenuItem const & i)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (enabled || !i.optional()) {
|
if (enabled || !i.optional()) {
|
||||||
items_.push_back(i);
|
items_.push_back(i);
|
||||||
items_.back().status().setEnabled(enabled);
|
items_.back().status().setEnabled(enabled);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
items_.push_back(i);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user