From 910b8c6a07b500296bcfd3f2ed5ef0fa3733455d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 23 Oct 2001 08:14:52 +0000 Subject: [PATCH] remove the hard-coded greek stuff, it is handled in math.bind nowadays git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2912 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formulabase.C | 2 +- src/mathed/math_cursor.C | 31 +++++++------------------------ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 954e0374e0..f683cf88c5 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -488,7 +488,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action, case LFUN_GREEK: handleFont(bv, LM_TC_GREEK1); if (arg.size()) - mathcursor->interpret(arg[0]); + mathcursor->interpret(arg); break; case LFUN_MATH_MODE: diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 0fe0ef1dd6..c4027c2a30 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -1377,31 +1377,14 @@ void MathCursor::interpret(char c) return; } - if (isalpha(c) && (lastcode_ == LM_TC_GREEK || lastcode_ == LM_TC_GREEK1)) { - static char const greekl[][26] = - {"alpha", "beta", "chi", "delta", "epsilon", "phi", - "gamma", "eta", "iota", "epsilon", "kappa", "lambda", "mu", - "nu", "omega", "pi", "vartheta", "rho", "sigma", - "tau", "upsilon", "theta", "omega", "xi", "varphi", "zeta"}; - static char const greeku[][26] = - {"alpha", "beta", "chi", "Delta", "varepsilon", "Phi", - "Gamma", "varepsilon", "varepsilon", "epsilon", "kappa", "Lambda", "mu", - "Nu", "Omega", "Pi", "vartheta", "varrho", "Sigma", "varsigma", - "Upsilon", "Theta", "Omega", "Xi", "Varphi", "zeta"}; - - latexkeys const * l = 0; - if ('a' <= c && c <= 'z') - l = in_word_set(greekl[c - 'a']); - if ('A' <= c && c <= 'Z') - l = in_word_set(greeku[c - 'A']); - - if (l) - insert(createMathInset(l)); - else - insert(c, LM_TC_VAR); + if (isalpha(c) && lastcode_ == LM_TC_GREEK) { + insert(c, LM_TC_VAR); + return; + } - if (lastcode_ == LM_TC_GREEK1) - lastcode_ = LM_TC_VAR; + if (isalpha(c) && lastcode_ == LM_TC_GREEK1) { + insert(c, LM_TC_VAR); + lastcode_ = LM_TC_VAR; return; } -- 2.39.2