Fix crash due to the attempt to access paragraph() from within mathed while doing forward-search (bug #7992).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40638 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2012-01-20 13:08:33 +00:00
parent 25746dc622
commit 8fe2cecbdb
2 changed files with 10 additions and 2 deletions

View File

@ -3567,9 +3567,14 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
command = lyxrc.forward_search_pdf;
}
int row = doc_buffer->texrow().getRowFromIdPos(bv->cursor().paragraph().id(), bv->cursor().pos());
DocIterator tmpcur = bv->cursor();
// Leave math first
while (tmpcur.inMathed())
tmpcur.pop_back();
int row = tmpcur.inMathed() ? 0 : doc_buffer->texrow().getRowFromIdPos(
tmpcur.paragraph().id(), tmpcur.pos());
LYXERR(Debug::ACTION, "Forward search: row:" << row
<< " id:" << bv->cursor().paragraph().id());
<< " id:" << tmpcur.paragraph().id());
if (!row || command.empty()) {
dr.setMessage(_("Couldn't proceed."));
break;

View File

@ -171,6 +171,9 @@ What's new
- Fixed crash when moving out of nested empty items (bug 7673).
- Fix crash when performing "forward search" while cursor is in mathed
(bug 7992).
- Update citation labels when the BibTeX file changes (bug 7499).
- Mark Buffer dirty when changing branch activation status (bug 7872). Sadly,