From b1996016e044fac5daf25527cfd18cc3bf9aa5e9 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 2 Feb 2009 13:42:07 +0000 Subject: [PATCH] disable math functions in places like ERT insets (bug 5703) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@28321 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text3.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index 0c43320ed9..37ff51fc8a 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -2241,6 +2241,14 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, enable = !inDescriptionItem(cur); break; + case LFUN_MATH_INSERT: + case LFUN_MATH_MATRIX: + case LFUN_MATH_DELIM: + case LFUN_MATH_BIGDELIM: + // not allowed in ERT, for example. + enable = cur.inset().insetAllowed(MATH_CODE); + break; + case LFUN_WORD_DELETE_FORWARD: case LFUN_WORD_DELETE_BACKWARD: case LFUN_LINE_DELETE: @@ -2292,10 +2300,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_MATH_DISPLAY: case LFUN_MATH_MODE: case LFUN_MATH_MACRO: - case LFUN_MATH_MATRIX: - case LFUN_MATH_DELIM: - case LFUN_MATH_BIGDELIM: - case LFUN_MATH_INSERT: case LFUN_MATH_SUBSCRIPT: case LFUN_MATH_SUPERSCRIPT: case LFUN_FONT_DEFAULT: