From: Juergen Spitzmueller Date: Tue, 5 May 2015 12:23:24 +0000 (+0200) Subject: Do not insert non-rpintable characters (such as ASCII control characters) X-Git-Tag: 2.2.0alpha1~899 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4ba17c90a03fc5b50612a20604eba426f7dedcf6;p=features.git Do not insert non-rpintable characters (such as ASCII control characters) Fixes: #5704. --- diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 4822e59967..160df4a114 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -69,6 +69,7 @@ #include "support/lassert.h" #include "support/lstrings.h" #include "support/lyxalgo.h" // sorted +#include "support/textutils.h" #include "support/Messages.h" #include "support/os.h" #include "support/Package.h" @@ -2131,6 +2132,12 @@ void GuiApplication::processKeySym(KeySymbol const & keysym, KeyModifier state) // if it's normal insertable text not already covered // by a binding if (keysym.isText() && d->keyseq.length() == 1) { + // Non-printable characters (such as ASCII control characters) + // must not be inserted (#5704) + if (!isPrintable(encoded_last_key)) { + LYXERR(Debug::KEY, "Non-printable character! Omitting."); + return; + } LYXERR(Debug::KEY, "isText() is true, inserting."); func = FuncRequest(LFUN_SELF_INSERT, FuncRequest::KEYBOARD);