]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathStackrel.cpp
Simplify Changers interface
[lyx.git] / src / mathed / InsetMathStackrel.cpp
index d8b9e97d255c1b69d0c9740260898dbfe70cad04..e34448a419af53eb831076f7d4af090363687c11 100644 (file)
 
 #include "InsetMathStackrel.h"
 
-#include "Cursor.h"
-#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
 
+#include "Cursor.h"
+#include "LaTeXFeatures.h"
+#include "MetricsInfo.h"
+
 using namespace std;
 
 namespace lyx {
@@ -50,11 +52,18 @@ bool InsetMathStackrel::idxUpDown(Cursor & cur, bool up) const
 }
 
 
+MathClass InsetMathStackrel::mathClass() const
+{
+       // FIXME: update this when/if \stackbin is supported
+       return MC_REL;
+}
+
+
 void InsetMathStackrel::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        Dimension dim1;
        cell(1).metrics(mi, dim1);
-       FracChanger dummy(mi.base);
+       Changer dummy = mi.base.changeFrac();
        Dimension dim0;
        cell(0).metrics(mi, dim0);
        if (nargs() > 2) {
@@ -68,7 +77,7 @@ void InsetMathStackrel::metrics(MetricsInfo & mi, Dimension & dim) const
                dim.asc = dim1.ascent() + dim0.height() + 4;
                dim.des = dim1.descent();
        }
-       metricsMarkers(dim);
+       metricsMarkers(mi, dim);
 }
 
 
@@ -80,7 +89,7 @@ void InsetMathStackrel::draw(PainterInfo & pi, int x, int y) const
        int m  = x + dim.width() / 2;
        int yo = y - dim1.ascent() - dim0.descent() - 1;
        cell(1).draw(pi, m - dim1.width() / 2, y);
-       FracChanger dummy(pi.base);
+       Changer dummy = pi.base.changeFrac();
        cell(0).draw(pi, m - dim0.width() / 2, yo);
        if (nargs() > 2) {
                Dimension const & dim2 = cell(2).dimension(*pi.base.bv);