]> git.lyx.org Git - lyx.git/commitdiff
MenuDefinition::expandFlexInsert(): simplify a tiny bit.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 12 Oct 2008 06:52:26 +0000 (06:52 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 12 Oct 2008 06:52:26 +0000 (06:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26856 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/Menus.cpp

index 751c2e4a78a221275e1b895b361741844c46ad10..d532c9b80154c0aec68192788462de19c975a8cb 100644 (file)
@@ -850,18 +850,15 @@ void MenuDefinition::expandFlexInsert(Buffer const * buf, string s)
                buf->params().documentClass().insetLayouts();
        TextClass::InsetLayouts::const_iterator cit = insetLayouts.begin();
        TextClass::InsetLayouts::const_iterator end = insetLayouts.end();
-       bool addedOne = false;
        for (; cit != end; ++cit) {
                docstring const label = cit->first;
-               if (cit->second.lyxtype() == s) {
+               if (cit->second.lyxtype() == s)
                        addWithStatusCheck(MenuItem(MenuItem::Command, 
                                toqstr(translateIfPossible(label)),
                                FuncRequest(LFUN_FLEX_INSERT, label)));
-                       addedOne = true;
-               }
        }
        // FIXME This is a little clunky.
-       if (!addedOne && s == "custom")
+       if (items_.empty() && s == "custom")
                add(MenuItem(MenuItem::Command,
                                    qt_("No custom insets defined!"),
                                    FuncRequest(LFUN_NOACTION)));