LGTM: [skip ci] fix: Inconsistent definition of copy constructor and assignment ('Rule of Two')
This commit is contained in:
@@ -55,6 +55,11 @@ DocumentT::DocumentT(const std::string& name)
|
||||
document = name;
|
||||
}
|
||||
|
||||
DocumentT::DocumentT(const DocumentT& doc)
|
||||
{
|
||||
document = doc.document;
|
||||
}
|
||||
|
||||
DocumentT::~DocumentT()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ public:
|
||||
DocumentT(Document*);
|
||||
/*! Constructor */
|
||||
DocumentT(const std::string&);
|
||||
/*! Constructor */
|
||||
DocumentT(const DocumentT&);
|
||||
/*! Destructor */
|
||||
~DocumentT();
|
||||
/*! Assignment operator */
|
||||
|
||||
@@ -52,6 +52,11 @@ DocumentT::DocumentT(const std::string& name)
|
||||
document = name;
|
||||
}
|
||||
|
||||
DocumentT::DocumentT(const DocumentT& doc)
|
||||
{
|
||||
document = doc.document;
|
||||
}
|
||||
|
||||
DocumentT::~DocumentT()
|
||||
{
|
||||
}
|
||||
@@ -125,6 +130,12 @@ ViewProviderT::ViewProviderT(ViewProviderDocumentObject* obj)
|
||||
document = obj->getObject()->getDocument()->getName();
|
||||
}
|
||||
|
||||
ViewProviderT::ViewProviderT(const ViewProviderT& vp)
|
||||
{
|
||||
object = vp.object;
|
||||
document = vp.document;
|
||||
}
|
||||
|
||||
ViewProviderT::~ViewProviderT()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
DocumentT(Document*);
|
||||
/*! Constructor */
|
||||
DocumentT(const std::string&);
|
||||
/*! Constructor */
|
||||
DocumentT(const DocumentT&);
|
||||
/*! Destructor */
|
||||
~DocumentT();
|
||||
/*! Assignment operator */
|
||||
@@ -85,6 +87,8 @@ public:
|
||||
ViewProviderT();
|
||||
/*! Constructor */
|
||||
ViewProviderT(ViewProviderDocumentObject*);
|
||||
/*! Constructor */
|
||||
ViewProviderT(const ViewProviderT&);
|
||||
/*! Destructor */
|
||||
~ViewProviderT();
|
||||
/*! Assignment operator */
|
||||
|
||||
@@ -50,6 +50,21 @@ MotionEvent::MotionEvent(const MotionEvent& in) : EventBase(static_cast<QEvent::
|
||||
handled = in.handled;
|
||||
}
|
||||
|
||||
MotionEvent& MotionEvent::operator= (const MotionEvent& in)
|
||||
{
|
||||
if (this == &in)
|
||||
return *this;
|
||||
|
||||
xTrans = in.xTrans;
|
||||
yTrans = in.yTrans;
|
||||
zTrans = in.zTrans;
|
||||
xRot = in.xRot;
|
||||
yRot = in.yRot;
|
||||
zRot = in.zRot;
|
||||
handled = in.handled;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void MotionEvent::translations(int &xTransOut, int &yTransOut, int &zTransOut)
|
||||
{
|
||||
xTransOut = xTrans;
|
||||
@@ -91,6 +106,17 @@ ButtonEvent::ButtonEvent(const ButtonEvent& in) : EventBase(static_cast<QEvent::
|
||||
handled = in.handled;
|
||||
}
|
||||
|
||||
ButtonEvent& ButtonEvent::operator= (const ButtonEvent& in)
|
||||
{
|
||||
if (this == &in)
|
||||
return *this;
|
||||
|
||||
buttonState = in.buttonState;
|
||||
button = in.button;
|
||||
handled = in.handled;
|
||||
return *this;
|
||||
}
|
||||
|
||||
ButtonStateType ButtonEvent::buttonStatus()
|
||||
{
|
||||
return buttonState;
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Spaceball
|
||||
public:
|
||||
MotionEvent();
|
||||
MotionEvent(const MotionEvent& in);
|
||||
MotionEvent& operator= (const MotionEvent& in);
|
||||
void translations(int &xTransOut, int &yTransOut, int &zTransOut);
|
||||
void setTranslations(const int &xTransIn, const int &yTransIn, const int &zTransIn);
|
||||
int translationX(){return xTrans;}
|
||||
@@ -72,6 +73,7 @@ namespace Spaceball
|
||||
public:
|
||||
ButtonEvent();
|
||||
ButtonEvent(const ButtonEvent& in);
|
||||
ButtonEvent& operator= (const ButtonEvent& in);
|
||||
ButtonStateType buttonStatus();
|
||||
void setButtonStatus(const ButtonStateType &buttonStatusIn);
|
||||
int buttonNumber();
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
protected:
|
||||
GeometryExtension();
|
||||
GeometryExtension(const GeometryExtension &obj) = default;
|
||||
GeometryExtension& operator= (const GeometryExtension &obj) = default;
|
||||
|
||||
void restoreNameAttribute(Base::XMLReader &/*reader*/);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user