]> git.lyx.org Git - features.git/commitdiff
Fixed crash in undo_cursor putting and better saving of the undo_cursor in
authorJürgen Vigna <jug@sad.it>
Thu, 20 Dec 2001 16:08:02 +0000 (16:08 +0000)
committerJürgen Vigna <jug@sad.it>
Thu, 20 Dec 2001 16:08:02 +0000 (16:08 +0000)
not locked tabular cells.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3256 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/insets/ChangeLog
src/insets/inset.C
src/undo_funcs.C

index b457cc0fa52602d5c5da3cb96618a16fe95bb852..9855ab701f75efaebe44c54ade39c2cc8758aa5e 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-20  Juergen Vigna  <jug@sad.it>
+
+       * undo_funcs.C (textHandleUndo): fixed crash when undo_cursor not
+       inside inset but undo_par was.
+
 2001-12-19  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * Thesaurus.C: always include <config.h> in sources.
@@ -35,7 +40,6 @@
        * tabular_funcs.[hC]: added and moved here all not classfunctions
        of LyXTabular.
 
->>>>>>> 1.472
 2001-12-19  Juergen Vigna  <jug@sad.it>
 
        * tabular.[Ch]: better support for longtabular options (not finished
index b5477a92ba5a3ee4e15764a993a50df0f0abb717..cb245e129361875338df2b23f9b1cf5da5438388 100644 (file)
@@ -1,5 +1,8 @@
 2001-12-20  Juergen Vigna  <jug@sad.it>
 
+       * inset.C (cursor): return the owners cursor if available instead of
+       always only the bv->text->cursor.
+
        * insettabular.C (checkLongtableSpecial): works now.
 
 2001-12-19  Juergen Vigna  <jug@sad.it>
index 85248d564c11e1fde09c9aa0563a745e44c4e02f..bda005592db4fd2ad4b0c62b0d28b587b1d13539 100644 (file)
@@ -347,6 +347,8 @@ int UpdatableInset::getMaxWidth(BufferView * bv, UpdatableInset const *) const
 
 LyXCursor const & Inset::cursor(BufferView * bv) const
 {
+       if (owner())
+               return owner()->getLyXText(bv, false)->cursor;
        return bv->text->cursor;
 }
 
index 2a8120d762f6bd8df3684dee1bbe0877a3f52321..e54aab24a7e1d7841a9739badc49d7393b939387 100644 (file)
@@ -228,9 +228,15 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
                                                                         bv->text->cursor.par());
                        if (tmppar){
                                it = static_cast<UpdatableInset*>(tmppar->inInset());
-                               it->edit(bv);
-                               it->getLyXText(bv)->setCursorIntern(bv, tmppar, undo->cursor_pos);
-                               it->getLyXText(bv)->updateCounters(bv, it->getLyXText(bv)->cursor.row());
+                               LyXText * t;
+                               if (it) {
+                                       it->edit(bv);
+                                       t = it->getLyXText(bv);
+                               } else {
+                                       t = bv->text;
+                               }
+                               t->setCursorIntern(bv, tmppar, undo->cursor_pos);
+                               t->updateCounters(bv, t->cursor.row());
                        }
                        bv->text->setCursorIntern(bv, bv->text->cursor.par(),
                                                                          bv->text->cursor.pos());