diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index c2242a3cc..ee38703e4 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -55,6 +55,10 @@ VContainer::VContainer() */ VContainer &VContainer::operator =(const VContainer &data) { + if ( &data == this ) + { + return *this; + } setData(data); return *this; } diff --git a/src/app/container/vincrement.cpp b/src/app/container/vincrement.cpp index b288b0794..e0ae5355f 100644 --- a/src/app/container/vincrement.cpp +++ b/src/app/container/vincrement.cpp @@ -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; diff --git a/src/app/container/vmeasurement.cpp b/src/app/container/vmeasurement.cpp index 35ef9bce3..d55cbaf14 100644 --- a/src/app/container/vmeasurement.cpp +++ b/src/app/container/vmeasurement.cpp @@ -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(); diff --git a/src/app/container/vvariable.cpp b/src/app/container/vvariable.cpp index 3ca2cb0ef..55c31000a 100644 --- a/src/app/container/vvariable.cpp +++ b/src/app/container/vvariable.cpp @@ -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(); diff --git a/src/app/geometry/vabstractcurve.cpp b/src/app/geometry/vabstractcurve.cpp index 266b9ba1e..c87c0f6f7 100644 --- a/src/app/geometry/vabstractcurve.cpp +++ b/src/app/geometry/vabstractcurve.cpp @@ -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; } diff --git a/src/app/geometry/varc.cpp b/src/app/geometry/varc.cpp index 54fbf9906..558493191 100644 --- a/src/app/geometry/varc.cpp +++ b/src/app/geometry/varc.cpp @@ -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(); diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index 6af182008..51a000bfe 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -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(); diff --git a/src/app/geometry/vgobject.cpp b/src/app/geometry/vgobject.cpp index 17bb1b859..7e0501499 100644 --- a/src/app/geometry/vgobject.cpp +++ b/src/app/geometry/vgobject.cpp @@ -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(); diff --git a/src/app/geometry/vnodedetail.cpp b/src/app/geometry/vnodedetail.cpp index 4db005d90..77de99a08 100644 --- a/src/app/geometry/vnodedetail.cpp +++ b/src/app/geometry/vnodedetail.cpp @@ -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(); diff --git a/src/app/geometry/vpointf.cpp b/src/app/geometry/vpointf.cpp index 61be19c7e..b8f96e339 100644 --- a/src/app/geometry/vpointf.cpp +++ b/src/app/geometry/vpointf.cpp @@ -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(); diff --git a/src/app/geometry/vspline.cpp b/src/app/geometry/vspline.cpp index daa06cda1..523388d7b 100644 --- a/src/app/geometry/vspline.cpp +++ b/src/app/geometry/vspline.cpp @@ -688,6 +688,10 @@ QVector 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 (); diff --git a/src/app/geometry/vsplinepath.cpp b/src/app/geometry/vsplinepath.cpp index aa8d00ab1..818136193 100644 --- a/src/app/geometry/vsplinepath.cpp +++ b/src/app/geometry/vsplinepath.cpp @@ -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(); diff --git a/src/app/geometry/vsplinepoint.cpp b/src/app/geometry/vsplinepoint.cpp index 87b3d0e68..0ebd18b14 100644 --- a/src/app/geometry/vsplinepoint.cpp +++ b/src/app/geometry/vsplinepoint.cpp @@ -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(); diff --git a/src/app/tools/vdatatool.cpp b/src/app/tools/vdatatool.cpp index c88ea6d35..ae860dcf2 100644 --- a/src/app/tools/vdatatool.cpp +++ b/src/app/tools/vdatatool.cpp @@ -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; diff --git a/src/app/widgets/vtranslation.cpp b/src/app/widgets/vtranslation.cpp index d43f9eabe..4ded13459 100644 --- a/src/app/widgets/vtranslation.cpp +++ b/src/app/widgets/vtranslation.cpp @@ -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(); diff --git a/src/libs/qmuparser/qmuparsertoken.h b/src/libs/qmuparser/qmuparsertoken.h index c609e3f0d..3e5d44a62 100644 --- a/src/libs/qmuparser/qmuparsertoken.h +++ b/src/libs/qmuparser/qmuparsertoken.h @@ -98,6 +98,10 @@ public: */ QmuParserToken& operator= ( const QmuParserToken &a_Tok ) { + if ( &a_Tok == this ) + { + return *this; + } Assign ( a_Tok ); return *this; }