branch: Prevent assertion with command 'buffer-switch xxx' in which xxx is not the name of a loaded buffer.

see:
http://www.lyx.org/trac/changeset/28966


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@29022 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-04-02 19:50:52 +00:00
parent f1b242b62a
commit 1f3ac11ea2
2 changed files with 11 additions and 2 deletions

View File

@ -1886,9 +1886,15 @@ bool GuiView::dispatch(FuncRequest const & cmd)
importDocument(to_utf8(cmd.argument()));
break;
case LFUN_BUFFER_SWITCH:
setBuffer(theBufferList().getBuffer(FileName(to_utf8(cmd.argument()))));
case LFUN_BUFFER_SWITCH: {
Buffer * buffer =
theBufferList().getBuffer(FileName(to_utf8(cmd.argument())));
if (buffer)
setBuffer(buffer);
else
bv->cursor().message(_("Document not loaded"));
break;
}
case LFUN_BUFFER_NEXT:
gotoNextOrPreviousBuffer(NEXTBUFFER);

View File

@ -117,6 +117,9 @@ What's new
of the date-insert function. This fixes a crash on Windows with invalid/
unsupported date specifiers (bug 5827).
- Fix crash when issuing the command "buffer-switch <buffer>" and there
is no buffer called <buffer>.
- Adjust the color of deletions slightly when using change tracking. It
is now easier to distinguish between added and deleted text (bug 5629).