From 9e534c875089b8f932d27b21d1f8366bb0969056 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Tue, 14 May 2002 09:10:14 +0000 Subject: [PATCH] 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 --- src/insets/ChangeLog | 8 ++++++++ src/insets/insettext.C | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 59ba20971e..124408ac9b 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,11 @@ +2002-05-14 Juergen Vigna + + * 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 * insetcollapsable.C (insetButtonRelease): returned wrong return diff --git a/src/insets/insettext.C b/src/insets/insettext.C index c4062bdba8..a2190ca1da 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -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,7 +2070,12 @@ 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) x = insetWidth; -- 2.39.5