]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSize.cpp
Fix bug #8782.
[lyx.git] / src / mathed / InsetMathSize.cpp
index 0403ffbc3f1ba5b953ce17a2758ffd82ccb429b1..31cdb6a9e8099931f130f8da6a91141769df8c14 100644 (file)
 #include "output_xhtml.h"
 
 #include "support/convert.h"
+#include "support/gettext.h"
+#include "support/lstrings.h"
 
 #include <string>
 #include <ostream>
 
+using namespace lyx::support;
 using namespace std;
 
 namespace lyx {
@@ -40,7 +43,7 @@ Inset * InsetMathSize::clone() const
 
 void InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       StyleChanger dummy(mi.base, style_);
+       Changer dummy = mi.base.changeStyle(style_);
        cell(0).metrics(mi, dim);
        metricsMarkers(dim);
 }
@@ -48,7 +51,7 @@ void InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetMathSize::draw(PainterInfo & pi, int x, int y) const
 {
-       StyleChanger dummy(pi.base, style_);
+       Changer dummy = pi.base.changeStyle(style_);
        cell(0).draw(pi, x + 1, y);
        drawMarkers(pi, x, y);
 }
@@ -80,8 +83,7 @@ void InsetMathSize::mathmlize(MathStream & ms) const
        stringstream attrs;
        attrs << "displaystyle='" << (dispstyle ? "true" : "false")
                << "' scriptlevel='" << scriptlevel << "'";
-       ms << MTag("mstyle", attrs.str()) << ">"
-          << cell(0) << ETag("mstyle");
+       ms << MTag("mstyle", attrs.str()) << cell(0) << ETag("mstyle");
 }
 
 
@@ -101,18 +103,17 @@ void InsetMathSize::normalize(NormalStream & os) const
 
 void InsetMathSize::infoize(odocstream & os) const
 {
-       os << "Size: " << key_->name;
+       os << bformat(_("Size: %1$s"), key_->name);
 }
 
 
 void InsetMathSize::validate(LaTeXFeatures & features) const
 {
        if (features.runparams().math_flavor == OutputParams::MathAsHTML)
-               features.addPreambleSnippet("<style type=\"text/css\">\n"
+               features.addCSSSnippet(
                        "span.displaystyle, span.textstyle{font-size: normal;}\n"
                        "span.scriptstyle {font-size: small;}\n"
-                       "span.scriptscriptstyle {font-size: x-small;}\n"
-                       "</style>");
+                       "span.scriptscriptstyle {font-size: x-small;}");
        InsetMathNest::validate(features);
 }