2003-08-19 13:00:56 +00:00
|
|
|
/**
|
2007-04-25 03:01:35 +00:00
|
|
|
* \file MathAtom.cpp
|
2003-08-19 13:00:56 +00:00
|
|
|
* 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
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pö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>
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "MathAtom.h"
|
|
|
|
#include "InsetMath.h"
|
2001-09-11 10:58:17 +00:00
|
|
|
|
2007-12-12 10:16:00 +00:00
|
|
|
using namespace std;
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
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
|
|
|
|
|
|
|
|
2010-10-26 16:45:21 +00:00
|
|
|
MathAtom::MathAtom(InsetMath * p)
|
|
|
|
: nucleus_(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_)
|
2007-08-30 18:03:17 +00:00
|
|
|
nucleus_ = static_cast<InsetMath*>(at.nucleus_->clone());
|
2003-07-25 17:11:25 +00:00
|
|
|
}
|
2001-09-11 10:58:17 +00:00
|
|
|
|
|
|
|
|
2004-11-23 23:04:52 +00:00
|
|
|
MathAtom & MathAtom::operator=(MathAtom const & at)
|
2001-09-11 10:58:17 +00:00
|
|
|
{
|
2002-06-25 13:19:50 +00:00
|
|
|
if (&at == this)
|
2004-11-23 23:04:52 +00:00
|
|
|
return *this;
|
2002-06-25 13:19:50 +00:00
|
|
|
MathAtom tmp(at);
|
2004-01-28 16:21:29 +00:00
|
|
|
swap(tmp.nucleus_, nucleus_);
|
2004-11-23 23:04:52 +00:00
|
|
|
return *this;
|
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
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|