]> git.lyx.org Git - lyx.git/blob - src/mathed/MathAtom.cpp
Rename files in src/mathed and src/graphics from .C to .cpp, step 2
[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
17 namespace lyx {
18
19 using std::swap;
20
21
22 MathAtom::MathAtom()
23         : nucleus_(0)
24 {}
25
26
27 MathAtom::MathAtom(InsetBase * p)
28         : nucleus_(static_cast<InsetMath *>(p))
29 {}
30
31
32 MathAtom::MathAtom(MathAtom const & at)
33         : nucleus_(0)
34 {
35         if (at.nucleus_)
36                 nucleus_ = static_cast<InsetMath*>(at.nucleus_->clone().release());
37 }
38
39
40 MathAtom & MathAtom::operator=(MathAtom const & at)
41 {
42         if (&at == this)
43                 return *this;
44         MathAtom tmp(at);
45         swap(tmp.nucleus_, nucleus_);
46         return *this;
47 }
48
49
50 MathAtom::~MathAtom()
51 {
52         delete nucleus_;
53 }
54
55
56 } // namespace lyx