]> git.lyx.org Git - lyx.git/blob - src/mathed/math_arrayinset.C
cosmetics
[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, "array", LM_OT_MATRIX)
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 (int col = 0; col < ncols(); ++col)
31                 os << colinfo_[col].h_align_;
32         os << "}\n";
33
34         MathGridInset::write(os, fragile);
35
36         if (fragile)
37                 os << "\\protect";
38         os << "\\end{array}\n";
39 }