]> git.lyx.org Git - lyx.git/blob - src/mathed/math_xymatrixinset.C
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / math_xymatrixinset.C
1 /**
2  * \file math_xymatrixinset.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_xymatrixinset.h"
14 #include "math_mathmlstream.h"
15 #include "math_streamstr.h"
16
17 #include "LaTeXFeatures.h"
18 #include "support/std_ostream.h"
19
20
21 MathXYMatrixInset::MathXYMatrixInset()
22         : MathGridInset(1, 1)
23 {}
24
25
26 std::auto_ptr<InsetBase> MathXYMatrixInset::doClone() const
27 {
28         return std::auto_ptr<InsetBase>(new MathXYMatrixInset(*this));
29 }
30
31
32 int MathXYMatrixInset::colsep() const
33 {
34         return 40;
35 }
36
37
38 int MathXYMatrixInset::rowsep() const
39 {
40         return 40;
41 }
42
43
44 void MathXYMatrixInset::metrics(MetricsInfo & mi, Dimension & dim) const
45 {
46         if (mi.base.style == LM_ST_DISPLAY)
47                 mi.base.style = LM_ST_TEXT;
48         MathGridInset::metrics(mi, dim);
49 }
50
51
52 void MathXYMatrixInset::write(WriteStream & os) const
53 {
54         os << "\\xymatrix{";
55         MathGridInset::write(os);
56         os << "}\n";
57 }
58
59
60 void MathXYMatrixInset::infoize(std::ostream & os) const
61 {
62         os << "xymatrix ";
63         MathGridInset::infoize(os);
64 }
65
66
67 void MathXYMatrixInset::normalize(NormalStream & os) const
68 {
69         os << "[xymatrix ";
70         MathGridInset::normalize(os);
71         os << ']';
72 }
73
74
75 void MathXYMatrixInset::maple(MapleStream & os) const
76 {
77         os << "xymatrix(";
78         MathGridInset::maple(os);
79         os << ')';
80 }