From 1f3ac11ea23d0c6b5d5620cbb4ad9b37a8bacc32 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 2 Apr 2009 19:50:52 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiView.cpp | 10 ++++++++-- status.16x | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 8129ab3ef8..ababd24a94 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -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); diff --git a/status.16x b/status.16x index d122862024..5c2d359be0 100644 --- a/status.16x +++ b/status.16x @@ -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 " and there + is no buffer called . + - Adjust the color of deletions slightly when using change tracking. It is now easier to distinguish between added and deleted text (bug 5629).