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
This commit is contained in:
Jean-Marc Lasgouttes 2005-05-31 10:20:42 +00:00
parent 61c245ca32
commit e80090a13e
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2005-05-31 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* bufferview_funcs.C (gotoInset): fix the wrap-around code to
avoid a crash (bug 1891)
2005-05-27 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
Fix bug 1892:

View File

@ -253,12 +253,15 @@ void gotoInset(BufferView * bv, vector<InsetBase_code> 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;
}
}