]> git.lyx.org Git - lyx.git/blob - src/mathed/math_ertinset.C
revert Buffer LyxText->InsetText commit
[lyx.git] / src / mathed / math_ertinset.C
1 /**
2  * \file math_ertinset.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "math_ertinset.h"
14 #include "math_mathmlstream.h"
15 #include "support/std_ostream.h"
16
17 using std::auto_ptr;
18
19
20 auto_ptr<InsetBase> MathErtInset::clone() const
21 {
22         return auto_ptr<InsetBase>(new MathErtInset(*this));
23 }
24
25
26 void MathErtInset::metrics(MetricsInfo & mi, Dimension & dim) const
27 {
28         FontSetChanger dummy(mi.base, "lyxert");
29         MathTextInset::metrics(mi, dim);
30         cache_.colinfo_[0].align_ = 'l';
31         metricsMarkers(dim);
32         dim_ = dim;
33 }
34
35
36 void MathErtInset::draw(PainterInfo & pi, int x, int y) const
37 {
38         FontSetChanger dummy(pi.base, "lyxert");
39         MathTextInset::draw(pi, x + 1, y);
40         drawMarkers(pi, x, y);
41 }
42
43
44 void MathErtInset::write(WriteStream & os) const
45 {
46         if (os.latex())
47                 os << cell(0);
48         else
49                 os << "\\lyxert{" << cell(0) << '}';
50 }
51
52
53 void MathErtInset::infoize(std::ostream & os) const
54 {
55         os << "Box: Ert";
56 }