From c6e14e1536f00b441d823cf4e528445419bd089e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Vigna?= Date: Fri, 20 Apr 2001 14:54:25 +0000 Subject: [PATCH] Fixed setting cursor positions with mouse for TextInsets and CollapsableInsets. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1947 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 4 ++++ src/insets/insetcollapsable.C | 2 +- src/insets/insettext.C | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 18ed7f27d6..1ae41b2a6b 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2001-04-20 Juergen Vigna + + * insettext.C (Edit): call checkAndActivateInset with y=0 if y < 0. + 2001-04-18 Jean-Marc Lasgouttes * insetquotes.C (Latex): improve the guard against diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index 6fcd31120c..208a5fdf7b 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -251,7 +251,7 @@ void InsetCollapsable::Edit(BufferView * bv, int xp, int yp, } else if (!collapsed) { if (!bv->lockInset(this)) return; - inset.Edit(bv, xp, yp+(top_baseline - inset.y()), button); + inset.Edit(bv, xp, yp + (top_baseline - inset.y()), button); } } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index cd18251615..2d19e5e4ea 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -566,7 +566,8 @@ void InsetText::Edit(BufferView * bv, int x, int y, unsigned int button) inset_boundary = false; inset_par = 0; old_par = 0; - if (!checkAndActivateInset(bv, x, y, button)) + int tmp_y = (y < 0)?0:y; + if (!checkAndActivateInset(bv, x, tmp_y, button)) TEXT(bv)->SetCursorFromCoordinates(bv, x - drawTextXOffset, y + insetAscent); TEXT(bv)->sel_cursor = TEXT(bv)->cursor; @@ -737,7 +738,7 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button) return; } } - if (!inset && (button == 2)) { + if (!inset) { // && (button == 2)) { bool paste_internally = false; if ((button == 2) && TEXT(bv)->selection) { LocalDispatch(bv, LFUN_COPY, "");