]> git.lyx.org Git - lyx.git/blob - src/mathed/math_arrayinset.C
further code uglification to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / math_arrayinset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_arrayinset.h"
6 #include "support/LOstream.h"
7
8
9 MathArrayInset::MathArrayInset(int m, int n)
10         : MathGridInset(m, n)
11 {}
12
13
14 MathInset * MathArrayInset::clone() const
15 {
16         return new MathArrayInset(*this);
17 }
18
19
20 void MathArrayInset::write(std::ostream & os, bool fragile) const
21 {
22         if (fragile)
23                 os << "\\protect";
24         os << "\\begin{array}";
25
26         if (v_align_ == 't' || v_align_ == 'b') 
27                 os << '[' << char(v_align_) << ']';
28
29         os << '{';
30         for (unsigned int col = 0; col < ncols(); ++col)
31                 os << colinfo_[col].align_;
32         os << "}\n";
33
34         MathGridInset::write(os, fragile);
35
36         if (fragile)
37                 os << "\\protect";
38         os << "\\end{array}\n";
39 }
40
41
42 void MathArrayInset::metrics(MathStyles st) const
43 {
44         MathGridInset::metrics(st == LM_ST_DISPLAY ? LM_ST_TEXT : st);
45 }
46