Fixed insetlocking-mechanism and PARAGRAPH_GOTO func.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3407 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2002-01-17 14:27:01 +00:00
parent 637e368f1c
commit 1e775a68c6
6 changed files with 35 additions and 9 deletions

View File

@ -520,7 +520,7 @@ bool BufferView::lockInset(UpdatableInset * inset)
}
if ((*it)->getInsetFromID(id)) {
text->setCursorIntern(this, par, it.getPos());
theLockingInset(static_cast<UpdatableInset *>(*it));
(*it)->edit(this);
return theLockingInset()->lockInsetInInset(this, inset);
}
}

View File

@ -1,3 +1,10 @@
2002-01-17 Juergen Vigna <jug@sad.it>
* lyxfunc.C (dispatch): fixed PARAGRAPH_GOTO
* BufferView2.C (lockInset): call edit() so that theLockingInset()
is set correctly and the inset is updated correctly.
2002-01-17 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* CutAndPaste.C (pasteSelection): move the setInsetOwner call at

View File

@ -1,7 +1,13 @@
2002-01-17 Juergen Vigna <jug@sad.it>
* insettabular.C (lockInsetInInset): same change as in insettext.
* insettext.C (draw): width() function was called without setting
the right top_x which could lead to wrong insetWidth setting!
(lockInsetInInset): call edit instead of calling lockInset if we
have to lock an inset inside!
(edit): we have to also tell the inset that we have to redraw the
frame on an edit call if this inset draws a frame only if locked.
2002-01-16 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>

View File

@ -645,9 +645,10 @@ bool InsetTabular::lockInsetInInset(BufferView * bv, UpdatableInset * inset)
}
if (in->getInsetFromID(id)) {
actcell = i;
the_locking_inset = in;
locked = true;
resetPos(bv);
in->edit(bv);
// the_locking_inset = in;
// locked = true;
// resetPos(bv);
return the_locking_inset->lockInsetInInset(bv, inset);
}
}

View File

@ -668,7 +668,11 @@ void InsetText::edit(BufferView * bv, int x, int y, unsigned int button)
showInsetCursor(bv);
if (clear)
lt = 0;
updateLocal(bv, CURSOR, false);
int code = CURSOR;
if (drawFrame_ == LOCKED)
code = CURSOR|DRAW_FRAME;
updateLocal(bv, code, false);
}
@ -713,7 +717,10 @@ void InsetText::edit(BufferView * bv, bool front)
showInsetCursor(bv);
if (clear)
lt = 0;
updateLocal(bv, CURSOR, false);
int code = CURSOR;
if (drawFrame_ == LOCKED)
code = CURSOR|DRAW_FRAME;
updateLocal(bv, code, false);
}
@ -785,7 +792,7 @@ bool InsetText::lockInsetInInset(BufferView * bv, UpdatableInset * inset)
}
if ((*it)->getInsetFromID(id)) {
getLyXText(bv)->setCursorIntern(bv, p, it.getPos());
lockInset(bv, static_cast<UpdatableInset *>(*it));
(*it)->edit(bv);
return the_locking_inset->lockInsetInInset(bv, inset);
}
}

View File

@ -1397,7 +1397,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
case LFUN_GOTO_PARAGRAPH:
{
istringstream istr(argument.c_str());
istringstream istr(argument.c_str());
int id;
istr >> id;
@ -1411,8 +1411,13 @@ string const LyXFunc::dispatch(kb_action action, string argument)
<< " found." << endl;
}
if (owner->view()->theLockingInset())
owner->view()->unlockInset(owner->view()->theLockingInset());
if (par->inInset()) {
par->inInset()->edit(owner->view());
}
// Set the cursor
owner->view()->text->setCursor(owner->view(), par, 0);
owner->view()->getLyXText()->setCursor(owner->view(), par, 0);
owner->view()->setState();
owner->showState();