]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathEnsureMath.cpp
... and RELEASE-NOTES
[lyx.git] / src / mathed / InsetMathEnsureMath.cpp
index a4070265905f54b0574eaf837d6b81d96d3d1b00..d1e69fb6c23a584b050f3c188eaf0fb7ad25beda 100644 (file)
 
 #include "InsetMathEnsureMath.h"
 
-#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
 #include "MathSupport.h"
 
+#include "LaTeXFeatures.h"
+#include "MetricsInfo.h"
+
 #include <ostream>
 
 
@@ -36,8 +38,8 @@ Inset * InsetMathEnsureMath::clone() const
 
 void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       bool really_change_font = isTextFont(from_ascii(mi.base.fontname));
-       FontSetChanger dummy(mi.base, "mathnormal", really_change_font);
+       bool really_change_font = isTextFont(mi.base.fontname);
+       Changer dummy = mi.base.changeFontSet("mathnormal", really_change_font);
        cell(0).metrics(mi, dim);
        metricsMarkers(dim);
 }
@@ -45,8 +47,8 @@ void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetMathEnsureMath::draw(PainterInfo & pi, int x, int y) const
 {
-       bool really_change_font = isTextFont(from_ascii(pi.base.fontname));
-       FontSetChanger dummy(pi.base, "mathnormal", really_change_font);
+       bool really_change_font = isTextFont(pi.base.fontname);
+       Changer dummy = pi.base.changeFontSet("mathnormal", really_change_font);
        cell(0).draw(pi, x, y);
        drawMarkers(pi, x, y);
 }
@@ -101,13 +103,9 @@ void InsetMathEnsureMath::validate(LaTeXFeatures & features) const
        // It'd be better to be able to get this from an InsetLayout, but at present
        // InsetLayouts do not seem really to work for things that aren't InsetTexts.
        if (features.runparams().math_flavor == OutputParams::MathAsMathML)
-               features.addPreambleSnippet("<style type=\"text/css\">\n"
-                       "mstyle.math { font-style: italic; }\n"
-                       "</style>");
+               features.addCSSSnippet("mstyle.math { font-style: italic; }");
        else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
-               features.addPreambleSnippet("<style type=\"text/css\">\n"
-                       "span.mathbox { font-style: italic; }\n"
-                       "</style>");
+               features.addCSSSnippet("span.mathbox { font-style: italic; }");
 
        InsetMathNest::validate(features);
 }