From 3412eeffda7993aa93ac8333df3092e76c597742 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Thu, 28 Sep 2000 15:07:29 +0000 Subject: [PATCH] Some more fixes to insettabular/text! (my last as single :) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1053 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 1 + src/insets/insettabular.C | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f12e72d5b2..b5219563e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * src/insets/insettabular.C (update): fixed cursor setting when the_locking_inset changed. (draw): made this a bit cleaner. + (InsetButtonPress): fixed! * various files: added LyXText Parameter to fitCursor call. diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index a1a160c1ea..11211b1b1b 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -292,9 +292,9 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, tabular->GetAdditionalHeight(cell); } if (the_locking_inset == tabular->GetCellInset(cell)) { - cx = nx + tabular->GetBeginningOfTextInCell(cell); LyXText::text_status st = bv->text->status; do { + cx = nx + tabular->GetBeginningOfTextInCell(cell); bv->text->status = st; if (need_update == CELL) { // clear before the inset @@ -398,9 +398,9 @@ void InsetTabular::update(BufferView * bv, LyXFont const & font, bool reinit) } if (the_locking_inset) { the_locking_inset->update(bv, font, reinit); - resetPos(bv); - inset_x = cursor.x() - top_x + tabular->GetBeginningOfTextInCell(actcell); - inset_y = cursor.y(); +// resetPos(bv); +// inset_x = cursor.x() - top_x + tabular->GetBeginningOfTextInCell(actcell); +// inset_y = cursor.y(); } switch(need_update) { case INIT: @@ -604,6 +604,8 @@ void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int button) bool const inset_hit = InsetHit(bv, x, y); if ((ocell == actcell) && the_locking_inset && inset_hit) { + cursor.pos(0); // always before the inset! + resetPos(bv); the_locking_inset->InsetButtonPress(bv, x - inset_x, y - inset_y, button); return; @@ -1548,7 +1550,7 @@ bool InsetTabular::ActivateCellInset(BufferView * bv, int x, int y, int button, // the cursor.pos has to be before the inset so if it isn't now just // reset the curor pos first! if (!cellstart(cursor.pos())) { - cursor.pos((cursor.pos() - 1) % 2); + cursor.pos(0); resetPos(bv); } UpdatableInset * inset = -- 2.39.2