A bit more re-organization.
[lyx.git] / src / mathed / MathAtom.cpp
blobe8b799db532bc9f2987e189864709124cf6a9289
1 /**
2 * \file MathAtom.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author André Pönitz
8 * Full author contact details are available in file CREDITS.
9 */
11 #include <config.h>
13 #include "MathAtom.h"
14 #include "InsetMath.h"
16 using namespace std;
18 namespace lyx {
21 MathAtom::MathAtom()
22 : nucleus_(0)
26 MathAtom::MathAtom(Inset * p)
27 : nucleus_(static_cast<InsetMath *>(p))
31 MathAtom::MathAtom(MathAtom const & at)
32 : nucleus_(0)
34 if (at.nucleus_)
35 nucleus_ = static_cast<InsetMath*>(at.nucleus_->clone());
39 MathAtom & MathAtom::operator=(MathAtom const & at)
41 if (&at == this)
42 return *this;
43 MathAtom tmp(at);
44 swap(tmp.nucleus_, nucleus_);
45 return *this;
49 MathAtom::~MathAtom()
51 delete nucleus_;
55 } // namespace lyx