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