]> git.lyx.org Git - lyx.git/blob - src/mathed/math_sizeinset.C
fix #1073
[lyx.git] / src / mathed / math_sizeinset.C
1 #include <config.h>
2
3
4 #include "math_sizeinset.h"
5 #include "math_parser.h"
6 #include "math_mathmlstream.h"
7 #include "math_streamstr.h"
8 #include "math_support.h"
9 #include "support/LOstream.h"
10
11 using std::atoi;
12
13 MathSizeInset::MathSizeInset(latexkeys const * l)
14         : MathNestInset(1), key_(l), style_(Styles(atoi(l->extra.c_str())))
15 {}
16
17
18 MathInset * MathSizeInset::clone() const
19 {
20         return new MathSizeInset(*this);
21 }
22
23
24 void MathSizeInset::metrics(MetricsInfo & mi) const
25 {
26         StyleChanger dummy(mi.base, style_);
27         dim_ = cell(0).metrics(mi);
28         metricsMarkers2();
29 }
30
31
32 void MathSizeInset::draw(PainterInfo & pi, int x, int y) const
33 {
34         StyleChanger dummy(pi.base, style_);
35         cell(0).draw(pi, x + 1, y);
36         drawMarkers2(pi, x, y);
37 }
38
39
40 void MathSizeInset::write(WriteStream & os) const
41 {
42         os << "{\\" << key_->name << ' ' << cell(0) << '}';
43 }
44
45
46 void MathSizeInset::normalize(NormalStream & os) const
47 {
48         os << '[' << key_->name << ' ' << cell(0) << ']';
49 }
50
51
52 void MathSizeInset::infoize(std::ostream & os) const
53 {
54         os << "Size: " << key_->name;
55 }