mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Prevent assertion with command 'buffer-switch xxx' in which xxx is not the name of a loaded buffer.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28966 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
966ea2752e
commit
da242ecd12
@ -1963,9 +1963,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);
|
||||
|
Loading…
Reference in New Issue
Block a user