]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_atom.C
Change the color of the background widget to red.
[lyx.git] / src / mathed / math_atom.C
index b727dac0f8cdb2bee1ef2c58af340818a7e26dfc..bd5cda75be3aec9bbe5a9d2be7819ba77e7e862a 100644 (file)
@@ -1,24 +1,19 @@
-/*
- *  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>
 
 #include "math_atom.h"
 #include "math_inset.h"
-#include "insets/insetbase.h"
 
-#include <utility>
+using std::swap;
 
 
 MathAtom::MathAtom()
@@ -32,8 +27,11 @@ MathAtom::MathAtom(InsetBase * p)
 
 
 MathAtom::MathAtom(MathAtom const & at)
-       : nucleus_(at.nucleus_ ? static_cast<MathInset *>(at.nucleus_->clone()) : 0)
-{}
+       : nucleus_(0)
+{
+       if (at.nucleus_)
+               nucleus_ = static_cast<MathInset*>(at.nucleus_->clone().release());
+}
 
 
 void MathAtom::operator=(MathAtom const & at)
@@ -41,7 +39,7 @@ void MathAtom::operator=(MathAtom const & at)
        if (&at == this)
                return;
        MathAtom tmp(at);
-       std::swap(tmp.nucleus_, nucleus_);
+       swap(tmp.nucleus_, nucleus_);
 }