]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_symbolinset.C
Fix math cursor positioning bug
[lyx.git] / src / mathed / math_symbolinset.C
index b7cb9d8c40c81b470c582e1eabbc7170e0de1cf7..2d07bd6240e7cca2e9b7e97887598dbb552b7805 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));
 }
@@ -65,10 +65,10 @@ void MathSymbolInset::metrics(MetricsInfo & mi, Dimension & dim) const
        // correct height for broken cmex and wasy font
 #if defined(__APPLE__) && defined(__GNUC__)
        if (sym_->inset == "cmex") {
-               h_ = 4 * dim_.des / 5;
-               dim_.asc += 0*h_;
-               dim_.des -= h_;
-               h_ = dim_.asc;
+               h_ = 4 * dim.des / 5;
+               dim.asc += 0*h_;
+               dim.des -= h_;
+               h_ = dim.asc;
        } else if (sym_->inset == "wasy") {
                h_ = 4 * dim.des / 5;
                dim.asc += h_;
@@ -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;
 }
 
 
@@ -136,6 +138,8 @@ void MathSymbolInset::validate(LaTeXFeatures & features) const
 {
        if (sym_->inset == "msa" || sym_->inset == "msb")
                features.require("amssymb");
+       else if (sym_->inset == "wasy")
+               features.require("wasysym");
 }
 
 
@@ -182,13 +186,6 @@ char const * MathMLtype(string const & s)
 }
 
 
-bool MathSymbolInset::match(MathAtom const & at) const
-{
-       MathSymbolInset const * q = at->asSymbolInset();
-       return q && name() == q->name();
-}
-
-
 void MathSymbolInset::mathmlize(MathMLStream & os) const
 {
        char const * type = MathMLtype(sym_->extra);