]> git.lyx.org Git - features.git/commitdiff
Before we process the LFUN, make sure that it is actually intended
authorRichard Heck <rgheck@lyx.org>
Sun, 15 Apr 2012 12:59:46 +0000 (08:59 -0400)
committerRichard Heck <rgheck@lyx.org>
Wed, 2 May 2012 21:30:52 +0000 (17:30 -0400)
for us.

src/insets/InsetBox.cpp

index a396157caad575d7f8ca957d6a4f4ef8b637c263..68bca75947ab9ae860cbefd31e53826e5ab06801 100644 (file)
@@ -190,10 +190,19 @@ void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_INSET_MODIFY: {
                //lyxerr << "InsetBox::dispatch MODIFY" << endl;
+               string const first_arg = cmd.getArg(0);
+               bool const change_type = first_arg == "changetype";
+               bool const for_box = first_arg == "box";
+               if (!change_type && !for_box) {
+                       // not for us
+                       // this will not be handled higher up
+                       cur.undispatched();
+                       return;
+               }
                cur.recordUndoInset(ATOMIC_UNDO, this);
-               if (cmd.getArg(0) == "changetype") {
+               if (change_type)
                        params_.type = cmd.getArg(1);
-               } else
+               else // if (for_box)
                        string2params(to_utf8(cmd.argument()), params_);
                setButtonLabel();
                break;