]> git.lyx.org Git - lyx.git/blob - src/mathed/math_atom.C
Make Helge happy: no more crash on arrow up/down in math macro
[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 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 }