]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_atom.C
architectural changes to tex2lyx
[lyx.git] / src / mathed / math_atom.C
index a8e2815a0f146acfd65d18ebd5f2e069f4dfafcb..4ae004f521691bb809b26d4f3795fbbd9838b8f0 100644 (file)
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "math_atom.h"
 #include "math_inset.h"
+#include "insets/insetbase.h"
 
 #include <utility>
 
@@ -29,14 +26,17 @@ MathAtom::MathAtom()
 {}
 
 
-MathAtom::MathAtom(MathInset * p)
-       : nucleus_(p)
+MathAtom::MathAtom(InsetBase * p)
+       : nucleus_(static_cast<MathInset *>(p))
 {}
 
 
 MathAtom::MathAtom(MathAtom const & at)
-       : nucleus_(at.nucleus_ ? at.nucleus_->clone() : 0)
-{}
+       : nucleus_(0)
+{
+       if (at.nucleus_)
+               nucleus_ = static_cast<MathInset*>(at.nucleus_->clone().release());
+}
 
 
 void MathAtom::operator=(MathAtom const & at)
@@ -48,22 +48,7 @@ void MathAtom::operator=(MathAtom const & at)
 }
 
 
-void MathAtom::operator=(MathInset * p)
-{
-       reset(p);
-}
-
-
 MathAtom::~MathAtom()
 {
        delete nucleus_;
 }
-
-
-void MathAtom::reset(MathInset * p)
-{
-       if (p == nucleus_)
-               return;
-       delete nucleus_;
-       nucleus_ = p;
-}