2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file math_atom.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-09-11 10:58:17 +00:00
|
|
|
|
*
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
2001-09-11 10:58:17 +00:00
|
|
|
|
*
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-09-11 10:58:17 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2001-12-18 03:16:46 +00:00
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2001-09-11 10:58:17 +00:00
|
|
|
|
#include "math_atom.h"
|
2001-10-12 12:02:49 +00:00
|
|
|
|
#include "math_inset.h"
|
2001-09-11 10:58:17 +00:00
|
|
|
|
|
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
|
|
2001-09-11 10:58:17 +00:00
|
|
|
|
MathAtom::MathAtom()
|
2001-10-12 12:02:49 +00:00
|
|
|
|
: nucleus_(0)
|
|
|
|
|
{}
|
2001-09-11 10:58:17 +00:00
|
|
|
|
|
|
|
|
|
|
2003-06-16 11:49:38 +00:00
|
|
|
|
MathAtom::MathAtom(InsetBase * p)
|
|
|
|
|
: nucleus_(static_cast<MathInset *>(p))
|
2001-10-12 12:02:49 +00:00
|
|
|
|
{}
|
2001-09-24 16:25:06 +00:00
|
|
|
|
|
2001-09-11 10:58:17 +00:00
|
|
|
|
|
2002-06-25 13:19:50 +00:00
|
|
|
|
MathAtom::MathAtom(MathAtom const & at)
|
2003-07-25 17:11:25 +00:00
|
|
|
|
: nucleus_(0)
|
|
|
|
|
{
|
|
|
|
|
if (at.nucleus_)
|
|
|
|
|
nucleus_ = static_cast<MathInset*>(at.nucleus_->clone().release());
|
|
|
|
|
}
|
2001-09-11 10:58:17 +00:00
|
|
|
|
|
|
|
|
|
|
2002-06-25 13:19:50 +00:00
|
|
|
|
void MathAtom::operator=(MathAtom const & at)
|
2001-09-11 10:58:17 +00:00
|
|
|
|
{
|
2002-06-25 13:19:50 +00:00
|
|
|
|
if (&at == this)
|
2001-11-15 09:51:57 +00:00
|
|
|
|
return;
|
2002-06-25 13:19:50 +00:00
|
|
|
|
MathAtom tmp(at);
|
2002-03-12 14:59:08 +00:00
|
|
|
|
std::swap(tmp.nucleus_, nucleus_);
|
2001-09-11 10:58:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MathAtom::~MathAtom()
|
|
|
|
|
{
|
2001-12-11 07:38:02 +00:00
|
|
|
|
delete nucleus_;
|
2001-09-11 10:58:17 +00:00
|
|
|
|
}
|