]> git.lyx.org Git - lyx.git/blob - src/mathed/math_diffinset.C
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_diffinset.C
1 /**
2  * \file math_diffinset.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_diffinset.h"
14 #include "math_data.h"
15 #include "math_mathmlstream.h"
16 #include "debug.h"
17
18 using std::auto_ptr;
19 using std::endl;
20
21
22 MathDiffInset::MathDiffInset()
23         : MathNestInset(1)
24 {}
25
26
27 auto_ptr<InsetBase> MathDiffInset::doClone() const
28 {
29         return auto_ptr<InsetBase>(new MathDiffInset(*this));
30 }
31
32
33 void MathDiffInset::addDer(MathArray const & der)
34 {
35         cells_.push_back(der);
36 }
37
38
39 void MathDiffInset::normalize(NormalStream & os) const
40 {
41         os << "[diff";
42         for (idx_type idx = 0; idx < nargs(); ++idx)
43                 os << ' ' << cell(idx);
44         os << ']';
45 }
46
47
48 void MathDiffInset::metrics(MetricsInfo &, Dimension &) const
49 {
50         lyxerr << "should not happen" << endl;
51 }
52
53
54 void MathDiffInset::draw(PainterInfo &, int, int) const
55 {
56         lyxerr << "should not happen" << endl;
57 }
58
59
60 void MathDiffInset::maple(MapleStream & os) const
61 {
62         os << "diff(";
63         for (idx_type idx = 0; idx < nargs(); ++idx) {
64                 if (idx != 0)
65                         os << ',';
66                 os << cell(idx);
67         }
68         os << ')';
69 }
70
71
72 void MathDiffInset::mathematica(MathematicaStream & os) const
73 {
74         os << "Dt[";
75         for (idx_type idx = 0; idx < nargs(); ++idx) {
76                 if (idx != 0)
77                         os << ',';
78                 os << cell(idx);
79         }
80         os << ']';
81 }
82
83
84 void MathDiffInset::mathmlize(MathMLStream & os) const
85 {
86         os << "diff(";
87         for (idx_type idx = 0; idx < nargs(); ++idx) {
88                 if (idx != 0)
89                         os << ',';
90                 os << cell(idx);
91         }
92         os << ')';
93 }
94
95
96 void MathDiffInset::write(WriteStream &) const
97 {
98         lyxerr << "should not happen" << endl;
99 }