]> git.lyx.org Git - lyx.git/blob - src/mathed/math_atom.C
fix typo that put too many include paths for most people
[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 #ifdef __GNUG__
18 #pragma implementation
19 #endif
20
21 #include "math_atom.h"
22 #include "math_inset.h"
23
24 #include <utility>
25
26
27 MathAtom::MathAtom()
28         : nucleus_(0)
29 {}
30
31
32 MathAtom::MathAtom(MathInset * p)
33         : nucleus_(p)
34 {}
35
36
37 MathAtom::MathAtom(MathAtom const & p)
38         : nucleus_(p.nucleus_ ? p.nucleus_->clone() : 0)
39 {}
40
41
42 void MathAtom::operator=(MathAtom const & p)
43 {
44         if (&p == this)
45                 return;
46         MathAtom tmp(p);
47         std::swap(tmp.nucleus_, nucleus_);
48 }
49
50
51 MathAtom::~MathAtom()
52 {
53         delete nucleus_;
54 }
55
56
57 void MathAtom::reset(MathInset * p)
58 {
59         if (p == nucleus_)
60                 return;
61         delete nucleus_;
62         nucleus_ = p;
63 }