X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathEnsureMath.cpp;h=7f82345efd8627299f8a6ccf2e36a74ac0437b97;hb=3800036b2a376c3ce808386eda0568f2f627d2d1;hp=cab5e7730e053d8ca2b853cd46d5788accde2fbc;hpb=38b9a4530e8eb870e60cf8a15c208010fb292054;p=lyx.git diff --git a/src/mathed/InsetMathEnsureMath.cpp b/src/mathed/InsetMathEnsureMath.cpp index cab5e7730e..7f82345efd 100644 --- a/src/mathed/InsetMathEnsureMath.cpp +++ b/src/mathed/InsetMathEnsureMath.cpp @@ -13,18 +13,20 @@ #include "InsetMathEnsureMath.h" -#include "LaTeXFeatures.h" #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" +#include "LaTeXFeatures.h" +#include "MetricsInfo.h" + #include namespace lyx { InsetMathEnsureMath::InsetMathEnsureMath(Buffer * buf) - : InsetMathNest(buf, 1) + : InsetMathGrid(buf, 1, 1) {} @@ -36,19 +38,15 @@ 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); + Changer dummy = mi.base.changeEnsureMath(); cell(0).metrics(mi, dim); - metricsMarkers(dim); } 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); + Changer dummy = pi.base.changeEnsureMath(); cell(0).draw(pi, x, y); - drawMarkers(pi, x, y); } @@ -64,17 +62,17 @@ void InsetMathEnsureMath::drawT(TextPainter & pain, int x, int y) const } -void InsetMathEnsureMath::write(WriteStream & os) const +void InsetMathEnsureMath::write(TeXMathStream & os) const { ModeSpecifier specifier(os, MATH_MODE); os << "\\ensuremath{" << cell(0) << "}"; } -void InsetMathEnsureMath::mathmlize(MathStream & os) const +void InsetMathEnsureMath::mathmlize(MathMLStream & ms) const { - SetMode mathmode(os, false); - os << MTag("mstyle", "class='math'") + SetMode mathmode(ms, false); + ms << MTag("mstyle", "class='math'") << cell(0) << ETag("mstyle"); }