* BufferView_pimpl.C (getCurrentChange): do not assume that

LyXText at cursor position is the same as LyXText at
	cursor.selBegin() position. Fixes a crash (bug 2600).



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14936 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2006-09-08 12:17:45 +00:00
parent d3d994c9e7
commit 1822466e57

View File

@ -586,17 +586,11 @@ bool BufferView::Pimpl::available() const
Change const BufferView::Pimpl::getCurrentChange()
{
if (!buffer_->params().tracking_changes)
if (!buffer_->params().tracking_changes || !cursor_.selection())
return Change(Change::UNCHANGED);
LyXText * text = bv_->getLyXText();
LCursor & cur = cursor_;
if (!cur.selection())
return Change(Change::UNCHANGED);
return text->getPar(cur.selBegin().pit()).
lookupChange(cur.selBegin().pos());
DocIterator dit = cursor_.selectionBegin();
return dit.paragraph().lookupChange(dit.pos());
}