]> git.lyx.org Git - lyx.git/blob - src/mathed/MathAtom.cpp
Coding style
[lyx.git] / src / mathed / MathAtom.cpp
1 /**
2  * \file MathAtom.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 "MathAtom.h"
14 #include "InsetMath.h"
15
16 using namespace std;
17
18 namespace lyx {
19
20
21 MathAtom::MathAtom()
22         : nucleus_(0)
23 {}
24
25
26 MathAtom::MathAtom(Inset * p)
27         : nucleus_(static_cast<InsetMath *>(p))
28 {}
29
30
31 MathAtom::MathAtom(MathAtom const & at)
32         : nucleus_(0)
33 {
34         if (at.nucleus_)
35                 nucleus_ = static_cast<InsetMath*>(at.nucleus_->clone());
36 }
37
38
39 MathAtom & MathAtom::operator=(MathAtom const & at)
40 {
41         if (&at == this)
42                 return *this;
43         MathAtom tmp(at);
44         swap(tmp.nucleus_, nucleus_);
45         return *this;
46 }
47
48
49 MathAtom::~MathAtom()
50 {
51         delete nucleus_;
52 }
53
54
55 } // namespace lyx