Fix crash when positioning cursor under some conditions, e.g., when finding in the sample documents attached to #6112.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31339 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Tommaso Cucinotta 2009-09-07 23:58:56 +00:00
parent 3b26afebc7
commit 9673d23f08

View File

@ -1887,6 +1887,7 @@ int BufferView::workHeight() const
void BufferView::setCursor(DocIterator const & dit) void BufferView::setCursor(DocIterator const & dit)
{ {
d->cursor_.reset(buffer().inset());
size_t const n = dit.depth(); size_t const n = dit.depth();
for (size_t i = 0; i < n; ++i) for (size_t i = 0; i < n; ++i)
dit[i].inset().edit(d->cursor_, true); dit[i].inset().edit(d->cursor_, true);