Fixed jumping mathed cursor in text-insets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1173 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2000-10-30 12:03:18 +00:00
parent 6349297015
commit 9a1425adcb
4 changed files with 24 additions and 15 deletions

View File

@ -1,3 +1,11 @@
2000-10-30 Juergen Vigna <jug@sad.it>
* src/insets/insettext.C (InsertInset): fixed this as the cursor
has to be Left of the inset otherwise LyXText won't find it!
* src/BufferView2.C (open_new_inset): delete the inset if it can
not be inserted.
2000-10-30 Rob Lahaye <lahaye@postech.edu>
* lyx.man: fix typo.

View File

@ -264,10 +264,12 @@ bool BufferView::open_new_inset(UpdatableInset * new_inset)
{
beforeChange();
text->FinishUndo();
if (!insertInset(new_inset))
if (!insertInset(new_inset)) {
delete new_inset;
return false;
text->CursorLeft(this);
update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
// text->CursorLeft(this);
// update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
new_inset->Edit(this, 0, 0, 0);
return true;
}

View File

@ -1266,16 +1266,14 @@ bool InsetText::InsertInset(BufferView * bv, Inset * inset)
bv->text->cursor.par()->next
#endif
);
if (inset->Editable() == Inset::IS_EDITABLE) {
UpdatableInset * i = static_cast<UpdatableInset *>(inset);
i->setOwner(static_cast<UpdatableInset *>(this));
}
inset->setOwner(this);
HideInsetCursor(bv);
TEXT(bv)->InsertInset(bv, inset);
TEXT(bv)->selection = 0;
TEXT(bv)->CursorLeft(bv);
bv->fitCursor(TEXT(bv));
UpdateLocal(bv, CURSOR_PAR, true);
static_cast<UpdatableInset*>(inset)->Edit(bv, 0, 0, 0);
// inset->Edit(bv, 0, 0, 0);
ShowInsetCursor(bv);
return true;
}

View File

@ -2585,13 +2585,14 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_INSERT_MATRIX:
{
if (owner->view()->available()) {
owner->view()->
open_new_inset(new InsetFormula(false));
owner->view()
->theLockingInset()
->LocalDispatch(owner->view(),
action,
argument);
if (owner->view()->
open_new_inset(new InsetFormula(false)))
{
owner->view()->theLockingInset()
->LocalDispatch(owner->view(),
action,
argument);
}
}
}
break;