]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSymbol.cpp
Merge branch 'master' into biblatex2
[lyx.git] / src / mathed / InsetMathSymbol.cpp
index 620ca226a2881b6c182c4885cb86a39c49716c59..92d2573560a4ad808141d0d999f7263ac77012ea 100644 (file)
@@ -61,7 +61,7 @@ docstring InsetMathSymbol::name() const
 void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        // set dim
-       mathedSymbolDim(mi, dim, sym_);
+       mathedSymbolDim(mi.base, dim, sym_);
        // set kerning_
        kerning_ = mathed_char_kerning(mi.base.font, *sym_->draw.rbegin());
        // correct height for broken cmex and wasy font
@@ -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;
 }