From f1496539275f55fef21e00257188e6c9139116af Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 17 Aug 2001 15:47:02 +0000 Subject: [PATCH] fix display "'" vs "\ni" git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2534 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_charinset.C | 10 ++++++---- src/mathed/math_defs.h | 2 ++ src/mathed/math_parser.C | 13 ++++++------- src/mathed/support.C | 1 + 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mathed/math_charinset.C b/src/mathed/math_charinset.C index 94a7bf8b48..fa9dceba91 100644 --- a/src/mathed/math_charinset.C +++ b/src/mathed/math_charinset.C @@ -16,21 +16,22 @@ MathCharInset::MathCharInset(char c) : char_(c), code_(nativeCode(c)) { - if (isalpha(c)) - code_ = LM_TC_VAR; +//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl; } MathCharInset::MathCharInset(char c, MathTextCodes t) : char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t) -{} +{ +//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl; +} MathTextCodes MathCharInset::nativeCode(char c) const { if (isalpha(c)) return LM_TC_VAR; - return LM_TC_MIN; + return LM_TC_CONST; } @@ -68,6 +69,7 @@ void MathCharInset::draw(Painter & pain, int x, int y) const { xo(x); yo(y); + //lyxerr << "drawing '" << char_ << "' code: " << code_ << endl; drawChar(pain, code_, size_, x, y, char_); } diff --git a/src/mathed/math_defs.h b/src/mathed/math_defs.h index 0126529177..b09fb2d06b 100644 --- a/src/mathed/math_defs.h +++ b/src/mathed/math_defs.h @@ -58,6 +58,8 @@ enum MathTextCodes { /// Internal code for variables LM_TC_VAR, /// + LM_TC_CONST, + /// LM_TC_RM, /// LM_TC_CAL, diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index ac5f50ed1f..c9f4317749 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -118,9 +118,6 @@ inline CatCode catcode(unsigned char c) } -const unsigned char LM_TK_OPEN = '{'; -const unsigned char LM_TK_CLOSE = '}'; - enum { FLAG_BRACE = 1 << 0, // an opening brace needed FLAG_BRACE_LAST = 1 << 1, // last closing brace ends the parsing process @@ -440,10 +437,12 @@ void Parser::tokenize(string const & buffer) } } - //lyxerr << "\nTokens: "; - //for (unsigned i = 0; i < tokens_.size(); ++i) - // lyxerr << tokens_[i]; - //lyxerr << "\n"; +#if 0 + lyxerr << "\nTokens: "; + for (unsigned i = 0; i < tokens_.size(); ++i) + lyxerr << tokens_[i]; + lyxerr << "\n"; +#endif } diff --git a/src/mathed/support.C b/src/mathed/support.C index 9922ab9bee..87d0af49ba 100644 --- a/src/mathed/support.C +++ b/src/mathed/support.C @@ -167,6 +167,7 @@ LyXFont WhichFont(MathTextCodes type, MathStyles size) case LM_TC_SPECIAL: //f = Math_Fonts[0]; break; case LM_TC_TEXTRM: + case LM_TC_CONST: case LM_TC_TEX: case LM_TC_RM: f = Math_Fonts[6]; -- 2.39.2