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"
16 #include "MathStream.h"
24 InsetMathEnsureMath::InsetMathEnsureMath(Buffer
* buf
)
25 : InsetMathNest(buf
, 1)
29 Inset
* InsetMathEnsureMath::clone() const
31 return new InsetMathEnsureMath(*this);
35 void InsetMathEnsureMath::metrics(MetricsInfo
& mi
, Dimension
& dim
) const
37 FontSetChanger
dummy(mi
.base
, "mathnormal");
38 cell(0).metrics(mi
, dim
);
43 void InsetMathEnsureMath::draw(PainterInfo
& pi
, int x
, int y
) const
45 FontSetChanger
dummy(pi
.base
, "mathnormal");
46 cell(0).draw(pi
, x
, y
);
47 drawMarkers(pi
, x
, y
);
51 void InsetMathEnsureMath::metricsT(TextMetricsInfo
const & mi
, Dimension
& dim
) const
53 cell(0).metricsT(mi
, dim
);
57 void InsetMathEnsureMath::drawT(TextPainter
& pain
, int x
, int y
) const
59 cell(0).drawT(pain
, x
, y
);
63 void InsetMathEnsureMath::write(WriteStream
& os
) const
65 ModeSpecifier
specifier(os
, MATH_MODE
);
66 os
<< "\\ensuremath{" << cell(0) << "}";
70 void InsetMathEnsureMath::infoize(odocstream
& os
) const