]> git.lyx.org Git - lyx.git/blob - src/mathed/math_atom.C
architectural changes to tex2lyx
[lyx.git] / src / mathed / math_atom.C
1 /*
2  *  File:        math_atom.C
3  *  Purpose:     Wrapper for MathInset *
4  *  Author:      André Pönitz
5  *  Created:     July 2001
6  *
7  *  Copyright: 2001 The LyX team
8  *
9  *   Version: 1.2.0
10  *
11  *   You are free to use and modify this code under the terms of
12  *   the GNU General Public Licence version 2 or later.
13  */
14
15 #include <config.h>
16
17 #include "math_atom.h"
18 #include "math_inset.h"
19 #include "insets/insetbase.h"
20
21 #include <utility>
22
23
24 MathAtom::MathAtom()
25         : nucleus_(0)
26 {}
27
28
29 MathAtom::MathAtom(InsetBase * p)
30         : nucleus_(static_cast<MathInset *>(p))
31 {}
32
33
34 MathAtom::MathAtom(MathAtom const & at)
35         : nucleus_(0)
36 {
37         if (at.nucleus_)
38                 nucleus_ = static_cast<MathInset*>(at.nucleus_->clone().release());
39 }
40
41
42 void MathAtom::operator=(MathAtom const & at)
43 {
44         if (&at == this)
45                 return;
46         MathAtom tmp(at);
47         std::swap(tmp.nucleus_, nucleus_);
48 }
49
50
51 MathAtom::~MathAtom()
52 {
53         delete nucleus_;
54 }