From 4dd1fed397f6c4d916dddb06a65e9953607f1503 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 2 Apr 2009 20:08:25 +0000 Subject: [PATCH] branch: Fix disabling of submenus that are empty. see: http://www.lyx.org/trac/changeset/28027 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@29026 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/Menus.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index cee15467f0..4561093e52 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -339,8 +339,8 @@ void MenuDefinition::addWithStatusCheck(MenuItem const & i) } case MenuItem::Submenu: { + bool enabled = false; if (i.hasSubmenu()) { - bool enabled = false; for (const_iterator cit = i.submenu().begin(); cit != i.submenu().end(); ++cit) { if ((cit->kind() == MenuItem::Command @@ -350,13 +350,11 @@ void MenuDefinition::addWithStatusCheck(MenuItem const & i) break; } } - if (enabled || !i.optional()) { - items_.push_back(i); - items_.back().status().setEnabled(enabled); - } } - else + if (enabled || !i.optional()) { items_.push_back(i); + items_.back().status().setEnabled(enabled); + } break; }