]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathLefteqn.C
Fixed bug 3449 by Stefan Schimanski:
[lyx.git] / src / mathed / InsetMathLefteqn.C
1 /**
2  * \file InsetMathLefteqn.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 "InsetMathLefteqn.h"
14 #include "MathData.h"
15 #include "support/std_ostream.h"
16
17
18 namespace lyx {
19
20
21 using std::string;
22 using std::auto_ptr;
23
24
25 InsetMathLefteqn::InsetMathLefteqn()
26         : InsetMathNest(1)
27 {}
28
29
30 auto_ptr<InsetBase> InsetMathLefteqn::doClone() const
31 {
32         return auto_ptr<InsetBase>(new InsetMathLefteqn(*this));
33 }
34
35
36 bool InsetMathLefteqn::metrics(MetricsInfo & mi, Dimension & dim) const
37 {
38         cell(0).metrics(mi, dim);
39         dim.asc += 2;
40         dim.des += 2;
41         dim.wid = 4;
42         metricsMarkers(dim);
43         if (dim_ == dim)
44                 return false;
45         dim_ = dim;
46         return true;
47 }
48
49
50 void InsetMathLefteqn::draw(PainterInfo & pi, int x, int y) const
51 {
52         cell(0).draw(pi, x + 2, y);
53         drawMarkers(pi, x, y);
54 }
55
56
57 docstring InsetMathLefteqn::name() const
58 {
59         return from_ascii("lefteqn");
60 }
61
62
63 void InsetMathLefteqn::infoize(odocstream & os) const
64 {
65         os << "Lefteqn ";
66 }
67
68
69 } // namespace lyx