Don't call edit() on not higly editable insets if we're just called edit().

In Highly editable inset we have to to enter it with the cursor (fix #387).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4155 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2002-05-14 09:10:14 +00:00
parent ed8a3124f3
commit 9e534c8750
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2002-05-14 Juergen Vigna <jug@sad.it>
* insettext.C (edit): tell checkAndActivateInset() that we don't
have a button press.
(checkAndActivateInset): if button < 0 we don't have a button press
on the inset and os we won't call edit on it if it's not a Highly
editable inset (then we have to enter it).
2002-05-13 Juergen Vigna <jug@sad.it>
* insetcollapsable.C (insetButtonRelease): returned wrong return

View File

@ -695,7 +695,10 @@ void InsetText::edit(BufferView * bv, int x, int y, unsigned int button)
lt = getLyXText(bv);
clear = true;
}
if (!checkAndActivateInset(bv, x, tmp_y, button)) {
// we put here -1 and not button as now the button in the
// edit call should not be needed we will fix this in 1.3.x
// cycle hopefully (Jug 20020509)
if (!checkAndActivateInset(bv, x, tmp_y, -1)) {
lt->setCursorFromCoordinates(bv, x - drawTextXOffset,
y + insetAscent);
lt->cursor.x_fix(lt->cursor.x());
@ -2067,6 +2070,11 @@ bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
int dummyx = x;
int dummyy = y + insetAscent;
Inset * inset = bv->checkInsetHit(getLyXText(bv), dummyx, dummyy);
// we only do the edit() call if the inset was hit by the mouse
// or if it is a highly editable inset. So we should call this
// function from our own edit with button < 0.
if (button < 0 && !isHighlyEditableInset(inset))
return false;
if (inset) {
if (x < 0)