]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.cpp
DocBook: escape IDs for InsetRef.
[lyx.git] / src / insets / InsetFloat.cpp
index fbef084cae0a5f63faf3f2073a9cf92410b253bd..1cd614e5ce073a69b8367f5580ad0e101f878af3 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <config.h>
-#include <typeinfo>
 
 #include "InsetBox.h"
 #include "InsetCaption.h"
@@ -163,6 +162,11 @@ void InsetFloat::doDispatch(Cursor & cur, FuncRequest & cmd)
        switch (cmd.action()) {
 
        case LFUN_INSET_MODIFY: {
+               if (!buffer().params().documentClass().floats().typeExist(cmd.getArg(0))) {
+                       // not for us: pass further.
+                       cur.undispatched();
+                       break;
+               }
                InsetFloatParams params;
                string2params(to_utf8(cmd.argument()), params);
                cur.recordUndoInset(this);
@@ -201,6 +205,9 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
        switch (cmd.action()) {
 
        case LFUN_INSET_MODIFY:
+               if (!buffer().params().documentClass().floats().typeExist(cmd.getArg(0)))
+                       return Inset::getStatus(cur, cmd, flag);
+       // fall through
        case LFUN_INSET_DIALOG_UPDATE:
                flag.setEnabled(true);
                return true;