]> git.lyx.org Git - features.git/commitdiff
Fix bug 5346.
authorRichard Heck <rgheck@comcast.net>
Sun, 12 Oct 2008 04:04:55 +0000 (04:04 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 12 Oct 2008 04:04:55 +0000 (04:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26854 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/Menus.cpp

index 22f85369f0f2ca2567df949a45137c6709a60523..d730710ec6bade67386dfb9b6b7c1f348aa1f8f3 100644 (file)
@@ -850,13 +850,20 @@ 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;
+               }
        }
+       if (!addedOne)
+               add(MenuItem(MenuItem::Command,
+                                   qt_("No custom insets defined!"),
+                                   FuncRequest(LFUN_NOACTION)));
 }