]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_atom.C
split LyXText::rowlist_ into individual Paragraph::rows_ chunks
[lyx.git] / src / mathed / math_atom.C
index 76fc538851833e1c95f916cb8cad07cb1c37b77b..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,21 +26,24 @@ MathAtom::MathAtom()
 {}
 
 
-MathAtom::MathAtom(MathInset * p)
-       : nucleus_(p)
+MathAtom::MathAtom(InsetBase * p)
+       : nucleus_(static_cast<MathInset *>(p))
 {}
 
 
-MathAtom::MathAtom(MathAtom const & p)
-       : nucleus_(p.nucleus_ ? p.nucleus_->clone() : 0)
-{}
+MathAtom::MathAtom(MathAtom const & at)
+       : nucleus_(0)
+{
+       if (at.nucleus_)
+               nucleus_ = static_cast<MathInset*>(at.nucleus_->clone().release());
+}
 
 
-void MathAtom::operator=(MathAtom const & p)
+void MathAtom::operator=(MathAtom const & at)
 {
-       if (&p == this)
+       if (&at == this)
                return;
-       MathAtom tmp(p);
+       MathAtom tmp(at);
        std::swap(tmp.nucleus_, nucleus_);
 }
 
@@ -52,12 +52,3 @@ MathAtom::~MathAtom()
 {
        delete nucleus_;
 }
-
-
-void MathAtom::reset(MathInset * p)
-{
-       if (p == nucleus_)
-               return;
-       delete nucleus_;
-       nucleus_ = p;
-}