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