From e80090a13e396468a914c11cfb8b5ed442c917e8 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 31 May 2005 10:20:42 +0000 Subject: [PATCH] fix bug 1891: assertions with triggered by bad gotoInset code git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9985 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/bufferview_funcs.C | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index cb46f40a5d..7fb5ea2934 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-05-31 Jean-Marc Lasgouttes + + * bufferview_funcs.C (gotoInset): fix the wrap-around code to + avoid a crash (bug 1891) + 2005-05-27 Jean-Marc Lasgouttes Fix bug 1892: diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index 170ed0b80e..3135a75461 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -253,12 +253,15 @@ void gotoInset(BufferView * bv, vector const & codes, } if (!gotoNextInset(tmpcur, codes, contents)) { - if (tmpcur != doc_iterator_begin(tmpcur.inset())) { + if (bv->cursor() != doc_iterator_begin(bv->buffer()->inset())) { tmpcur.reset(tmpcur.bottom().inset()); - if (!gotoNextInset(tmpcur, codes, contents)) + if (!gotoNextInset(tmpcur, codes, contents)) { bv->cursor().message(_("No more insets")); + return; + } } else { bv->cursor().message(_("No more insets")); + return; } }