From 7d4ca5033e2ab56f9334a7637c958f689484d335 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Fri, 30 Apr 2010 22:23:19 +0000 Subject: [PATCH] Implement LFUN_UNICODE_INSERT in mathed. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34351 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathNest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 21b16a7258..e68d3b517e 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1193,7 +1193,23 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) cur.niceInsert(cmd.argument()); } break; + } + + case LFUN_UNICODE_INSERT: { + if (cmd.argument().empty()) + break; + docstring hexstring = cmd.argument(); + if (isHex(hexstring)) { + char_type c = hexToInt(hexstring); + if (c >= 32 && c < 0x10ffff) { + docstring s = docstring(1, c); + FuncCode code = currentMode() == MATH_MODE ? + LFUN_MATH_INSERT : LFUN_SELF_INSERT; + lyx::dispatch(FuncRequest(code, s)); + } } + break; + } case LFUN_DIALOG_SHOW_NEW_INSET: { docstring const & name = cmd.argument(); -- 2.39.5