]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_atom.C
Compile fix gcc 2.95 + stlport
[lyx.git] / src / mathed / math_atom.C
index 0e70a9b043ab4b38e0ace37a8225cf8badcd6179..bd5cda75be3aec9bbe5a9d2be7819ba77e7e862a 100644 (file)
@@ -1,29 +1,17 @@
-/*
- *  File:        math_atom.C
- *  Purpose:     Wrapper for MathInset * 
- *  Author:      André Pönitz
- *  Created:     July 2001
+/**
+ * \file math_atom.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *  Copyright: 2001 The LyX team
+ * \author André Pönitz
  *
- *   Version: 1.2.0
- *
- *   You are free to use and modify this code under the terms of
- *   the GNU General Public Licence version 2 or later.
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "math_atom.h"
 #include "math_inset.h"
-#include "support/LAssert.h"
-
-#include <utility>
-
 
 using std::swap;
 
@@ -33,21 +21,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);
        swap(tmp.nucleus_, nucleus_);
 }
 
@@ -56,25 +47,3 @@ MathAtom::~MathAtom()
 {
        delete nucleus_;
 }
-
-
-void MathAtom::reset(MathInset * p)
-{
-       if (p == nucleus_)
-               return;
-       delete nucleus_;
-       nucleus_ = p;
-}
-
-
-MathInset * MathAtom::nucleus() const
-{
-       lyx::Assert(nucleus_);
-       return nucleus_;
-}
-
-
-MathInset * MathAtom::operator->() const
-{
-       return nucleus();
-}