]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathNumber.cpp
use bald pointers in clone()
[lyx.git] / src / mathed / InsetMathNumber.cpp
1 /**
2  * \file InsetMathNumber.cpp
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 "InsetMathNumber.h"
14 #include "MathStream.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
17
18
19 namespace lyx {
20
21 using std::vector;
22
23 InsetMathNumber::InsetMathNumber(docstring const & s)
24         : str_(s)
25 {}
26
27
28 Inset * InsetMathNumber::clone() const
29 {
30         return new InsetMathNumber(*this);
31 }
32
33
34 bool InsetMathNumber::metrics(MetricsInfo & mi, Dimension & dim) const
35 {
36         mathed_string_dim(mi.base.font, str_, dim);
37         if (dim_ == dim)
38                 return false;
39         dim_ = dim;
40         return true;
41 }
42
43
44 void InsetMathNumber::draw(PainterInfo & pi, int x, int y) const
45 {
46         pi.draw(x, y, str_);
47 }
48
49
50 void InsetMathNumber::normalize(NormalStream & os) const
51 {
52         os << "[number " << str_ << ']';
53 }
54
55
56 void InsetMathNumber::maple(MapleStream & os) const
57 {
58         os << str_;
59 }
60
61
62 void InsetMathNumber::mathematica(MathematicaStream & os) const
63 {
64         os << str_;
65 }
66
67
68 void InsetMathNumber::octave(OctaveStream & os) const
69 {
70         os << str_;
71 }
72
73
74 void InsetMathNumber::mathmlize(MathStream & os) const
75 {
76         os << "<mi> " << str_ << " </mi>";
77 }
78
79
80 void InsetMathNumber::write(WriteStream & os) const
81 {
82         os << str_;
83 }
84
85
86 } // namespace lyx