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