From: Julien Rioux Date: Thu, 6 Oct 2011 16:30:37 +0000 (+0000) Subject: Don't allow newline characters in the command buffer. X-Git-Tag: 2.1.0beta1~2619 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=bb4f6360c30ebddef74038e80991e7d292c3037d;p=lyx.git Don't allow newline characters in the command buffer. I actually got it by this bug while copy-pasting LFUNs into the toolbar. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39809 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiCommandBuffer.cpp b/src/frontends/qt4/GuiCommandBuffer.cpp index 0d19a49242..1767250166 100644 --- a/src/frontends/qt4/GuiCommandBuffer.cpp +++ b/src/frontends/qt4/GuiCommandBuffer.cpp @@ -18,6 +18,7 @@ #include "GuiCommandEdit.h" #include "GuiView.h" #include "qt_helpers.h" +#include "Validator.h" #include "BufferView.h" #include "Cursor.h" @@ -107,6 +108,7 @@ GuiCommandBuffer::GuiCommandBuffer(GuiView * view) edit_ = new GuiCommandEdit(this); edit_->setMinimumSize(edit_->sizeHint()); edit_->setFocusPolicy(Qt::ClickFocus); + edit_->setValidator(new NoNewLineValidator(edit_)); connect(edit_, SIGNAL(escapePressed()), this, SLOT(cancel())); connect(edit_, SIGNAL(returnPressed()), this, SLOT(dispatch()));