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> 2000-10-30 Rob Lahaye <lahaye@postech.edu>
* lyx.man: fix typo. * lyx.man: fix typo.

View File

@ -264,10 +264,12 @@ bool BufferView::open_new_inset(UpdatableInset * new_inset)
{ {
beforeChange(); beforeChange();
text->FinishUndo(); text->FinishUndo();
if (!insertInset(new_inset)) if (!insertInset(new_inset)) {
delete new_inset;
return false; 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); new_inset->Edit(this, 0, 0, 0);
return true; return true;
} }

View File

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

View File

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