From a9259a595cddfb90a3327b7857de21fcedb1b5fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Thu, 20 Dec 2001 16:08:02 +0000 Subject: [PATCH] Fixed crash in undo_cursor putting and better saving of the undo_cursor in not locked tabular cells. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3256 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 +++++- src/insets/ChangeLog | 3 +++ src/insets/inset.C | 2 ++ src/undo_funcs.C | 12 +++++++++--- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b457cc0fa5..9855ab701f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-12-20 Juergen Vigna + + * undo_funcs.C (textHandleUndo): fixed crash when undo_cursor not + inside inset but undo_par was. + 2001-12-19 Jean-Marc Lasgouttes * Thesaurus.C: always include 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 * tabular.[Ch]: better support for longtabular options (not finished diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index b5477a92ba..cb245e1293 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,5 +1,8 @@ 2001-12-20 Juergen Vigna + * 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 diff --git a/src/insets/inset.C b/src/insets/inset.C index 85248d564c..bda005592d 100644 --- a/src/insets/inset.C +++ b/src/insets/inset.C @@ -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; } diff --git a/src/undo_funcs.C b/src/undo_funcs.C index 2a8120d762..e54aab24a7 100644 --- a/src/undo_funcs.C +++ b/src/undo_funcs.C @@ -228,9 +228,15 @@ bool textHandleUndo(BufferView * bv, Undo * undo) bv->text->cursor.par()); if (tmppar){ it = static_cast(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()); -- 2.39.2