Op 6-10-2011 18:30, jri...@lyx.org schreef:
Author: jrioux
Date: Thu Oct 6 18:30:37 2011
New Revision: 39809
URL: http://www.lyx.org/trac/changeset/39809
Log:
Don't allow newline characters in the command buffer.
I actually got it by this bug while copy-pasting LFUNs into the toolbar.
Modified:
lyx-devel/trunk/src/frontends/qt4/GuiCommandBuffer.cpp
Modified: lyx-devel/trunk/src/frontends/qt4/GuiCommandBuffer.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiCommandBuffer.cpp Thu Oct 6
18:30:28 2011 (r39808)
+++ lyx-devel/trunk/src/frontends/qt4/GuiCommandBuffer.cpp Thu Oct 6
18:30:37 2011 (r39809)
@@ -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 @@
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()));
This is actually a useful trick to allow to use some lfuns which require
newlines.
Vincent