Check for self-assignment, by comparing the pointers.
--HG-- branch : develop
This commit is contained in:
parent
c0c407f8a8
commit
13d369f560
|
@ -55,6 +55,10 @@ VContainer::VContainer()
|
|||
*/
|
||||
VContainer &VContainer::operator =(const VContainer &data)
|
||||
{
|
||||
if ( &data == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
setData(data);
|
||||
return *this;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,10 @@ VIncrement::VIncrement(const VIncrement &incr)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VIncrement &VIncrement::operator=(const VIncrement &incr)
|
||||
{
|
||||
if ( &incr == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VVariable::operator=(incr);
|
||||
this->id = incr.getId();
|
||||
return *this;
|
||||
|
|
|
@ -74,6 +74,10 @@ VMeasurement::VMeasurement(const VMeasurement &m)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMeasurement &VMeasurement::operator=(const VMeasurement &m)
|
||||
{
|
||||
if ( &m == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VVariable::operator=(m);
|
||||
this->gui_text = m.GetGuiText();
|
||||
this->_tagName = m.TagName();
|
||||
|
|
|
@ -57,6 +57,10 @@ VVariable::VVariable(const VVariable &var)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VVariable &VVariable::operator=(const VVariable &var)
|
||||
{
|
||||
if ( &var == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
this->base = var.GetBase();
|
||||
this->ksize = var.GetKsize();
|
||||
this->kheight = var.GetKheight();
|
||||
|
|
|
@ -43,6 +43,10 @@ VAbstractCurve::VAbstractCurve(const VAbstractCurve &curve)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractCurve &VAbstractCurve::operator=(const VAbstractCurve &curve)
|
||||
{
|
||||
if ( &curve == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VGObject::operator=(curve);
|
||||
return *this;
|
||||
}
|
||||
|
|
|
@ -81,6 +81,10 @@ VArc::VArc(const VArc &arc)
|
|||
*/
|
||||
VArc &VArc::operator =(const VArc &arc)
|
||||
{
|
||||
if ( &arc == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VAbstractCurve::operator=(arc);
|
||||
this->f1 = arc.GetF1();
|
||||
this->formulaF1 = arc.GetFormulaF1();
|
||||
|
|
|
@ -53,6 +53,10 @@ VDetail::VDetail(const VDetail &detail)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDetail &VDetail::operator =(const VDetail &detail)
|
||||
{
|
||||
if ( &detail == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
_id = detail.id();
|
||||
nodes = detail.getNodes();
|
||||
name = detail.getName();
|
||||
|
|
|
@ -64,6 +64,10 @@ VGObject::VGObject(const VGObject &obj)
|
|||
*/
|
||||
VGObject &VGObject::operator=(const VGObject &obj)
|
||||
{
|
||||
if ( &obj == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
this->_id = obj.id();
|
||||
this->type = obj.getType();
|
||||
this->idObject = obj.getIdObject();
|
||||
|
|
|
@ -46,6 +46,10 @@ VNodeDetail::VNodeDetail(const VNodeDetail &node)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeDetail &VNodeDetail::operator =(const VNodeDetail &node)
|
||||
{
|
||||
if ( &node == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
id = node.getId();
|
||||
typeTool = node.getTypeTool();
|
||||
typeNode = node.getTypeNode();
|
||||
|
|
|
@ -84,6 +84,10 @@ VPointF::VPointF(const QPointF &point) :VGObject(VPointF()), _mx(0), _my(0), _x(
|
|||
*/
|
||||
VPointF &VPointF::operator =(const VPointF &point)
|
||||
{
|
||||
if ( &point == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VGObject::operator=(point);
|
||||
_mx = point.mx();
|
||||
_my = point.my();
|
||||
|
|
|
@ -688,6 +688,10 @@ QVector<QPointF> VSpline::SplinePoints(const QPointF &p1, const QPointF &p4, qre
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSpline &VSpline::operator =(const VSpline &spline)
|
||||
{
|
||||
if ( &spline == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VAbstractCurve::operator=(spline);
|
||||
this->p1 = spline.GetP1 ();
|
||||
this->p2 = spline.GetP2 ();
|
||||
|
|
|
@ -158,6 +158,10 @@ VSplinePoint VSplinePath::GetSplinePoint(qint32 indexSpline, SplinePointPosition
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePath &VSplinePath::operator =(const VSplinePath &path)
|
||||
{
|
||||
if ( &path == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VAbstractCurve::operator=(path);
|
||||
this->path = path.GetSplinePath();
|
||||
this->kCurve = path.getKCurve();
|
||||
|
|
|
@ -69,6 +69,10 @@ VSplinePoint::VSplinePoint(const VSplinePoint &point)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePoint &VSplinePoint::operator=(const VSplinePoint &point)
|
||||
{
|
||||
if ( &point == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
this->pSpline = point.P();
|
||||
this->angle1 = point.Angle1();
|
||||
this->angle2 = point.Angle2();
|
||||
|
|
|
@ -48,6 +48,10 @@ VDataTool::VDataTool(VContainer *data, QObject *parent)
|
|||
*/
|
||||
VDataTool &VDataTool::operator =(const VDataTool &tool)
|
||||
{
|
||||
if ( &tool == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
data = tool.getData();
|
||||
_referens = tool.referens();
|
||||
return *this;
|
||||
|
|
|
@ -53,8 +53,11 @@ VTranslation::VTranslation(const QString &context, const QString &sourceText, co
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VTranslation &VTranslation::operator=(const VTranslation &tr)
|
||||
|
||||
{
|
||||
if ( &tr == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
this->mcontext = tr.getMcontext();
|
||||
this->msourceText = tr.getMsourceText();
|
||||
this->mdisambiguation = tr.getMdisambiguation();
|
||||
|
|
|
@ -98,6 +98,10 @@ public:
|
|||
*/
|
||||
QmuParserToken& operator= ( const QmuParserToken &a_Tok )
|
||||
{
|
||||
if ( &a_Tok == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
Assign ( a_Tok );
|
||||
return *this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user