]> git.lyx.org Git - features.git/commitdiff
small steps towards a unified symbol handling
authorAndré Pönitz <poenitz@gmx.net>
Thu, 26 Jul 2001 15:28:45 +0000 (15:28 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 26 Jul 2001 15:28:45 +0000 (15:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2361 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_bigopinset.C
src/mathed/math_cursor.C
src/mathed/math_defs.h
src/mathed/math_macrotable.C
src/mathed/math_parser.C
src/mathed/support.C

index cdf09f42823aee342165b12f8d78fc95a6d0aa25..4ae2fdb25b6dba1966ca6c364eb6a9e9b7fc36cb 100644 (file)
@@ -18,7 +18,7 @@ MathInset * MathBigopInset::clone() const
 
 void MathBigopInset::write(ostream & os, bool /* fragile */) const
 {
-       os << '\\' << sym_->name;
+       os << '\\' << sym_->name << ' ';
 }
 
 
@@ -35,7 +35,7 @@ void MathBigopInset::metrics(MathStyles st)
        if (sym_->id > 0 && sym_->id < 256) {
                ssym_ = string();
                ssym_ += sym_->id;
-               code_ = LM_TC_BSYM;
+               code_ = (sym_->token == LM_TK_BIGSYM) ? LM_TC_BSYM : LM_TC_SYMB;
        } else {
                ssym_ = sym_->name;
                code_ = LM_TC_TEXTRM;
index bc1ddf707cbab430b895c2a3df669de4e1a5e4bc..4ffe77a4f26421831fd0a2160c14fa409ffeb235 100644 (file)
@@ -665,19 +665,11 @@ void MathCursor::interpret(string const & s)
                        p = new MathFuncInset(s);
        } else {
                switch (l->token) {
+                       case LM_TK_SYM: 
                        case LM_TK_BIGSYM: 
                        case LM_TK_FUNCLIM:
                                p = new MathBigopInset(l);
                                break;
-                               
-                       case LM_TK_SYM: {
-                               MathTextCodes code = static_cast<MathTextCodes>(l->id);
-                               if (code < 255)
-                                       insert(l->id, l->bin != LMB_NONE ? LM_TC_BOPS : LM_TC_SYMB);
-                               else
-                                       p = new MathFuncInset(l->name);
-                               break;
-                       }
 
                        case LM_TK_STACK:
                                p = new MathFracInset("stackrel");
index 3d048b0162b8357eba31c6493a29e7c77ad3db27..4dc01bf78f32c4d7e65bd0de0334194a43483331 100644 (file)
@@ -81,9 +81,7 @@ enum MathTextCodes  {
        LM_TC_BOP,
        /// Internal code for symbols
        LM_TC_SYMB,
-       ///
-       LM_TC_BOPS,
-       ///
+       /// Internal code for symbols that get bigger in displayed math
        LM_TC_BSYM,
        ///
        LM_FONT_END,
index 978766ab5be514833619ea5047d77fa827b3c17d..ab116755c4ce378488ecf24143b420f6e303926f 100644 (file)
@@ -95,7 +95,7 @@ void MathMacroTable::builtinMacros()
        {
                MathMacroTemplate * t = new MathMacroTemplate("notin", 0);
                MathDecorationInset * p = new MathDecorationInset("not", LM_not);
-               p->cell(0).push_back(LM_in, LM_TC_BOPS);
+               p->cell(0).push_back(LM_in, LM_TC_SYMB);
                t->push_back(p);
                insertTemplate(t);
        }
index a07d5ad7e53e8c40260ff2fc3964c292b8e52f60..b855c0732b3aaa8c57ddcae5ef39f68d8cb4c128 100644 (file)
@@ -631,18 +631,11 @@ void mathed_parse(MathArray & array, unsigned flags)
                        break;
                
                case LM_TK_BIGSYM:  
+               case LM_TK_SYM:
                case LM_TK_FUNCLIM:
                        limits = 0;
                        array.push_back(new MathBigopInset(yylval.l));
                        break;
-               
-               case LM_TK_SYM:
-                       if (yylval.l->id < 256) {
-                               MathTextCodes tc = yylval.l->bin == LMB_NONE ? LM_TC_SYMB : LM_TC_BOPS;
-                               array.push_back(yylval.l->id, tc);
-                       } else 
-                               array.push_back(new MathFuncInset(yylval.l->name));
-                       break;
 
                case LM_TK_BOP:
                        array.push_back(yylval.i, LM_TC_BOP);
index 18c4f41161649471be830e4385a48e8c2869f9cd..a0de5d315408c0f02decaf723802fc517e75c7ed 100644 (file)
@@ -30,13 +30,13 @@ bool MathIsAlphaFont(MathTextCodes x)
 
 bool MathIsBinary(MathTextCodes x)
 {
-       return x == LM_TC_BOP || x == LM_TC_BOPS;
+       return x == LM_TC_BOP;
 }
 
 
 bool MathIsSymbol(MathTextCodes x)
 {
-       return x == LM_TC_SYMB || x == LM_TC_BOPS || x == LM_TC_BSYM;
+       return x == LM_TC_SYMB || x == LM_TC_BSYM;
 }
      
 
@@ -159,9 +159,6 @@ LyXFont WhichFont(MathTextCodes type, MathStyles size)
 
        switch (type) {
        case LM_TC_SYMB:        
-               f = Math_Fonts[2];
-               break;
-
        case LM_TC_BSYM:        
                f = Math_Fonts[2];
                break;