- case LFUN_INDEX_INSERT:
- // Just open the inset
- doInsertInset(cur, this, cmd, true, false);
+ case LFUN_TABULAR_INSERT:
+ // if there were no arguments, just open the dialog
+ if (doInsertInset(cur, this, cmd, false, true))
+ cur.posRight();
+ else
+ bv->owner()->getDialogs().show("tabularcreate");
+
+ break;
+
+ case LFUN_FLOAT_INSERT:
+ case LFUN_FLOAT_WIDE_INSERT:
+ case LFUN_WRAP_INSERT:
+ doInsertInset(cur, this, cmd, true, true);
+ cur.posRight();
+ // FIXME: the "Caption" name should not be hardcoded,
+ // but given by the float definition.
+ cur.dispatch(FuncRequest(LFUN_LAYOUT, "Caption"));
+ break;
+
+ case LFUN_INDEX_INSERT: {
+ InsetBase * inset = createInset(&cur.bv(), cmd);
+ if (!inset)
+ break;
+
+ recordUndo(cur);
+ cur.clearSelection();
+ insertInset(cur, inset);
+ inset->edit(cur, true);