]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSymbol.cpp
Simplify Changers interface
[lyx.git] / src / mathed / InsetMathSymbol.cpp
index 620ca226a2881b6c182c4885cb86a39c49716c59..885aa60f01f911c57ebcd9f54f221d50b57d9987 100644 (file)
@@ -70,9 +70,9 @@ void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
                dim.asc += h_;
                dim.des -= h_;
        }
-       // set striptable_
+       // set scriptable_
        scriptable_ = false;
-       if (mi.base.style == LM_ST_DISPLAY)
+       if (mi.base.font.style() == LM_ST_DISPLAY)
                if (sym_->inset == "cmex" || sym_->inset == "esint" ||
                    sym_->extra == "funclim" ||
                    (sym_->inset == "stmry" && sym_->extra == "mathop"))
@@ -92,27 +92,18 @@ InsetMath::mode_type InsetMathSymbol::currentMode() const
 }
 
 
-bool InsetMathSymbol::isMathBin() const
-{
-       return sym_->extra == "mathbin";
-}
-
-
-bool InsetMathSymbol::isMathRel() const
-{
-       return sym_->extra == "mathrel";
-}
-
-
-bool InsetMathSymbol::isMathPunct() const
+bool InsetMathSymbol::isOrdAlpha() const
 {
-       return sym_->extra == "mathpunct";
+       return sym_->extra == "mathord" || sym_->extra == "mathalpha";
 }
 
 
-bool InsetMathSymbol::isOrdAlpha() const
+MathClass InsetMathSymbol::mathClass() const
 {
-       return sym_->extra == "mathord" || sym_->extra == "mathalpha";
+       if (sym_->extra == "func" || sym_->extra == "funclim")
+               return MC_OP;
+       MathClass const mc = string_to_class(sym_->extra);
+       return (mc == MC_UNKNOWN) ? MC_ORD : mc;
 }