Georg's fix for my crash moved too much inside the inTexted() crash: We

never update the buffer if we're not in text!!


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36782 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-12-08 21:46:57 +00:00
parent 51de359770
commit ea23ded591

View File

@ -1113,18 +1113,18 @@ void GuiApplication::dispatch(FuncRequest const & cmd)
// Actually, this test ought not to be done at all, since the // Actually, this test ought not to be done at all, since the
// whole InsetBibitem business is a mess. But that is a different // whole InsetBibitem business is a mess. But that is a different
// story. // story.
int moveCursor = 0;
if (cursor.inTexted()) { if (cursor.inTexted()) {
int const moveCursor = cursor.paragraph().checkBiblio(buf); moveCursor = cursor.paragraph().checkBiblio(buf);
if (moveCursor > 0) if (moveCursor > 0)
cursor.posForward(); cursor.posForward();
else if (moveCursor < 0 && cursor.pos() >= -moveCursor) else if (moveCursor < 0 && cursor.pos() >= -moveCursor)
cursor.posBackward(); cursor.posBackward();
}
if (moveCursor != 0 || dr.needBufferUpdate()) { if (moveCursor != 0 || dr.needBufferUpdate()) {
cursor.clearBufferUpdate(); cursor.clearBufferUpdate();
buf.updateBuffer(); buf.updateBuffer();
} }
}
// BufferView::update() updates the ViewMetricsInfo and // BufferView::update() updates the ViewMetricsInfo and
// also initializes the position cache for all insets in // also initializes the position cache for all insets in
// (at least partially) visible top-level paragraphs. // (at least partially) visible top-level paragraphs.