]> git.lyx.org Git - lyx.git/commitdiff
Some more fixes to insettabular/text! (my last as single :)
authorJürgen Vigna <jug@sad.it>
Thu, 28 Sep 2000 15:07:29 +0000 (15:07 +0000)
committerJürgen Vigna <jug@sad.it>
Thu, 28 Sep 2000 15:07:29 +0000 (15:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1053 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/insets/insettabular.C

index f12e72d5b236019271b6fa89889f875b40047ba1..b5219563e9e8265ef7448276164c078a9e612c89 100644 (file)
--- 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.
        
index a1a160c1ea6338195687b210ac173a63a974081e..11211b1b1b263f6f6bee2c2f4c1e651d6f5688f2 100644 (file)
@@ -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 =