2001-09-11 10:58:17 +00:00
|
|
|
|
/*
|
2001-12-11 07:38:02 +00:00
|
|
|
|
* File: math_atom.C
|
2002-03-21 17:42:56 +00:00
|
|
|
|
* Purpose: Wrapper for MathInset *
|
2001-12-11 07:38:02 +00:00
|
|
|
|
* Author: Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
* Created: July 2001
|
2001-09-11 10:58:17 +00:00
|
|
|
|
*
|
2001-12-11 07:38:02 +00:00
|
|
|
|
* Copyright: 2001 The LyX team
|
2001-09-11 10:58:17 +00:00
|
|
|
|
*
|
2001-12-11 07:38:02 +00:00
|
|
|
|
* Version: 1.2.0
|
2001-09-11 10:58:17 +00:00
|
|
|
|
*
|
|
|
|
|
* You are free to use and modify this code under the terms of
|
|
|
|
|
* the GNU General Public Licence version 2 or later.
|
|
|
|
|
*/
|
|
|
|
|
|
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"
|
2003-06-16 11:49:38 +00:00
|
|
|
|
#include "insets/insetbase.h"
|
2001-09-11 10:58:17 +00:00
|
|
|
|
|
2001-12-11 07:38:02 +00:00
|
|
|
|
#include <utility>
|
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-06-16 11:49:38 +00:00
|
|
|
|
: nucleus_(at.nucleus_ ? static_cast<MathInset *>(at.nucleus_->clone()) : 0)
|
2001-12-11 07:38:02 +00:00
|
|
|
|
{}
|
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
|
|
|
|
}
|