From a8af2d353da336ec32e79ff18740c94e073a9dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 3 Jan 2002 13:52:13 +0000 Subject: [PATCH] next try to fix the 'C-m 11' problem git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3287 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_charinset.C | 2 +- src/mathed/math_charinset.h | 2 +- src/mathed/math_cursor.C | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mathed/math_charinset.C b/src/mathed/math_charinset.C index 0a9370637d..329b68caa0 100644 --- a/src/mathed/math_charinset.C +++ b/src/mathed/math_charinset.C @@ -30,7 +30,7 @@ MathCharInset::MathCharInset(char c, MathTextCodes t) } -MathTextCodes MathCharInset::nativeCode(char c) const +MathTextCodes MathCharInset::nativeCode(char c) { if (isalpha(c)) return LM_TC_VAR; diff --git a/src/mathed/math_charinset.h b/src/mathed/math_charinset.h index faf298033d..20d5e472f1 100644 --- a/src/mathed/math_charinset.h +++ b/src/mathed/math_charinset.h @@ -21,7 +21,7 @@ public: /// MathInset * clone() const; /// - MathTextCodes nativeCode(char c) const; + static MathTextCodes nativeCode(char c); /// void metrics(MathMetricsInfo const & st) const; /// diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 63e4f83063..34ecf9af92 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -168,7 +168,7 @@ Selection theSelection; MathCursor::MathCursor(InsetFormulaBase * formula, bool left) - : formula_(formula), lastcode_(LM_TC_VAR), selection_(false) + : formula_(formula), lastcode_(LM_TC_MIN), selection_(false) { left ? first() : last(); } @@ -300,11 +300,11 @@ bool MathCursor::left(bool sel) dump("Left 1"); if (inMacroMode()) { macroModeClose(); - lastcode_ = LM_TC_VAR; + lastcode_ = LM_TC_MIN; return true; } selHandle(sel); - lastcode_ = LM_TC_VAR; + lastcode_ = LM_TC_MIN; if (hasPrevAtom() && openable(prevAtom(), sel)) { if (prevAtom()->isHyperActive()) { @@ -323,11 +323,11 @@ bool MathCursor::right(bool sel) dump("Right 1"); if (inMacroMode()) { macroModeClose(); - lastcode_ = LM_TC_VAR; + lastcode_ = LM_TC_MIN; return true; } selHandle(sel); - lastcode_ = LM_TC_VAR; + lastcode_ = LM_TC_MIN; if (hasNextAtom() && openable(nextAtom(), sel)) { if (nextAtom()->isHyperActive()) { @@ -396,7 +396,7 @@ void MathCursor::home(bool sel) dump("home 1"); selHandle(sel); macroModeClose(); - lastcode_ = LM_TC_VAR; + lastcode_ = LM_TC_MIN; if (!par()->idxHome(idx(), pos())) popLeft(); dump("home 2"); @@ -408,7 +408,7 @@ void MathCursor::end(bool sel) dump("end 1"); selHandle(sel); macroModeClose(); - lastcode_ = LM_TC_VAR; + lastcode_ = LM_TC_MIN; if (!par()->idxEnd(idx(), pos())) popRight(); dump("end 2"); @@ -1412,7 +1412,7 @@ bool MathCursor::interpret(char c) } // no special circumstances, so insert the character without any fuss - insert(c, lastcode_); + insert(c, lastcode_ == LM_TC_MIN ? MathCharInset::nativeCode(c) : lastcode_); lastcode_ = LM_TC_MIN; return true; }