#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;
- 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 ---------------------------
}
-// 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
#include "frontends/LyXView.h"
#include "frontends/screen.h"
#include "frontends/WorkArea.h"
+#include "frontends/Dialogs.h"
#include "insets/insetspecialchar.h"
#include "insets/insettext.h"
#include "insets/insetquotes.h"
#include "insets/insetcommand.h"
+#include "insets/insettabular.h"
#include "undo_funcs.h"
#include <ctime>
#include <clocale>
+#include <cstdio>
using std::endl;
break;
}
+ case LFUN_TABULAR_INSERT:
+ if (cmd.argument.empty())
+ bv->owner()->getDialogs().showTabularCreate();
+ else {
+ int r = 2;
+ int c = 2;
+ ::sscanf(cmd.argument.c_str(),"%d%d", &r, &c);
+ InsetTabular * inset = new InsetTabular(*bv->buffer(), r, c);
+ bv->beforeChange(this);
+ finishUndo();
+ if (!bv->insertInset(inset))
+ delete inset;
+ else
+ inset->edit(bv, !real_current_font.isRightToLeft());
+ }
+ break;
+
case LFUN_QUOTE: {
Paragraph const * par = cursor.par();
lyx::pos_type pos = cursor.pos();