]> git.lyx.org Git - features.git/blob - src/mathed/InsetMathPar.cpp
use bald pointers in clone()
[features.git] / src / mathed / InsetMathPar.cpp
1 /**
2  * \file InsetMathPar.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 "InsetMathPar.h"
14 #include "MathData.h"
15 #include "MathStream.h"
16 #include "support/std_ostream.h"
17
18
19 namespace lyx {
20
21 InsetMathPar::InsetMathPar(MathData const & ar)
22 {
23         cells_[0] = ar;
24 }
25
26
27 bool InsetMathPar::metrics(MetricsInfo & mi, Dimension & dim) const
28 {
29         dim = dim_;
30         FontSetChanger dummy1(mi.base, "textnormal");
31         InsetMathGrid::metrics(mi);
32         if (dim_ == dim)
33                 return false;
34         dim = dim_;
35         return true;
36 }
37
38
39 void InsetMathPar::draw(PainterInfo & pi, int x, int y) const
40 {
41         FontSetChanger dummy1(pi.base, "textnormal");
42         InsetMathGrid::draw(pi, x, y);
43 }
44
45
46 void InsetMathPar::write(WriteStream & os) const
47 {
48         for (idx_type i = 0; i < nargs(); ++i)
49                 os << cell(i) << "\n";
50 }
51
52
53 void InsetMathPar::infoize(odocstream & os) const
54 {
55         os << "Type: Paragraph ";
56 }
57
58
59 Inset * InsetMathPar::clone() const
60 {
61         return new InsetMathPar(*this);
62 }
63
64
65 } // namespace lyx