- return MathAtom(new InsetMathPhantom(InsetMathPhantom::vphantom));
-
- if (MacroTable::globalMacros().has(s))
- return MathAtom(new MathMacro(s,
- MacroTable::globalMacros().get(s).numargs()));
- //if (MacroTable::localMacros().has(s))
- // return MathAtom(new MathMacro(s,
- // MacroTable::localMacros().get(s).numargs()));
-
- //lyxerr << "creating unknown inset '" << s << "'" << endl;
- return MathAtom(new InsetMathUnknown(s));
+ return MathAtom(new InsetMathPhantom(buf, InsetMathPhantom::vphantom));
+ if (s == "cancel")
+ return MathAtom(new InsetMathCancel(buf, InsetMathCancel::cancel));
+ if (s == "bcancel")
+ return MathAtom(new InsetMathCancel(buf, InsetMathCancel::bcancel));
+ if (s == "xcancel")
+ return MathAtom(new InsetMathCancel(buf, InsetMathCancel::xcancel));
+ if (s == "cancelto")
+ return MathAtom(new InsetMathCancelto(buf));
+ if (s == "smash")
+ return MathAtom(new InsetMathPhantom(buf, InsetMathPhantom::smash));
+ if (s == "mathclap")
+ return MathAtom(new InsetMathPhantom(buf, InsetMathPhantom::mathclap));
+ if (s == "mathllap")
+ return MathAtom(new InsetMathPhantom(buf, InsetMathPhantom::mathllap));
+ if (s == "mathrlap")
+ return MathAtom(new InsetMathPhantom(buf, InsetMathPhantom::mathrlap));
+ if (s == "ensuremath")
+ return MathAtom(new InsetMathEnsureMath(buf));
+ if (s == "sideset")
+ return MathAtom(new InsetMathSideset(buf, true, true));
+ // The following 3 string values are only for math toolbar use, no LaTeX names
+ if (s == "sidesetr")
+ return MathAtom(new InsetMathSideset(buf, false, true));
+ if (s == "sidesetl")
+ return MathAtom(new InsetMathSideset(buf, true, false));
+ if (s == "sidesetn")
+ return MathAtom(new InsetMathSideset(buf, false, false));
+ if (isSpecialChar(s))
+ return MathAtom(new InsetMathSpecialChar(s));
+ if (s == " ")
+ return MathAtom(new InsetMathSpace(" ", ""));
+
+ if (s == "regexp")
+ return MathAtom(new InsetMathHull(buf, hullRegexp));
+
+ return MathAtom(new MathMacro(buf, s));