]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_fontinset.C
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_fontinset.C
index 0c74e24690d453e3190b9af4df246bfcc3672003..14f4bc652cab17011a32ce5da75065e218cc1c51 100644 (file)
@@ -17,6 +17,7 @@
 #include "LaTeXFeatures.h"
 #include "support/std_ostream.h"
 
+using std::string;
 using std::auto_ptr;
 
 
@@ -25,7 +26,7 @@ MathFontInset::MathFontInset(latexkeys const * key)
 {}
 
 
-auto_ptr<InsetBase> MathFontInset::clone() const
+auto_ptr<InsetBase> MathFontInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathFontInset(*this));
 }
@@ -44,9 +45,9 @@ MathInset::mode_type MathFontInset::currentMode() const
 void MathFontInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        FontSetChanger dummy(mi.base, key_->name.c_str());
-       cell(0).metrics(mi, dim_);
-       metricsMarkers(1);
-       dim = dim_;
+       cell(0).metrics(mi, dim);
+       metricsMarkers(dim);
+       dim_ = dim;
 }
 
 
@@ -55,10 +56,11 @@ void MathFontInset::draw(PainterInfo & pi, int x, int y) const
        FontSetChanger dummy(pi.base, key_->name.c_str());
        cell(0).draw(pi, x + 1, y);
        drawMarkers(pi, x, y);
+       setPosCache(pi, x, y);
 }
 
 
-void MathFontInset::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const
+void MathFontInset::metricsT(TextMetricsInfo const & mi, Dimension &) const
 {
        cell(0).metricsT(mi, dim_);
 }