Be careful to take in account buffer closing in command-sequence

This is a regression wrt 1.6. Abdel, please double-check.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31859 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-11-04 16:28:52 +00:00
parent d833a023f6
commit 5ea9cd8b91

View File

@ -390,9 +390,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
// FIXME: this LFUN should also work without any view. // FIXME: this LFUN should also work without any view.
Buffer * buffer = (lv && lv->documentBufferView()) Buffer * buffer = (lv && lv->documentBufferView())
? &(lv->documentBufferView()->buffer()) : 0; ? &(lv->documentBufferView()->buffer()) : 0;
buffer = &lv->currentBufferView()->buffer();
if (buffer && !theBufferList().isLoaded(buffer))
buffer = 0;
if (buffer) if (buffer)
buffer->undo().beginUndoGroup(); buffer->undo().beginUndoGroup();
while (!arg.empty()) { while (!arg.empty()) {
@ -402,7 +399,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
func.origin = cmd.origin; func.origin = cmd.origin;
dispatch(func); dispatch(func);
} }
if (buffer) // the buffer may have been closed by one action
if (theBufferList().isLoaded(buffer))
buffer->undo().endUndoGroup(); buffer->undo().endUndoGroup();
break; break;
} }