]> git.lyx.org Git - lyx.git/blob - src/mathed/math_sizeinset.C
Reduce Michael's buglist.
[lyx.git] / src / mathed / math_sizeinset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_sizeinset.h"
6 #include "math_parser.h"
7 #include "math_mathmlstream.h"
8
9
10 MathSizeInset::MathSizeInset(latexkeys const * l)
11         : MathNestInset(1), key_(l)
12 {}
13
14
15 MathInset * MathSizeInset::clone() const
16 {
17         return new MathSizeInset(*this);
18 }
19
20
21 void MathSizeInset::draw(Painter & pain, int x, int y) const
22 {
23         xcell(0).draw(pain, x, y);
24 }
25
26
27 void MathSizeInset::metrics(MathMetricsInfo const & mi) const
28 {
29         MathMetricsInfo m = mi;
30         m.style = MathStyles(key_->id);
31         xcell(0).metrics(m);
32         ascent_   = xcell(0).ascent_;
33         descent_  = xcell(0).descent_;
34         width_    = xcell(0).width_;
35 }
36
37
38 void MathSizeInset::write(WriteStream & os) const
39 {
40         os << "{\\" << key_->name.c_str() << ' ' << cell(0) << '}';
41 }
42
43
44 void MathSizeInset::normalize(NormalStream & os) const
45 {
46         os << "[" << key_->name.c_str() << ' ' << cell(0) << ']';
47 }