2 * \file InsetMathEnsureMath.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Enrico Forestieri
9 * Full author contact details are available in file CREDITS.
14 #include "InsetMathEnsureMath.h"
17 #include "MathStream.h"
18 #include "MathSupport.h"
25 InsetMathEnsureMath::InsetMathEnsureMath(Buffer * buf)
26 : InsetMathNest(buf, 1)
30 Inset * InsetMathEnsureMath::clone() const
32 return new InsetMathEnsureMath(*this);
36 void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const
38 bool really_change_font = isTextFont(from_ascii(mi.base.fontname));
39 FontSetChanger dummy(mi.base, "mathnormal", really_change_font);
40 cell(0).metrics(mi, dim);
45 void InsetMathEnsureMath::draw(PainterInfo & pi, int x, int y) const
47 bool really_change_font = isTextFont(from_ascii(pi.base.fontname));
48 FontSetChanger dummy(pi.base, "mathnormal", really_change_font);
49 cell(0).draw(pi, x, y);
50 drawMarkers(pi, x, y);
54 void InsetMathEnsureMath::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
56 cell(0).metricsT(mi, dim);
60 void InsetMathEnsureMath::drawT(TextPainter & pain, int x, int y) const
62 cell(0).drawT(pain, x, y);
66 void InsetMathEnsureMath::write(WriteStream & os) const
68 ModeSpecifier specifier(os, MATH_MODE);
69 os << "\\ensuremath{" << cell(0) << "}";
73 void InsetMathEnsureMath::mathmlize(MathStream & os) const
79 void InsetMathEnsureMath::infoize(odocstream & os) const