]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_symbolinset.C
Fix event loop to no longer eat CPU
[lyx.git] / src / mathed / math_symbolinset.C
index 995acee314642552d71a37df15a94f3e446e1e86..523d0727704172dfe3649de535538f584373325e 100644 (file)
@@ -40,7 +40,7 @@ MathSymbolInset::MathSymbolInset(string const & name)
 {}
 
 
-auto_ptr<InsetBase> MathSymbolInset::clone() const
+auto_ptr<InsetBase> MathSymbolInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathSymbolInset(*this));
 }
@@ -91,6 +91,8 @@ void MathSymbolInset::metrics(MetricsInfo & mi, Dimension & dim) const
        if (mi.base.style == LM_ST_DISPLAY)
                if (sym_->inset == "cmex" || sym_->extra == "funclim")
                        scriptable_ = true;
+
+       width_ = dim.wid;
 }
 
 
@@ -107,7 +109,7 @@ void MathSymbolInset::draw(PainterInfo & pi, int x, int y) const
                x += static_cast<int>(0.0833*em+0.5);
 
        FontSetChanger dummy(pi.base, sym_->inset.c_str());
-       drawStr(pi, pi.base.font, x, y - h_, sym_->draw);
+       pi.draw(x, y - h_, sym_->draw);
 }
 
 
@@ -134,8 +136,8 @@ bool MathSymbolInset::takesLimits() const
 
 void MathSymbolInset::validate(LaTeXFeatures & features) const
 {
-       if (sym_->inset == "msa" || sym_->inset == "msb")
-               features.require("amssymb");
+       if (!sym_->requires.empty())
+               features.require(sym_->requires);
 }