#include "menus.h"
#include "bufferview_funcs.h"
#include "frontends/Dialogs.h"
+#include "FloatList.h"
using std::pair;
using std::endl;
}
case LFUN_TABLE:
+#ifndef NEW_TABULAR
Table();
+#else
+ owner->getDialogs()->showTabularCreate();
+#endif
break;
case LFUN_FIGURE:
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;
}
break;
+ case LFUN_CREATE_CITATION:
+ {
+ owner->getDialogs()->createCitation( argument );
+ }
+ break;
+
case LFUN_INSERT_CITATION:
- {
- InsetCitation * new_inset = new InsetCitation();
- // ale970405
- // The note, if any, must be after the key, delimited
- // by a | so both key and remark can have spaces.
- if (!argument.empty()) {
- string lsarg(argument);
- if (contains(lsarg, "|")) {
- new_inset->setContents(token(lsarg, '|', 0));
- new_inset->setOptions(token(lsarg, '|', 1));
- } else
- new_inset->setContents(lsarg);
- if (!owner->view()->insertInset(new_inset))
- delete new_inset;
- } else {
- if (owner->view()->insertInset(new_inset))
- new_inset->Edit(owner->view(), 0, 0, 0);
- else
- delete new_inset;
- }
+ {
+ string keys = token(argument, '|', 0);
+ string text = token(argument, '|', 1);
+
+ InsetCitation * inset = new InsetCitation( keys, text );
+ if (!owner->view()->insertInset(inset))
+ delete inset;
+ else
+ owner->view()->updateInset( inset, true );
}
break;