#include "ParagraphParameters.h"
#include "undo_funcs.h"
#include "funcrequest.h"
-#include "factory.h"
#include "insets/insetbib.h"
#include "insets/insettext.h"
#include "insets/insetcite.h"
#include "insets/insetgraphics.h"
#include "insets/insetmarginal.h"
-#include "insets/insettabular.h"
#include "insets/insetcaption.h"
#include "insets/insetfloatlist.h"
#include <boost/bind.hpp>
#include <boost/signals/connection.hpp>
-#include <cstdio>
#include <unistd.h>
#include <sys/wait.h>
}
break;
-#if 0
- case LFUN_INSET_LIST:
- case LFUN_INSET_THEOREM:
-#endif
- case LFUN_INSERT_NOTE:
- case LFUN_INSET_ERT:
- case LFUN_INSET_EXTERNAL:
- case LFUN_INSET_FLOAT:
- case LFUN_INSET_FOOTNOTE:
- case LFUN_INSET_MARGINAL:
- case LFUN_INSET_MINIPAGE:
- case LFUN_INSET_OPTARG:
- case LFUN_INSET_WIDE_FLOAT:
- {
- FuncRequest cmd = ev;
- cmd.setView(bv_);
- Inset * inset = createInset(cmd);
- if (inset) {
- bool gotsel = false;
-
- if (bv_->getLyXText()->selection.set()) {
- bv_->getLyXText()->cutSelection(bv_, true, false);
- gotsel = true;
- }
-
- if (insertInset(inset)) {
- inset->edit(bv_);
- if (gotsel)
- owner_->dispatch(FuncRequest(LFUN_PASTESELECTION));
- }
- else
- delete inset;
- }
- break;
- }
-
case LFUN_INSET_CAPTION:
{
// Do we have a locking inset...
}
break;
- case LFUN_TABULAR_INSERT:
- {
- if (ev.argument.empty()) {
- owner_->getDialogs().showTabularCreate();
- break;
- }
-
- int r = 2;
- int c = 2;
- ::sscanf(ev.argument.c_str(),"%d%d", &r, &c);
- InsetTabular * new_inset =
- new InsetTabular(*buffer_, r, c);
- bool const rtl =
- bv_->getLyXText()->real_current_font.isRightToLeft();
- if (!open_new_inset(new_inset, rtl))
- delete new_inset;
- }
- break;
-
// --- accented characters ---------------------------
break;
case LFUN_FLOAT_LIST:
- if (floatList.typeExist(ev.argument)) {
+ if (tclass.floats().typeExist(ev.argument)) {
Inset * inset = new InsetFloatList(ev.argument);
if (!insertInset(inset, tclass.defaultLayoutName()))
delete inset;
}
-// Open and lock an updatable inset
-bool BufferView::Pimpl::open_new_inset(UpdatableInset * new_inset, bool behind)
-{
- LyXText * lt = bv_->getLyXText();
-
- beforeChange(lt);
- finishUndo();
- if (!insertInset(new_inset)) {
- delete new_inset;
- return false;
- }
- new_inset->edit(bv_, !behind);
- return true;
-}
-
-
bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
{
// if we are in a locking inset we should try to insert the