]> git.lyx.org Git - lyx.git/blob - src/mathed/math_numberinset.C
Fix math cursor positioning bug
[lyx.git] / src / mathed / math_numberinset.C
1 /**
2  * \file math_numberinset.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_numberinset.h"
14 #include "math_mathmlstream.h"
15 #include "math_streamstr.h"
16 #include "math_support.h"
17
18
19 using std::string;
20 using std::auto_ptr;
21
22
23 MathNumberInset::MathNumberInset(string const & s)
24         : str_(s)
25 {}
26
27
28 auto_ptr<InsetBase> MathNumberInset::doClone() const
29 {
30         return auto_ptr<InsetBase>(new MathNumberInset(*this));
31 }
32
33
34 void MathNumberInset::metrics(MetricsInfo & mi, Dimension & dim) const
35 {
36         mathed_string_dim(mi.base.font, str_, dim);
37 }
38
39
40 void MathNumberInset::draw(PainterInfo & pi, int x, int y) const
41 {
42         //lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
43         drawStr(pi, pi.base.font, x, y, str_);
44 }
45
46
47 void MathNumberInset::normalize(NormalStream & os) const
48 {
49         os << "[number " << str_ << ']';
50 }
51
52
53 void MathNumberInset::maple(MapleStream & os) const
54 {
55         os << str_;
56 }
57
58
59 void MathNumberInset::octave(OctaveStream & os) const
60 {
61         os << str_;
62 }
63
64
65 void MathNumberInset::mathmlize(MathMLStream & os) const
66 {
67         os << "<mi> " << str_ << " </mi>";
68 }
69
70
71 void MathNumberInset::write(WriteStream & os) const
72 {
73         os << str_;
74 }