15 moved, 23 dead, 1 bug squashed...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5122 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-08-27 15:23:01 +00:00
parent b3d8d0d1a2
commit ef17c169f4
3 changed files with 20 additions and 39 deletions

View File

@ -53,7 +53,6 @@
#include "insets/insetcite.h"
#include "insets/insetgraphics.h"
#include "insets/insetmarginal.h"
#include "insets/insettabular.h"
#include "insets/insetcaption.h"
#include "insets/insetfloatlist.h"
@ -68,7 +67,6 @@
#include <boost/bind.hpp>
#include <boost/signals/connection.hpp>
#include <cstdio>
#include <unistd.h>
#include <sys/wait.h>
@ -1560,25 +1558,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
}
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 ---------------------------
@ -1791,22 +1770,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
}
// 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

View File

@ -136,8 +136,6 @@ private:
int & x, int & y) const;
///
friend class BufferView;
/// open and lock an updatable inset
bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
///
void hfill();

View File

@ -28,14 +28,17 @@
#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;
@ -1088,6 +1091,23 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
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();