]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathUnderset.cpp
Simplify Changers interface
[lyx.git] / src / mathed / InsetMathUnderset.cpp
index e3a5f515ad9b76ddddf0b0b788627a09bc01cc5c..2027cf2337e8af8da217bfd139b918ac1303222c 100644 (file)
 #include <config.h>
 
 #include "InsetMathUnderset.h"
+
 #include "MathData.h"
 #include "MathStream.h"
 
 #include "Cursor.h"
 #include "LaTeXFeatures.h"
+#include "MetricsInfo.h"
+
 
 using namespace std;
 
@@ -31,13 +34,13 @@ void InsetMathUnderset::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);
        dim.wid = max(dim0.width(), dim1.width()) + 4;
        dim.asc = dim1.ascent();
        dim.des = dim1.descent() + dim0.height() + 4;
-       metricsMarkers(dim);
+       metricsMarkers(mi, dim);
 }
 
 
@@ -49,7 +52,7 @@ void InsetMathUnderset::draw(PainterInfo & pi, int x, int y) const
        int m  = x + dim.wid / 2;
        int yo = y + dim1.descent() + dim0.ascent() + 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);
        drawMarkers(pi, x, y);
 }
@@ -117,11 +120,10 @@ void InsetMathUnderset::validate(LaTeXFeatures & features) const
        if (features.runparams().isLaTeX())
                features.require("amsmath");
        else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
-               features.addPreambleSnippet("<style type=\"text/css\">\n"
+               features.addCSSSnippet(
                        "span.underset{display: inline-block; vertical-align: top; text-align:center;}\n"
                        "span.underset span {display: block;}\n"
-                       "span.bottom{font-size: 66%;}\n"
-                       "</style>");
+                       "span.bottom{font-size: 66%;}");
 
        InsetMathNest::validate(features);
 }