A bit more re-organization.
[lyx.git] / src / mathed / InsetMathEnsureMath.cpp
blobf06cbe5552f18a5c6d4914bef3e47619e1843323
1 /**
2 * \file InsetMathEnsureMath.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author André Pönitz
7 * \author Enrico Forestieri
9 * Full author contact details are available in file CREDITS.
12 #include <config.h>
14 #include "InsetMathEnsureMath.h"
16 #include "MathStream.h"
17 #include "MathData.h"
19 #include <ostream>
22 namespace lyx {
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);
39 metricsMarkers(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
72 os << "EnsureMath";
76 } // namespace lyx