]> git.lyx.org Git - features.git/commitdiff
Prevent inserting illegal flex insets from minibuffer
authorMartin Vermeer <martin.vermeer@hut.fi>
Sat, 8 Sep 2007 13:11:10 +0000 (13:11 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Sat, 8 Sep 2007 13:11:10 +0000 (13:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20140 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text3.cpp

index 14b4b946f555c3eaf8ff47c998d22ab83a6b3a99..d537f33633e6f7b871cc2d74710e11bfb09960ef 100644 (file)
@@ -1680,11 +1680,16 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_NOTE_INSERT:
                code = Inset::NOTE_CODE;
                break;
-       case LFUN_FLEX_INSERT:
+       case LFUN_FLEX_INSERT: {
                code = Inset::FLEX_CODE;
-               if (cur.buffer().params().getTextClass().insetlayouts().empty())
+               string s = cmd.getArg(0);
+               InsetLayout il =  cur.buffer().params().getTextClass().insetlayout(from_utf8(s));
+               if (il.lyxtype != "charstyle" &&
+                   il.lyxtype != "custom" &&
+                   il.lyxtype != "element")
                        enable = false;
                break;
+               }
        case LFUN_BOX_INSERT:
                code = Inset::BOX_CODE;
                break;