]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_factory.C
further code uglification to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / math_factory.C
index fae6732e9227b8f090e7073b9a46511ab5db8448..34b0ba5d3642f731d311c2dbc1e2a00f0670437f 100644 (file)
@@ -1,7 +1,6 @@
 #include <config.h>
 
 #include "math_parser.h"
-#include "math_bigopinset.h"
 #include "math_binominset.h"
 #include "math_decorationinset.h"
 #include "math_dotsinset.h"
@@ -11,7 +10,7 @@
 #include "math_kerninset.h"
 #include "math_macro.h"
 #include "math_macrotable.h"
-#include "math_noglyphinset.h"
+#include "math_macroarg.h"
 #include "math_notinset.h"
 #include "math_rootinset.h"
 #include "math_spaceinset.h"
 MathInset * createMathInset(latexkeys const * l)
 {
        switch (l->token) {
-       case LM_TK_NOGLYPH:
-       case LM_TK_NOGLYPHB:
-               return new MathNoglyphInset(l);
-       case LM_TK_BIGSYM:
-               return new MathBigopInset(l);
        case LM_TK_FUNCLIM:
                return new MathFuncLimInset(l);
        case LM_TK_SPECIAL:
                return new MathSpecialCharInset(l->id);
        case LM_TK_SYM:
+       case LM_TK_CMR:
        case LM_TK_CMSY:
        case LM_TK_CMM:
        case LM_TK_CMEX:
@@ -59,11 +54,11 @@ MathInset * createMathInset(latexkeys const * l)
        case LM_TK_ROOT:
                return new MathRootInset;
        case LM_TK_DECORATION:
-               return new MathDecorationInset(l);
+               return new MathDecorationInset(l->name);
        case LM_TK_SPACE:
                return new MathSpaceInset(l->id);
        case LM_TK_DOTS:
-               return new MathDotsInset(l);
+               return new MathDotsInset(l->name);
        }
        return new MathFuncInset(l->name);
 }
@@ -71,8 +66,12 @@ MathInset * createMathInset(latexkeys const * l)
 
 MathInset * createMathInset(string const & s)
 {
+       //cerr << "creating inset with name: '" << s << "'\n";
+       if (s.size() == 2 && s[0] == '#' && s[1] >= '1' && s[1] <= '9')
+               return new MathMacroArgument(s[1] - '0');
+
        latexkeys const * l = in_word_set(s);
-       if (l) 
+       if (l)
                return createMathInset(l);
 
        if (MathMacroTable::hasTemplate(s))