]> git.lyx.org Git - features.git/blobdiff - src/lyxfunc.C
read the Changelog
[features.git] / src / lyxfunc.C
index 8a7eb37bc8218039bf4bd5303129e3ac874b5e19..164a193fb89cb8d3fbd67091716f60439b8db878 100644 (file)
@@ -88,6 +88,7 @@ using std::istringstream;
 #include "menus.h"
 #include "bufferview_funcs.h"
 #include "frontends/Dialogs.h"
+#include "FloatList.h"
 
 using std::pair;
 using std::endl;
@@ -869,7 +870,11 @@ string LyXFunc::Dispatch(int ac,
        }
                
        case LFUN_TABLE:
+#ifndef NEW_TABULAR
                Table();
+#else
+               owner->getDialogs()->showTabularCreate();
+#endif
                break;
                
        case LFUN_FIGURE:
@@ -2062,11 +2067,18 @@ string LyXFunc::Dispatch(int ac,
 
        case LFUN_INSET_FLOAT:
        {
-               InsetFloat * new_inset = new InsetFloat;
-               if (owner->view()->insertInset(new_inset))
-                       new_inset->Edit(owner->view(), 0, 0, 0);
-               else
-                       delete new_inset;
+               // check if the float type exist
+               if (floatList.typeExist(argument)) {
+                       InsetFloat * new_inset = new InsetFloat(argument);
+                       if (owner->view()->insertInset(new_inset))
+                               new_inset->Edit(owner->view(), 0, 0, 0);
+                       else
+                               delete new_inset;
+               } else {
+                       lyxerr << "Non-existant float type: "
+                              << argument << endl;
+               }
+               
        }
        break;