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