From 84001dac613b387f3c31a23877f4228a79698443 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 30 Dec 2019 17:13:18 +0200 Subject: [PATCH] Refactoring. Added move constructor. --HG-- branch : develop --- src/libs/qmuparser/qmuparsercallback.cpp | 13 +++++----- src/libs/qmuparser/qmuparsercallback.h | 3 +-- src/libs/vgeometry/vabstractarc.cpp | 15 ++++++----- src/libs/vgeometry/vabstractarc.h | 3 +-- src/libs/vgeometry/vabstractcurve.cpp | 15 ++++++----- src/libs/vgeometry/vabstractcurve.h | 3 +-- src/libs/vgeometry/varc.cpp | 16 ++++++------ src/libs/vgeometry/varc.h | 3 +-- src/libs/vgeometry/vcubicbezier.cpp | 15 ++++++----- src/libs/vgeometry/vcubicbezier.h | 3 +-- src/libs/vgeometry/vcubicbezierpath.cpp | 16 ++++++------ src/libs/vgeometry/vcubicbezierpath.h | 3 +-- src/libs/vgeometry/vellipticalarc.cpp | 15 ++++++----- src/libs/vgeometry/vellipticalarc.h | 3 +-- src/libs/vgeometry/vgobject.cpp | 12 ++++----- src/libs/vgeometry/vgobject.h | 3 +-- src/libs/vgeometry/vplacelabelitem.cpp | 15 ++++++----- src/libs/vgeometry/vplacelabelitem.h | 3 +-- src/libs/vgeometry/vpointf.cpp | 15 ++++++----- src/libs/vgeometry/vpointf.h | 3 +-- src/libs/vgeometry/vspline.cpp | 15 ++++++----- src/libs/vgeometry/vspline.h | 3 +-- src/libs/vgeometry/vsplinepath.cpp | 16 ++++++------ src/libs/vgeometry/vsplinepath.h | 3 +-- src/libs/vgeometry/vsplinepoint.cpp | 25 +++++++++---------- src/libs/vgeometry/vsplinepoint.h | 6 ++--- src/libs/vlayout/vabstractpiece.cpp | 13 +++++----- src/libs/vlayout/vabstractpiece.h | 3 +-- src/libs/vlayout/vbestsquare.cpp | 13 +++++----- src/libs/vlayout/vbestsquare.h | 3 +-- src/libs/vlayout/vcontour.cpp | 13 +++++----- src/libs/vlayout/vcontour.h | 3 +-- src/libs/vlayout/vlayoutpaper.cpp | 13 +++++----- src/libs/vlayout/vlayoutpaper.h | 3 +-- src/libs/vlayout/vlayoutpiece.cpp | 15 ++++++----- src/libs/vlayout/vlayoutpiece.h | 3 +-- src/libs/vlayout/vlayoutpiecepath.cpp | 13 +++++----- src/libs/vlayout/vlayoutpiecepath.h | 3 +-- .../floatItemData/vabstractfloatitemdata.cpp | 13 +++++----- .../floatItemData/vabstractfloatitemdata.h | 3 +-- .../floatItemData/vgrainlinedata.cpp | 16 ++++++------ .../vpatterndb/floatItemData/vgrainlinedata.h | 3 +-- .../floatItemData/vpatternlabeldata.cpp | 16 ++++++------ .../floatItemData/vpatternlabeldata.h | 3 +-- .../floatItemData/vpiecelabeldata.cpp | 16 ++++++------ .../floatItemData/vpiecelabeldata.h | 3 +-- .../vpatterndb/variables/vcurvevariable.cpp | 15 ++++++----- .../vpatterndb/variables/vcurvevariable.h | 3 +-- src/libs/vpatterndb/variables/vincrement.cpp | 15 ++++++----- src/libs/vpatterndb/variables/vincrement.h | 3 +-- .../variables/vinternalvariable.cpp | 13 +++++----- .../vpatterndb/variables/vinternalvariable.h | 3 +-- src/libs/vpatterndb/variables/vlineangle.cpp | 15 ++++++----- src/libs/vpatterndb/variables/vlineangle.h | 3 +-- src/libs/vpatterndb/variables/vlinelength.cpp | 15 ++++++----- src/libs/vpatterndb/variables/vlinelength.h | 3 +-- .../vpatterndb/variables/vmeasurement.cpp | 15 ++++++----- src/libs/vpatterndb/variables/vmeasurement.h | 3 +-- src/libs/vpatterndb/variables/vvariable.cpp | 15 ++++++----- src/libs/vpatterndb/variables/vvariable.h | 3 +-- src/libs/vpatterndb/vcontainer.cpp | 13 +++++----- src/libs/vpatterndb/vcontainer.h | 3 +-- src/libs/vpatterndb/vnodedetail.cpp | 13 +++++----- src/libs/vpatterndb/vnodedetail.h | 3 +-- src/libs/vpatterndb/vpiece.cpp | 15 ++++++----- src/libs/vpatterndb/vpiece.h | 3 +-- src/libs/vpatterndb/vpiecenode.cpp | 13 +++++----- src/libs/vpatterndb/vpiecenode.h | 3 +-- src/libs/vpatterndb/vpiecepath.cpp | 13 +++++----- src/libs/vpatterndb/vpiecepath.h | 3 +-- 70 files changed, 277 insertions(+), 345 deletions(-) diff --git a/src/libs/qmuparser/qmuparsercallback.cpp b/src/libs/qmuparser/qmuparsercallback.cpp index f2ae6ef91..d4ef51d15 100644 --- a/src/libs/qmuparser/qmuparsercallback.cpp +++ b/src/libs/qmuparser/qmuparsercallback.cpp @@ -209,20 +209,19 @@ QmuParserCallback &QmuParserCallback::operator=(const QmuParserCallback &a_Fun) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +QmuParserCallback::QmuParserCallback(QmuParserCallback &&a_Fun) Q_DECL_NOTHROW + : d (a_Fun.d) +{} + //--------------------------------------------------------------------------------------------------------------------- QmuParserCallback &QmuParserCallback::operator=(QmuParserCallback &&a_Fun) Q_DECL_NOTHROW { - Swap(a_Fun); + std::swap(d, a_Fun.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void QmuParserCallback::Swap(QmuParserCallback &a_Fun) Q_DECL_NOTHROW -{ - std::swap(d, a_Fun.d); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief Return true if the function is conservative. diff --git a/src/libs/qmuparser/qmuparsercallback.h b/src/libs/qmuparser/qmuparsercallback.h index a34909d3a..d58ef6fb8 100644 --- a/src/libs/qmuparser/qmuparsercallback.h +++ b/src/libs/qmuparser/qmuparsercallback.h @@ -86,11 +86,10 @@ public: QmuParserCallback &operator=(const QmuParserCallback &a_Fun); #ifdef Q_COMPILER_RVALUE_REFS + QmuParserCallback(QmuParserCallback &&a_Fun) Q_DECL_NOTHROW; QmuParserCallback &operator=(QmuParserCallback &&a_Fun) Q_DECL_NOTHROW; #endif - void Swap(QmuParserCallback &a_Fun) Q_DECL_NOTHROW; - Q_REQUIRED_RESULT QmuParserCallback* Clone() const; bool IsOptimizable() const; diff --git a/src/libs/vgeometry/vabstractarc.cpp b/src/libs/vgeometry/vabstractarc.cpp index 68fc04431..3414fbc5f 100644 --- a/src/libs/vgeometry/vabstractarc.cpp +++ b/src/libs/vgeometry/vabstractarc.cpp @@ -79,21 +79,20 @@ VAbstractArc &VAbstractArc::operator=(const VAbstractArc &arc) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VAbstractArc::VAbstractArc(VAbstractArc &&arc) Q_DECL_NOTHROW + : VAbstractCurve(arc), d (arc.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VAbstractArc &VAbstractArc::operator=(VAbstractArc &&arc) Q_DECL_NOTHROW { - Swap(arc); + VAbstractCurve::operator=(arc); + std::swap(d, arc.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractArc::Swap(VAbstractArc &arc) Q_DECL_NOTHROW -{ - VAbstractCurve::Swap(arc); - std::swap(d, arc.d); -} - //--------------------------------------------------------------------------------------------------------------------- VAbstractArc::~VAbstractArc() {} diff --git a/src/libs/vgeometry/vabstractarc.h b/src/libs/vgeometry/vabstractarc.h index 0195c0fc3..ac50a0d4d 100644 --- a/src/libs/vgeometry/vabstractarc.h +++ b/src/libs/vgeometry/vabstractarc.h @@ -58,11 +58,10 @@ public: VAbstractArc& operator= (const VAbstractArc &arc); #ifdef Q_COMPILER_RVALUE_REFS + VAbstractArc(VAbstractArc &&arc) Q_DECL_NOTHROW; VAbstractArc &operator=(VAbstractArc &&arc) Q_DECL_NOTHROW; #endif - void Swap(VAbstractArc &arc) Q_DECL_NOTHROW; - QString GetFormulaF1 () const; void SetFormulaF1 (const QString &formula, qreal value); virtual qreal GetStartAngle () const override; diff --git a/src/libs/vgeometry/vabstractcurve.cpp b/src/libs/vgeometry/vabstractcurve.cpp index c589bd901..cd9eac433 100644 --- a/src/libs/vgeometry/vabstractcurve.cpp +++ b/src/libs/vgeometry/vabstractcurve.cpp @@ -60,21 +60,20 @@ VAbstractCurve &VAbstractCurve::operator=(const VAbstractCurve &curve) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VAbstractCurve::VAbstractCurve(VAbstractCurve &&curve) Q_DECL_NOTHROW + :VGObject(curve), d (curve.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VAbstractCurve &VAbstractCurve::operator=(VAbstractCurve &&curve) Q_DECL_NOTHROW { - Swap(curve); + VGObject::operator=(curve); + std::swap(d, curve.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractCurve::Swap(VAbstractCurve &curve) Q_DECL_NOTHROW -{ - VGObject::Swap(curve); - std::swap(d, curve.d); -} - //--------------------------------------------------------------------------------------------------------------------- VAbstractCurve::~VAbstractCurve() {} diff --git a/src/libs/vgeometry/vabstractcurve.h b/src/libs/vgeometry/vabstractcurve.h index 7145d97aa..66d250437 100644 --- a/src/libs/vgeometry/vabstractcurve.h +++ b/src/libs/vgeometry/vabstractcurve.h @@ -57,11 +57,10 @@ public: VAbstractCurve& operator= (const VAbstractCurve &curve); #ifdef Q_COMPILER_RVALUE_REFS + VAbstractCurve(VAbstractCurve &&curve) Q_DECL_NOTHROW; VAbstractCurve &operator=(VAbstractCurve &&curve) Q_DECL_NOTHROW; #endif - void Swap(VAbstractCurve &curve) Q_DECL_NOTHROW; - virtual QVector GetPoints() const =0; static QVector GetSegmentPoints(const QVector &points, const QPointF &begin, const QPointF &end, bool reverse = false); diff --git a/src/libs/vgeometry/varc.cpp b/src/libs/vgeometry/varc.cpp index 80f9fd6f7..89f9588d6 100644 --- a/src/libs/vgeometry/varc.cpp +++ b/src/libs/vgeometry/varc.cpp @@ -117,22 +117,20 @@ VArc &VArc::operator =(const VArc &arc) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VArc::VArc(VArc &&arc) Q_DECL_NOTHROW + : VAbstractArc(arc), d (arc.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VArc &VArc::operator=(VArc &&arc) Q_DECL_NOTHROW { - Swap(arc); + VAbstractArc::operator=(arc); + std::swap(d, arc.d); return *this; } #endif - -//--------------------------------------------------------------------------------------------------------------------- -inline void VArc::Swap(VArc &arc) Q_DECL_NOTHROW -{ - VAbstractArc::Swap(arc); - std::swap(d, arc.d); -} - //--------------------------------------------------------------------------------------------------------------------- VArc VArc::Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix) const { diff --git a/src/libs/vgeometry/varc.h b/src/libs/vgeometry/varc.h index 132af80cb..b860d98a1 100644 --- a/src/libs/vgeometry/varc.h +++ b/src/libs/vgeometry/varc.h @@ -66,11 +66,10 @@ public: VArc& operator= (const VArc &arc); #ifdef Q_COMPILER_RVALUE_REFS + VArc(VArc &&arc) Q_DECL_NOTHROW; VArc &operator=(VArc &&arc) Q_DECL_NOTHROW; #endif - void Swap(VArc &arc) Q_DECL_NOTHROW; - QString GetFormulaRadius () const; void SetFormulaRadius (const QString &formula, qreal value); qreal GetRadius () const; diff --git a/src/libs/vgeometry/vcubicbezier.cpp b/src/libs/vgeometry/vcubicbezier.cpp index 5e66b9e1a..fec48e7c8 100644 --- a/src/libs/vgeometry/vcubicbezier.cpp +++ b/src/libs/vgeometry/vcubicbezier.cpp @@ -65,21 +65,20 @@ VCubicBezier &VCubicBezier::operator=(const VCubicBezier &curve) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VCubicBezier::VCubicBezier(const VCubicBezier &&curve) Q_DECL_NOTHROW + : VAbstractCubicBezier(curve), d(curve.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VCubicBezier &VCubicBezier::operator=(VCubicBezier &&curve) Q_DECL_NOTHROW { - Swap(curve); + VAbstractCubicBezier::operator=(curve); + std::swap(d, curve.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VCubicBezier::Swap(VCubicBezier &curve) Q_DECL_NOTHROW -{ - VAbstractCubicBezier::Swap(curve); - std::swap(d, curve.d); -} - //--------------------------------------------------------------------------------------------------------------------- VCubicBezier VCubicBezier::Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix) const { diff --git a/src/libs/vgeometry/vcubicbezier.h b/src/libs/vgeometry/vcubicbezier.h index 17652e77d..87dc16266 100644 --- a/src/libs/vgeometry/vcubicbezier.h +++ b/src/libs/vgeometry/vcubicbezier.h @@ -57,11 +57,10 @@ public: VCubicBezier &operator=(const VCubicBezier &curve); #ifdef Q_COMPILER_RVALUE_REFS + VCubicBezier(const VCubicBezier &&curve) Q_DECL_NOTHROW; VCubicBezier &operator=(VCubicBezier &&curve) Q_DECL_NOTHROW; #endif - void Swap(VCubicBezier &curve) Q_DECL_NOTHROW; - virtual VPointF GetP1() const override; void SetP1(const VPointF &p); diff --git a/src/libs/vgeometry/vcubicbezierpath.cpp b/src/libs/vgeometry/vcubicbezierpath.cpp index ba43248db..867a848ce 100644 --- a/src/libs/vgeometry/vcubicbezierpath.cpp +++ b/src/libs/vgeometry/vcubicbezierpath.cpp @@ -79,21 +79,21 @@ VCubicBezierPath &VCubicBezierPath::operator=(const VCubicBezierPath &curve) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VCubicBezierPath::VCubicBezierPath(const VCubicBezierPath &&curve) Q_DECL_NOTHROW + : VAbstractCubicBezierPath(curve), + d(curve.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VCubicBezierPath &VCubicBezierPath::operator=(VCubicBezierPath &&curve) Q_DECL_NOTHROW { - Swap(curve); + VAbstractCubicBezierPath::operator=(curve); + std::swap(d, curve.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VCubicBezierPath::Swap(VCubicBezierPath &curve) Q_DECL_NOTHROW -{ - VAbstractCubicBezierPath::Swap(curve); - std::swap(d, curve.d); -} - //--------------------------------------------------------------------------------------------------------------------- VCubicBezierPath VCubicBezierPath::Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix) const { diff --git a/src/libs/vgeometry/vcubicbezierpath.h b/src/libs/vgeometry/vcubicbezierpath.h index 8bb565e24..817def269 100644 --- a/src/libs/vgeometry/vcubicbezierpath.h +++ b/src/libs/vgeometry/vcubicbezierpath.h @@ -58,11 +58,10 @@ public: VCubicBezierPath &operator=(const VCubicBezierPath &curve); #ifdef Q_COMPILER_RVALUE_REFS + VCubicBezierPath(const VCubicBezierPath &&curve) Q_DECL_NOTHROW; VCubicBezierPath &operator=(VCubicBezierPath &&curve) Q_DECL_NOTHROW; #endif - void Swap(VCubicBezierPath &curve) Q_DECL_NOTHROW; - VPointF &operator[](int indx); const VPointF &at(int indx) const; diff --git a/src/libs/vgeometry/vellipticalarc.cpp b/src/libs/vgeometry/vellipticalarc.cpp index 41dfcd0e9..ed9eb22e6 100644 --- a/src/libs/vgeometry/vellipticalarc.cpp +++ b/src/libs/vgeometry/vellipticalarc.cpp @@ -124,21 +124,20 @@ VEllipticalArc &VEllipticalArc::operator =(const VEllipticalArc &arc) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VEllipticalArc::VEllipticalArc(const VEllipticalArc &&arc) Q_DECL_NOTHROW + : VAbstractArc(arc), d (arc.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VEllipticalArc &VEllipticalArc::operator=(VEllipticalArc &&arc) Q_DECL_NOTHROW { - Swap(arc); + VAbstractArc::operator=(arc); + std::swap(d, arc.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VEllipticalArc::Swap(VEllipticalArc &arc) Q_DECL_NOTHROW -{ - VAbstractArc::Swap(arc); - std::swap(d, arc.d); -} - //--------------------------------------------------------------------------------------------------------------------- VEllipticalArc VEllipticalArc::Rotate(QPointF originPoint, qreal degrees, const QString &prefix) const { diff --git a/src/libs/vgeometry/vellipticalarc.h b/src/libs/vgeometry/vellipticalarc.h index c70f64b30..c276bc97d 100644 --- a/src/libs/vgeometry/vellipticalarc.h +++ b/src/libs/vgeometry/vellipticalarc.h @@ -69,11 +69,10 @@ public: VEllipticalArc& operator= (const VEllipticalArc &arc); #ifdef Q_COMPILER_RVALUE_REFS + VEllipticalArc(const VEllipticalArc &&arc) Q_DECL_NOTHROW; VEllipticalArc &operator=(VEllipticalArc &&arc) Q_DECL_NOTHROW; #endif - void Swap(VEllipticalArc &arc) Q_DECL_NOTHROW; - QString GetFormulaRotationAngle () const; void SetFormulaRotationAngle (const QString &formula, qreal value); qreal GetRotationAngle() const; diff --git a/src/libs/vgeometry/vgobject.cpp b/src/libs/vgeometry/vgobject.cpp index b8034f1a4..a07b92c92 100644 --- a/src/libs/vgeometry/vgobject.cpp +++ b/src/libs/vgeometry/vgobject.cpp @@ -128,21 +128,19 @@ VGObject &VGObject::operator=(const VGObject &obj) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VGObject::VGObject(const VGObject &&obj) Q_DECL_NOTHROW + :d (obj.d) +{} //--------------------------------------------------------------------------------------------------------------------- VGObject &VGObject::operator=(VGObject &&obj) Q_DECL_NOTHROW { - Swap(obj); + std::swap(d, obj.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VGObject::Swap(VGObject &obj) Q_DECL_NOTHROW -{ - std::swap(d, obj.d); -} - //--------------------------------------------------------------------------------------------------------------------- VGObject::~VGObject() {} diff --git a/src/libs/vgeometry/vgobject.h b/src/libs/vgeometry/vgobject.h index 236ee0f1e..0f3764043 100644 --- a/src/libs/vgeometry/vgobject.h +++ b/src/libs/vgeometry/vgobject.h @@ -59,11 +59,10 @@ public: VGObject& operator= (const VGObject &obj); #ifdef Q_COMPILER_RVALUE_REFS + VGObject(const VGObject &&obj) Q_DECL_NOTHROW; VGObject &operator=(VGObject &&obj) Q_DECL_NOTHROW; #endif - void Swap(VGObject &obj) Q_DECL_NOTHROW; - quint32 getIdObject() const; void setIdObject(const quint32 &value); diff --git a/src/libs/vgeometry/vplacelabelitem.cpp b/src/libs/vgeometry/vplacelabelitem.cpp index 303c5e4d0..d5cc3fe68 100644 --- a/src/libs/vgeometry/vplacelabelitem.cpp +++ b/src/libs/vgeometry/vplacelabelitem.cpp @@ -226,21 +226,20 @@ VPlaceLabelItem &VPlaceLabelItem::operator=(const VPlaceLabelItem &item) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VPlaceLabelItem::VPlaceLabelItem(const VPlaceLabelItem &&item) Q_DECL_NOTHROW + : VPointF(item), d(item.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VPlaceLabelItem &VPlaceLabelItem::operator=(VPlaceLabelItem &&item) Q_DECL_NOTHROW { - Swap(item); + VPointF::operator=(item); + std::swap(d, item.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VPlaceLabelItem::Swap(VPlaceLabelItem &item) Q_DECL_NOTHROW -{ - VPointF::Swap(item); - std::swap(d, item.d); -} - //--------------------------------------------------------------------------------------------------------------------- PlaceLabelImg VPlaceLabelItem::LabelShape() const { diff --git a/src/libs/vgeometry/vplacelabelitem.h b/src/libs/vgeometry/vplacelabelitem.h index 758a50877..c00ca75cc 100644 --- a/src/libs/vgeometry/vplacelabelitem.h +++ b/src/libs/vgeometry/vplacelabelitem.h @@ -48,11 +48,10 @@ public: VPlaceLabelItem &operator=(const VPlaceLabelItem &item); #ifdef Q_COMPILER_RVALUE_REFS + VPlaceLabelItem(const VPlaceLabelItem &&item) Q_DECL_NOTHROW; VPlaceLabelItem &operator=(VPlaceLabelItem &&item) Q_DECL_NOTHROW; #endif - void Swap(VPlaceLabelItem &item) Q_DECL_NOTHROW; - QString GetWidthFormula() const; QString& GetWidthFormula(); qreal GetWidth() const; diff --git a/src/libs/vgeometry/vpointf.cpp b/src/libs/vgeometry/vpointf.cpp index 628a8b556..2f0dad69f 100644 --- a/src/libs/vgeometry/vpointf.cpp +++ b/src/libs/vgeometry/vpointf.cpp @@ -103,21 +103,20 @@ VPointF &VPointF::operator =(const VPointF &point) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VPointF::VPointF(const VPointF &&point) Q_DECL_NOTHROW + :VGObject(point), d(point.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VPointF &VPointF::operator=(VPointF &&point) Q_DECL_NOTHROW { - Swap(point); + VGObject::operator=(point); + std::swap(d, point.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VPointF::Swap(VPointF &point) Q_DECL_NOTHROW -{ - VGObject::Swap(point); - std::swap(d, point.d); -} - //--------------------------------------------------------------------------------------------------------------------- VPointF::operator QPointF() const { diff --git a/src/libs/vgeometry/vpointf.h b/src/libs/vgeometry/vpointf.h index 323f27aa4..ee0b17e8e 100644 --- a/src/libs/vgeometry/vpointf.h +++ b/src/libs/vgeometry/vpointf.h @@ -62,11 +62,10 @@ public: VPointF &operator=(const VPointF &point); #ifdef Q_COMPILER_RVALUE_REFS + VPointF(const VPointF &&point) Q_DECL_NOTHROW; VPointF &operator=(VPointF &&point) Q_DECL_NOTHROW; #endif - void Swap(VPointF &point) Q_DECL_NOTHROW; - explicit operator QPointF() const; VPointF Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const; VPointF Flip(const QLineF &axis, const QString &prefix = QString()) const; diff --git a/src/libs/vgeometry/vspline.cpp b/src/libs/vgeometry/vspline.cpp index 3b1728076..28222c0f3 100644 --- a/src/libs/vgeometry/vspline.cpp +++ b/src/libs/vgeometry/vspline.cpp @@ -248,21 +248,20 @@ VSpline &VSpline::operator =(const VSpline &spline) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VSpline::VSpline(const VSpline &&spline) Q_DECL_NOTHROW + :VAbstractCubicBezier(spline), d(spline.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VSpline &VSpline::operator=(VSpline &&spline) Q_DECL_NOTHROW { - Swap(spline); + VAbstractCubicBezier::operator=(spline); + std::swap(d, spline.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VSpline::Swap(VSpline &spline) Q_DECL_NOTHROW -{ - VAbstractCubicBezier::Swap(spline); - std::swap(d, spline.d); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief GetP1 return first spline point. diff --git a/src/libs/vgeometry/vspline.h b/src/libs/vgeometry/vspline.h index 09d037c88..f53e2254d 100644 --- a/src/libs/vgeometry/vspline.h +++ b/src/libs/vgeometry/vspline.h @@ -67,11 +67,10 @@ public: VSpline &operator=(const VSpline &spline); #ifdef Q_COMPILER_RVALUE_REFS + VSpline(const VSpline &&spline) Q_DECL_NOTHROW; VSpline &operator=(VSpline &&spline) Q_DECL_NOTHROW; #endif - void Swap(VSpline &spline) Q_DECL_NOTHROW; - virtual VPointF GetP1 () const override; void SetP1 (const VPointF &p); diff --git a/src/libs/vgeometry/vsplinepath.cpp b/src/libs/vgeometry/vsplinepath.cpp index d10f44bd4..015da4a3f 100644 --- a/src/libs/vgeometry/vsplinepath.cpp +++ b/src/libs/vgeometry/vsplinepath.cpp @@ -304,21 +304,21 @@ VSplinePath &VSplinePath::operator =(const VSplinePath &path) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VSplinePath::VSplinePath(const VSplinePath &&splPath) Q_DECL_NOTHROW + : VAbstractCubicBezierPath(splPath), + d(splPath.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VSplinePath &VSplinePath::operator=(VSplinePath &&path) Q_DECL_NOTHROW { - Swap(path); + VAbstractCubicBezierPath::operator=(path); + std::swap(d, path.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VSplinePath::Swap(VSplinePath &path) Q_DECL_NOTHROW -{ - VAbstractCubicBezierPath::Swap(path); - std::swap(d, path.d); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief operator [] return spline point by index. diff --git a/src/libs/vgeometry/vsplinepath.h b/src/libs/vgeometry/vsplinepath.h index 933aa72b7..177e47fb7 100644 --- a/src/libs/vgeometry/vsplinepath.h +++ b/src/libs/vgeometry/vsplinepath.h @@ -67,11 +67,10 @@ public: VSplinePoint &operator[](int indx); VSplinePath &operator=(const VSplinePath &path); #ifdef Q_COMPILER_RVALUE_REFS + VSplinePath(const VSplinePath&& splPath) Q_DECL_NOTHROW; VSplinePath &operator=(VSplinePath &&path) Q_DECL_NOTHROW; #endif - void Swap(VSplinePath &path) Q_DECL_NOTHROW; - void append(const VSplinePoint &point); virtual qint32 CountSubSpl() const override; diff --git a/src/libs/vgeometry/vsplinepoint.cpp b/src/libs/vgeometry/vsplinepoint.cpp index 7cbf93e5c..7ebcc57aa 100644 --- a/src/libs/vgeometry/vsplinepoint.cpp +++ b/src/libs/vgeometry/vsplinepoint.cpp @@ -76,19 +76,19 @@ VFSplinePoint &VFSplinePoint::operator=(const VFSplinePoint &point) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VFSplinePoint::VFSplinePoint(const VFSplinePoint &&point) Q_DECL_NOTHROW + :d(point.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VFSplinePoint &VFSplinePoint::operator=(VFSplinePoint &&point) Q_DECL_NOTHROW { - Swap(point); + std::swap(d, point.d); return *this; } #endif -void VFSplinePoint::Swap(VFSplinePoint &point) Q_DECL_NOTHROW -{ - std::swap(d, point.d); -} - //--------------------------------------------------------------------------------------------------------------------- VFSplinePoint::~VFSplinePoint() {} @@ -235,20 +235,19 @@ VSplinePoint &VSplinePoint::operator=(const VSplinePoint &point) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VSplinePoint::VSplinePoint(const VSplinePoint &&point) Q_DECL_NOTHROW + : d(point.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VSplinePoint &VSplinePoint::operator=(VSplinePoint &&point) Q_DECL_NOTHROW { - Swap(point); + std::swap(d, point.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VSplinePoint::Swap(VSplinePoint &point) Q_DECL_NOTHROW -{ - std::swap(d, point.d); -} - //--------------------------------------------------------------------------------------------------------------------- VSplinePoint::~VSplinePoint() { diff --git a/src/libs/vgeometry/vsplinepoint.h b/src/libs/vgeometry/vsplinepoint.h index e03b2fc1a..246cd2eb1 100644 --- a/src/libs/vgeometry/vsplinepoint.h +++ b/src/libs/vgeometry/vsplinepoint.h @@ -53,11 +53,10 @@ public: VFSplinePoint &operator=(const VFSplinePoint &point); #ifdef Q_COMPILER_RVALUE_REFS + VFSplinePoint(const VFSplinePoint &&point) Q_DECL_NOTHROW; VFSplinePoint &operator=(VFSplinePoint &&point) Q_DECL_NOTHROW; #endif - void Swap(VFSplinePoint &point) Q_DECL_NOTHROW; - VPointF P() const; void SetP(const VPointF &value); qreal Angle1() const; @@ -92,11 +91,10 @@ public: VSplinePoint &operator=(const VSplinePoint &point); #ifdef Q_COMPILER_RVALUE_REFS + VSplinePoint(const VSplinePoint &&point) Q_DECL_NOTHROW; VSplinePoint &operator=(VSplinePoint &&point) Q_DECL_NOTHROW; #endif - void Swap(VSplinePoint &point) Q_DECL_NOTHROW; - VPointF P() const; void SetP(const VPointF &value); diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index 88e60b189..a8d848633 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -919,20 +919,19 @@ VAbstractPiece &VAbstractPiece::operator=(const VAbstractPiece &piece) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VAbstractPiece::VAbstractPiece(const VAbstractPiece &&piece) Q_DECL_NOTHROW + :d (piece.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VAbstractPiece &VAbstractPiece::operator=(VAbstractPiece &&piece) Q_DECL_NOTHROW { - Swap(piece); + std::swap(d, piece.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractPiece::Swap(VAbstractPiece &piece) Q_DECL_NOTHROW -{ - std::swap(d, piece.d); -} - //--------------------------------------------------------------------------------------------------------------------- VAbstractPiece::~VAbstractPiece() {} diff --git a/src/libs/vlayout/vabstractpiece.h b/src/libs/vlayout/vabstractpiece.h index 1cdf8f437..2a0dddc1e 100644 --- a/src/libs/vlayout/vabstractpiece.h +++ b/src/libs/vlayout/vabstractpiece.h @@ -57,11 +57,10 @@ public: VAbstractPiece &operator=(const VAbstractPiece &piece); #ifdef Q_COMPILER_RVALUE_REFS + VAbstractPiece(const VAbstractPiece &&piece) Q_DECL_NOTHROW; VAbstractPiece &operator=(VAbstractPiece &&piece) Q_DECL_NOTHROW; #endif - void Swap(VAbstractPiece &piece) Q_DECL_NOTHROW; - QString GetName() const; void SetName(const QString &value); diff --git a/src/libs/vlayout/vbestsquare.cpp b/src/libs/vlayout/vbestsquare.cpp index 9a2d25c76..9751f8e4c 100644 --- a/src/libs/vlayout/vbestsquare.cpp +++ b/src/libs/vlayout/vbestsquare.cpp @@ -72,20 +72,19 @@ VBestSquare &VBestSquare::operator=(const VBestSquare &res) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VBestSquare::VBestSquare(const VBestSquare &&res) Q_DECL_NOTHROW + : d(res.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VBestSquare &VBestSquare::operator=(VBestSquare &&res) Q_DECL_NOTHROW { - Swap(res); + std::swap(d, res.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VBestSquare::Swap(VBestSquare &res) Q_DECL_NOTHROW -{ - std::swap(d, res.d); -} - //--------------------------------------------------------------------------------------------------------------------- void VBestSquare::NewResult(const VBestSquareResData &data) { diff --git a/src/libs/vlayout/vbestsquare.h b/src/libs/vlayout/vbestsquare.h index 1423485fd..579e840a6 100644 --- a/src/libs/vlayout/vbestsquare.h +++ b/src/libs/vlayout/vbestsquare.h @@ -49,11 +49,10 @@ public: VBestSquare &operator=(const VBestSquare &res); #ifdef Q_COMPILER_RVALUE_REFS + VBestSquare(const VBestSquare &&res) Q_DECL_NOTHROW; VBestSquare &operator=(VBestSquare &&res) Q_DECL_NOTHROW; #endif - void Swap(VBestSquare &res) Q_DECL_NOTHROW; - void NewResult(const VBestSquareResData &data); void NewResult(const VBestSquare &best); diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index 8e46562ec..68651d3d8 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -125,20 +125,19 @@ VContour &VContour::operator=(const VContour &contour) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VContour::VContour(const VContour &&contour) Q_DECL_NOTHROW + :d (contour.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VContour &VContour::operator=(VContour &&contour) Q_DECL_NOTHROW { - Swap(contour); + std::swap(d, contour.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VContour::Swap(VContour &contour) Q_DECL_NOTHROW -{ - std::swap(d, contour.d); -} - //--------------------------------------------------------------------------------------------------------------------- VContour::~VContour() {} diff --git a/src/libs/vlayout/vcontour.h b/src/libs/vlayout/vcontour.h index d569c9cf7..18e16cb04 100644 --- a/src/libs/vlayout/vcontour.h +++ b/src/libs/vlayout/vcontour.h @@ -55,11 +55,10 @@ public: VContour &operator=(const VContour &contour); #ifdef Q_COMPILER_RVALUE_REFS + VContour(const VContour &&contour) Q_DECL_NOTHROW; VContour &operator=(VContour &&contour) Q_DECL_NOTHROW; #endif - void Swap(VContour &contour) Q_DECL_NOTHROW; - void CeateEmptySheetContour(); void SetContour(const QVector &contour); diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index a10494ce5..82cf221a5 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -77,20 +77,19 @@ VLayoutPaper &VLayoutPaper::operator=(const VLayoutPaper &paper) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::VLayoutPaper(const VLayoutPaper &&paper) Q_DECL_NOTHROW + :d (paper.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VLayoutPaper &VLayoutPaper::operator=(VLayoutPaper &&paper) Q_DECL_NOTHROW { - Swap(paper); + std::swap(d, paper.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VLayoutPaper::Swap(VLayoutPaper &paper) Q_DECL_NOTHROW -{ - std::swap(d, paper.d); -} - //--------------------------------------------------------------------------------------------------------------------- VLayoutPaper::~VLayoutPaper() {} diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 26ffd5ee0..1ed3f58e5 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -58,11 +58,10 @@ public: VLayoutPaper &operator=(const VLayoutPaper &paper); #ifdef Q_COMPILER_RVALUE_REFS + VLayoutPaper(const VLayoutPaper &&paper) Q_DECL_NOTHROW; VLayoutPaper &operator=(VLayoutPaper &&paper) Q_DECL_NOTHROW; #endif - void Swap(VLayoutPaper &paper) Q_DECL_NOTHROW; - int GetHeight() const; void SetHeight(int height); diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 472a2e76f..abbaf193a 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -405,21 +405,20 @@ VLayoutPiece &VLayoutPiece::operator=(const VLayoutPiece &detail) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPiece::VLayoutPiece(const VLayoutPiece &&detail) Q_DECL_NOTHROW + :VAbstractPiece(detail), d(detail.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VLayoutPiece &VLayoutPiece::operator=(VLayoutPiece &&detail) Q_DECL_NOTHROW { - Swap(detail); + VAbstractPiece::operator=(detail); + std::swap(d, detail.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VLayoutPiece::Swap(VLayoutPiece &detail) Q_DECL_NOTHROW -{ - VAbstractPiece::Swap(detail); - std::swap(d, detail.d); -} - //--------------------------------------------------------------------------------------------------------------------- VLayoutPiece::~VLayoutPiece() {} diff --git a/src/libs/vlayout/vlayoutpiece.h b/src/libs/vlayout/vlayoutpiece.h index 2ee682f60..011ef2f8b 100644 --- a/src/libs/vlayout/vlayoutpiece.h +++ b/src/libs/vlayout/vlayoutpiece.h @@ -67,11 +67,10 @@ public: VLayoutPiece &operator=(const VLayoutPiece &detail); #ifdef Q_COMPILER_RVALUE_REFS + VLayoutPiece(const VLayoutPiece &&detail) Q_DECL_NOTHROW; VLayoutPiece &operator=(VLayoutPiece &&detail) Q_DECL_NOTHROW; #endif - void Swap(VLayoutPiece &detail) Q_DECL_NOTHROW; - static VLayoutPiece Create(const VPiece &piece, vidtype id, const VContainer *pattern); QVector GetMappedContourPoints() const; diff --git a/src/libs/vlayout/vlayoutpiecepath.cpp b/src/libs/vlayout/vlayoutpiecepath.cpp index c83841e19..9bb30bbdb 100644 --- a/src/libs/vlayout/vlayoutpiecepath.cpp +++ b/src/libs/vlayout/vlayoutpiecepath.cpp @@ -80,20 +80,19 @@ VLayoutPiecePath &VLayoutPiecePath::operator=(const VLayoutPiecePath &path) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPiecePath::VLayoutPiecePath(const VLayoutPiecePath &&path) Q_DECL_NOTHROW + : d(path.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VLayoutPiecePath &VLayoutPiecePath::operator=(VLayoutPiecePath &&path) Q_DECL_NOTHROW { - Swap(path); + std::swap(d, path.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VLayoutPiecePath::Swap(VLayoutPiecePath &path) Q_DECL_NOTHROW -{ - std::swap(d, path.d); -} - //--------------------------------------------------------------------------------------------------------------------- VLayoutPiecePath::~VLayoutPiecePath() { diff --git a/src/libs/vlayout/vlayoutpiecepath.h b/src/libs/vlayout/vlayoutpiecepath.h index c1e4645e6..57dc171a7 100644 --- a/src/libs/vlayout/vlayoutpiecepath.h +++ b/src/libs/vlayout/vlayoutpiecepath.h @@ -47,11 +47,10 @@ public: VLayoutPiecePath &operator=(const VLayoutPiecePath &path); #ifdef Q_COMPILER_RVALUE_REFS + VLayoutPiecePath(const VLayoutPiecePath &&path) Q_DECL_NOTHROW; VLayoutPiecePath &operator=(VLayoutPiecePath &&path) Q_DECL_NOTHROW; #endif - void Swap(VLayoutPiecePath &path) Q_DECL_NOTHROW; - QPainterPath GetPainterPath() const; QVector Points() const; diff --git a/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata.cpp b/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata.cpp index 04d9ec8a4..467187158 100644 --- a/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata.cpp +++ b/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata.cpp @@ -51,20 +51,19 @@ VAbstractFloatItemData &VAbstractFloatItemData::operator=(const VAbstractFloatIt } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VAbstractFloatItemData::VAbstractFloatItemData(const VAbstractFloatItemData &&data) Q_DECL_NOTHROW + : d (data.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VAbstractFloatItemData &VAbstractFloatItemData::operator=(VAbstractFloatItemData &&data) Q_DECL_NOTHROW { - Swap(data); + std::swap(d, data.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractFloatItemData::Swap(VAbstractFloatItemData &data) Q_DECL_NOTHROW -{ - std::swap(d, data.d); -} - //--------------------------------------------------------------------------------------------------------------------- VAbstractFloatItemData::~VAbstractFloatItemData() {} diff --git a/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata.h b/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata.h index 6e59bcf0c..5b5c6fc8c 100644 --- a/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata.h +++ b/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata.h @@ -44,11 +44,10 @@ public: VAbstractFloatItemData &operator=(const VAbstractFloatItemData &data); #ifdef Q_COMPILER_RVALUE_REFS + VAbstractFloatItemData(const VAbstractFloatItemData &&data) Q_DECL_NOTHROW; VAbstractFloatItemData &operator=(VAbstractFloatItemData &&data) Q_DECL_NOTHROW; #endif - void Swap(VAbstractFloatItemData &data) Q_DECL_NOTHROW; - // methods, which set and return values of different parameters QPointF GetPos() const; void SetPos(const QPointF& ptPos); diff --git a/src/libs/vpatterndb/floatItemData/vgrainlinedata.cpp b/src/libs/vpatterndb/floatItemData/vgrainlinedata.cpp index aa2bc61af..516c58db8 100644 --- a/src/libs/vpatterndb/floatItemData/vgrainlinedata.cpp +++ b/src/libs/vpatterndb/floatItemData/vgrainlinedata.cpp @@ -56,21 +56,21 @@ VGrainlineData &VGrainlineData::operator=(const VGrainlineData &data) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VGrainlineData::VGrainlineData(const VGrainlineData &&data) Q_DECL_NOTHROW + : VAbstractFloatItemData(data), + d (data.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VGrainlineData &VGrainlineData::operator=(VGrainlineData &&data) Q_DECL_NOTHROW { - Swap(data); + VAbstractFloatItemData::operator=(data); + std::swap(d, data.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VGrainlineData::Swap(VGrainlineData &data) Q_DECL_NOTHROW -{ - VAbstractFloatItemData::Swap(data); - std::swap(d, data.d); -} - //--------------------------------------------------------------------------------------------------------------------- VGrainlineData::~VGrainlineData() {} diff --git a/src/libs/vpatterndb/floatItemData/vgrainlinedata.h b/src/libs/vpatterndb/floatItemData/vgrainlinedata.h index 4bc83da7c..4d31614ac 100644 --- a/src/libs/vpatterndb/floatItemData/vgrainlinedata.h +++ b/src/libs/vpatterndb/floatItemData/vgrainlinedata.h @@ -51,11 +51,10 @@ public: VGrainlineData &operator=(const VGrainlineData &data); #ifdef Q_COMPILER_RVALUE_REFS + VGrainlineData(const VGrainlineData &&data) Q_DECL_NOTHROW; VGrainlineData &operator=(VGrainlineData &&data) Q_DECL_NOTHROW; #endif - void Swap(VGrainlineData &data) Q_DECL_NOTHROW; - // methods, which set and return values of different parameters QString GetLength() const; void SetLength(const QString& qsLen); diff --git a/src/libs/vpatterndb/floatItemData/vpatternlabeldata.cpp b/src/libs/vpatterndb/floatItemData/vpatternlabeldata.cpp index aa0a02c36..bb538b4af 100644 --- a/src/libs/vpatterndb/floatItemData/vpatternlabeldata.cpp +++ b/src/libs/vpatterndb/floatItemData/vpatternlabeldata.cpp @@ -55,21 +55,21 @@ VPatternLabelData &VPatternLabelData::operator=(const VPatternLabelData &data) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VPatternLabelData::VPatternLabelData(const VPatternLabelData &&data) Q_DECL_NOTHROW + : VAbstractFloatItemData(data), + d (data.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VPatternLabelData &VPatternLabelData::operator=(VPatternLabelData &&data) Q_DECL_NOTHROW { - Swap(data); + VAbstractFloatItemData::operator=(data); + std::swap(d, data.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VPatternLabelData::Swap(VPatternLabelData &data) Q_DECL_NOTHROW -{ - VAbstractFloatItemData::Swap(data); - std::swap(d, data.d); -} - //--------------------------------------------------------------------------------------------------------------------- VPatternLabelData::~VPatternLabelData() {} diff --git a/src/libs/vpatterndb/floatItemData/vpatternlabeldata.h b/src/libs/vpatterndb/floatItemData/vpatternlabeldata.h index b7e482dc4..ec780bc14 100644 --- a/src/libs/vpatterndb/floatItemData/vpatternlabeldata.h +++ b/src/libs/vpatterndb/floatItemData/vpatternlabeldata.h @@ -48,11 +48,10 @@ public: VPatternLabelData &operator=(const VPatternLabelData &data); #ifdef Q_COMPILER_RVALUE_REFS + VPatternLabelData(const VPatternLabelData &&data) Q_DECL_NOTHROW; VPatternLabelData &operator=(VPatternLabelData &&data) Q_DECL_NOTHROW; #endif - void Swap(VPatternLabelData &data) Q_DECL_NOTHROW; - // methods, which set up label parameters QString GetLabelWidth() const; void SetLabelWidth(const QString &dLabelW); diff --git a/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp index 595a9a5b9..487908b3e 100644 --- a/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp +++ b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp @@ -56,21 +56,21 @@ VPieceLabelData &VPieceLabelData::operator=(const VPieceLabelData &data) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VPieceLabelData::VPieceLabelData(const VPieceLabelData &&data) Q_DECL_NOTHROW + : VPatternLabelData(data), + d (data.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VPieceLabelData &VPieceLabelData::operator=(VPieceLabelData &&data) Q_DECL_NOTHROW { - Swap(data); + VPatternLabelData::operator=(data); + std::swap(d, data.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VPieceLabelData::Swap(VPieceLabelData &data) Q_DECL_NOTHROW -{ - VPatternLabelData::Swap(data); - std::swap(d, data.d); -} - //--------------------------------------------------------------------------------------------------------------------- VPieceLabelData::~VPieceLabelData() {} diff --git a/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h index a70bd51b1..3fffb91fd 100644 --- a/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h +++ b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h @@ -51,11 +51,10 @@ public: VPieceLabelData &operator=(const VPieceLabelData &data); #ifdef Q_COMPILER_RVALUE_REFS + VPieceLabelData(const VPieceLabelData &&data) Q_DECL_NOTHROW; VPieceLabelData &operator=(VPieceLabelData &&data) Q_DECL_NOTHROW; #endif - void Swap(VPieceLabelData &data) Q_DECL_NOTHROW; - void Clear(); // methods, which operate on other members diff --git a/src/libs/vpatterndb/variables/vcurvevariable.cpp b/src/libs/vpatterndb/variables/vcurvevariable.cpp index a451abaf6..6b8ccd162 100644 --- a/src/libs/vpatterndb/variables/vcurvevariable.cpp +++ b/src/libs/vpatterndb/variables/vcurvevariable.cpp @@ -65,21 +65,20 @@ VCurveVariable &VCurveVariable::operator=(const VCurveVariable &var) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VCurveVariable::VCurveVariable(const VCurveVariable &&var) Q_DECL_NOTHROW + :VInternalVariable(var), d(var.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VCurveVariable &VCurveVariable::operator=(VCurveVariable &&var) Q_DECL_NOTHROW { - Swap(var); + VInternalVariable::operator=(var); + std::swap(d, var.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VCurveVariable::Swap(VCurveVariable &var) Q_DECL_NOTHROW -{ - VInternalVariable::Swap(var); - std::swap(d, var.d); -} - //--------------------------------------------------------------------------------------------------------------------- VCurveVariable::~VCurveVariable() {} diff --git a/src/libs/vpatterndb/variables/vcurvevariable.h b/src/libs/vpatterndb/variables/vcurvevariable.h index 7ee685875..f682eae71 100644 --- a/src/libs/vpatterndb/variables/vcurvevariable.h +++ b/src/libs/vpatterndb/variables/vcurvevariable.h @@ -49,11 +49,10 @@ public: VCurveVariable &operator=(const VCurveVariable &var); #ifdef Q_COMPILER_RVALUE_REFS + VCurveVariable(const VCurveVariable &&var) Q_DECL_NOTHROW; VCurveVariable &operator=(VCurveVariable &&var) Q_DECL_NOTHROW; #endif - void Swap(VCurveVariable &var) Q_DECL_NOTHROW; - virtual bool Filter(quint32 id) override; quint32 GetId() const; diff --git a/src/libs/vpatterndb/variables/vincrement.cpp b/src/libs/vpatterndb/variables/vincrement.cpp index ff1427512..119ac91f5 100644 --- a/src/libs/vpatterndb/variables/vincrement.cpp +++ b/src/libs/vpatterndb/variables/vincrement.cpp @@ -71,21 +71,20 @@ VIncrement &VIncrement::operator=(const VIncrement &incr) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VIncrement::VIncrement(const VIncrement &&incr) Q_DECL_NOTHROW + :VVariable(incr), d(incr.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VIncrement &VIncrement::operator=(VIncrement &&incr) Q_DECL_NOTHROW { - Swap(incr); + VVariable::operator=(incr); + std::swap(d, incr.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VIncrement::Swap(VIncrement &incr) Q_DECL_NOTHROW -{ - VVariable::Swap(incr); - std::swap(d, incr.d); -} - //--------------------------------------------------------------------------------------------------------------------- VIncrement::~VIncrement() {} diff --git a/src/libs/vpatterndb/variables/vincrement.h b/src/libs/vpatterndb/variables/vincrement.h index ffb647add..62da07221 100644 --- a/src/libs/vpatterndb/variables/vincrement.h +++ b/src/libs/vpatterndb/variables/vincrement.h @@ -54,11 +54,10 @@ public: VIncrement &operator=(const VIncrement &incr); #ifdef Q_COMPILER_RVALUE_REFS + VIncrement(const VIncrement &&incr) Q_DECL_NOTHROW; VIncrement &operator=(VIncrement &&incr) Q_DECL_NOTHROW; #endif - void Swap(VIncrement &incr) Q_DECL_NOTHROW; - void SetFormula(qreal base, const QString &formula, bool ok); QString GetFormula() const; bool IsFormulaOk() const; diff --git a/src/libs/vpatterndb/variables/vinternalvariable.cpp b/src/libs/vpatterndb/variables/vinternalvariable.cpp index 2d8d53e91..bfd7da0a2 100644 --- a/src/libs/vpatterndb/variables/vinternalvariable.cpp +++ b/src/libs/vpatterndb/variables/vinternalvariable.cpp @@ -50,21 +50,20 @@ VInternalVariable &VInternalVariable::operator=(const VInternalVariable &var) return *this; } +//--------------------------------------------------------------------------------------------------------------------- +VInternalVariable::VInternalVariable(const VInternalVariable &&var) Q_DECL_NOTHROW + :d(var.d) +{} + #ifdef Q_COMPILER_RVALUE_REFS //--------------------------------------------------------------------------------------------------------------------- VInternalVariable &VInternalVariable::operator=(VInternalVariable &&var) Q_DECL_NOTHROW { - Swap(var); + std::swap(d, var.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VInternalVariable::Swap(VInternalVariable &var) Q_DECL_NOTHROW -{ - std::swap(d, var.d); -} - //--------------------------------------------------------------------------------------------------------------------- VInternalVariable::~VInternalVariable() {} diff --git a/src/libs/vpatterndb/variables/vinternalvariable.h b/src/libs/vpatterndb/variables/vinternalvariable.h index 7a16b21bf..a0cfbb314 100644 --- a/src/libs/vpatterndb/variables/vinternalvariable.h +++ b/src/libs/vpatterndb/variables/vinternalvariable.h @@ -48,11 +48,10 @@ public: VInternalVariable &operator=(const VInternalVariable &var); #ifdef Q_COMPILER_RVALUE_REFS + VInternalVariable(const VInternalVariable &&var) Q_DECL_NOTHROW; VInternalVariable &operator=(VInternalVariable &&var) Q_DECL_NOTHROW; #endif - void Swap(VInternalVariable &var) Q_DECL_NOTHROW; - virtual qreal GetValue() const; virtual qreal* GetValue(); diff --git a/src/libs/vpatterndb/variables/vlineangle.cpp b/src/libs/vpatterndb/variables/vlineangle.cpp index 53b4c6256..f83063d5d 100644 --- a/src/libs/vpatterndb/variables/vlineangle.cpp +++ b/src/libs/vpatterndb/variables/vlineangle.cpp @@ -77,22 +77,21 @@ VLineAngle &VLineAngle::operator=(const VLineAngle &var) return *this; } +//--------------------------------------------------------------------------------------------------------------------- +VLineAngle::VLineAngle(const VLineAngle &&var) Q_DECL_NOTHROW + :VInternalVariable(var), d(var.d) +{} + #ifdef Q_COMPILER_RVALUE_REFS //--------------------------------------------------------------------------------------------------------------------- VLineAngle &VLineAngle::operator=(VLineAngle &&var) Q_DECL_NOTHROW { - Swap(var); + VInternalVariable::operator=(var); + std::swap(d, var.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VLineAngle::Swap(VLineAngle &var) Q_DECL_NOTHROW -{ - VInternalVariable::Swap(var); - std::swap(d, var.d); -} - //--------------------------------------------------------------------------------------------------------------------- VLineAngle::~VLineAngle() {} diff --git a/src/libs/vpatterndb/variables/vlineangle.h b/src/libs/vpatterndb/variables/vlineangle.h index 34dff5c13..afc4ab42b 100644 --- a/src/libs/vpatterndb/variables/vlineangle.h +++ b/src/libs/vpatterndb/variables/vlineangle.h @@ -50,11 +50,10 @@ public: VLineAngle &operator=(const VLineAngle &var); #ifdef Q_COMPILER_RVALUE_REFS + VLineAngle(const VLineAngle &&var) Q_DECL_NOTHROW; VLineAngle &operator=(VLineAngle &&var) Q_DECL_NOTHROW; #endif - void Swap(VLineAngle &var) Q_DECL_NOTHROW; - virtual bool Filter(quint32 id) override; void SetValue(const VPointF *p1, const VPointF *p2); quint32 GetP1Id() const; diff --git a/src/libs/vpatterndb/variables/vlinelength.cpp b/src/libs/vpatterndb/variables/vlinelength.cpp index 84319f4c9..a459630cd 100644 --- a/src/libs/vpatterndb/variables/vlinelength.cpp +++ b/src/libs/vpatterndb/variables/vlinelength.cpp @@ -75,22 +75,21 @@ VLengthLine &VLengthLine::operator=(const VLengthLine &var) return *this; } +//--------------------------------------------------------------------------------------------------------------------- +VLengthLine::VLengthLine(const VLengthLine &&var) Q_DECL_NOTHROW + :VInternalVariable(var), d(var.d) +{} + #ifdef Q_COMPILER_RVALUE_REFS //--------------------------------------------------------------------------------------------------------------------- VLengthLine &VLengthLine::operator=(VLengthLine &&var) Q_DECL_NOTHROW { - Swap(var); + VInternalVariable::operator=(var); + std::swap(d, var.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VLengthLine::Swap(VLengthLine &var) Q_DECL_NOTHROW -{ - VInternalVariable::Swap(var); - std::swap(d, var.d); -} - //--------------------------------------------------------------------------------------------------------------------- VLengthLine::~VLengthLine() {} diff --git a/src/libs/vpatterndb/variables/vlinelength.h b/src/libs/vpatterndb/variables/vlinelength.h index 3b340b87a..5d62f34a9 100644 --- a/src/libs/vpatterndb/variables/vlinelength.h +++ b/src/libs/vpatterndb/variables/vlinelength.h @@ -52,11 +52,10 @@ public: VLengthLine &operator=(const VLengthLine &var); #ifdef Q_COMPILER_RVALUE_REFS + VLengthLine(const VLengthLine &&var) Q_DECL_NOTHROW; VLengthLine &operator=(VLengthLine &&var) Q_DECL_NOTHROW; #endif - void Swap(VLengthLine &var) Q_DECL_NOTHROW; - virtual bool Filter(quint32 id) override; void SetValue(const VPointF *p1, const VPointF *p2); quint32 GetP1Id() const; diff --git a/src/libs/vpatterndb/variables/vmeasurement.cpp b/src/libs/vpatterndb/variables/vmeasurement.cpp index 5e04d3f40..db4ac3964 100644 --- a/src/libs/vpatterndb/variables/vmeasurement.cpp +++ b/src/libs/vpatterndb/variables/vmeasurement.cpp @@ -93,21 +93,20 @@ VMeasurement &VMeasurement::operator=(const VMeasurement &m) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VMeasurement::VMeasurement(const VMeasurement &&m) Q_DECL_NOTHROW + :VVariable(m), d(m.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VMeasurement &VMeasurement::operator=(VMeasurement &&m) Q_DECL_NOTHROW { - Swap(m); + VVariable::operator=(m); + std::swap(d, m.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VMeasurement::Swap(VMeasurement &m) Q_DECL_NOTHROW -{ - VVariable::Swap(m); - std::swap(d, m.d); -} - //--------------------------------------------------------------------------------------------------------------------- VMeasurement::~VMeasurement() {} diff --git a/src/libs/vpatterndb/variables/vmeasurement.h b/src/libs/vpatterndb/variables/vmeasurement.h index 03ed4e80c..d32967798 100644 --- a/src/libs/vpatterndb/variables/vmeasurement.h +++ b/src/libs/vpatterndb/variables/vmeasurement.h @@ -62,11 +62,10 @@ public: VMeasurement &operator=(const VMeasurement &m); #ifdef Q_COMPILER_RVALUE_REFS + VMeasurement(const VMeasurement &&m) Q_DECL_NOTHROW; VMeasurement &operator=(VMeasurement &&m) Q_DECL_NOTHROW; #endif - void Swap(VMeasurement &m) Q_DECL_NOTHROW; - QString GetGuiText() const; QString TagName() const; diff --git a/src/libs/vpatterndb/variables/vvariable.cpp b/src/libs/vpatterndb/variables/vvariable.cpp index 4771a4734..b33ae49fd 100644 --- a/src/libs/vpatterndb/variables/vvariable.cpp +++ b/src/libs/vpatterndb/variables/vvariable.cpp @@ -64,21 +64,20 @@ VVariable &VVariable::operator=(const VVariable &var) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VVariable::VVariable(const VVariable &&var) Q_DECL_NOTHROW + :VInternalVariable(var), d(var.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VVariable &VVariable::operator=(VVariable &&var) Q_DECL_NOTHROW { - Swap(var); + VInternalVariable::operator=(var); + std::swap(d, var.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VVariable::Swap(VVariable &var) Q_DECL_NOTHROW -{ - VInternalVariable::Swap(var); - std::swap(d, var.d); -} - //--------------------------------------------------------------------------------------------------------------------- VVariable::~VVariable() {} diff --git a/src/libs/vpatterndb/variables/vvariable.h b/src/libs/vpatterndb/variables/vvariable.h index c356b2de0..83af71409 100644 --- a/src/libs/vpatterndb/variables/vvariable.h +++ b/src/libs/vpatterndb/variables/vvariable.h @@ -52,11 +52,10 @@ public: VVariable &operator=(const VVariable &var); #ifdef Q_COMPILER_RVALUE_REFS + VVariable(const VVariable &&var) Q_DECL_NOTHROW; VVariable &operator=(VVariable &&var) Q_DECL_NOTHROW; #endif - void Swap(VVariable &var) Q_DECL_NOTHROW; - QString GetDescription() const; void SetDescription(const QString &desc); diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index 96b391b18..783bfa2ec 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -131,20 +131,19 @@ VContainer &VContainer::operator =(const VContainer &data) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VContainer::VContainer(const VContainer &&data) Q_DECL_NOTHROW + :d(data.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VContainer &VContainer::operator=(VContainer &&data) Q_DECL_NOTHROW { - Swap(data); + std::swap(d, data.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VContainer::Swap(VContainer &data) Q_DECL_NOTHROW -{ - std::swap(d, data.d); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief VContainer create container from another container diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h index e89c98240..24fa02160 100644 --- a/src/libs/vpatterndb/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -131,11 +131,10 @@ public: VContainer &operator=(const VContainer &data); #ifdef Q_COMPILER_RVALUE_REFS + VContainer(const VContainer &&data) Q_DECL_NOTHROW; VContainer &operator=(VContainer &&data) Q_DECL_NOTHROW; #endif - void Swap(VContainer &data) Q_DECL_NOTHROW; - static QString UniqueNamespace(); template diff --git a/src/libs/vpatterndb/vnodedetail.cpp b/src/libs/vpatterndb/vnodedetail.cpp index c2005d85c..3bb03b515 100644 --- a/src/libs/vpatterndb/vnodedetail.cpp +++ b/src/libs/vpatterndb/vnodedetail.cpp @@ -123,20 +123,19 @@ VNodeDetail &VNodeDetail::operator =(const VNodeDetail &node) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VNodeDetail::VNodeDetail(const VNodeDetail &&node) Q_DECL_NOTHROW + :d (node.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VNodeDetail &VNodeDetail::operator=(VNodeDetail &&node) Q_DECL_NOTHROW { - Swap(node); + std::swap(d, node.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VNodeDetail::Swap(VNodeDetail &node) Q_DECL_NOTHROW -{ - std::swap(d, node.d); -} - //--------------------------------------------------------------------------------------------------------------------- VNodeDetail::~VNodeDetail() {} diff --git a/src/libs/vpatterndb/vnodedetail.h b/src/libs/vpatterndb/vnodedetail.h index cbce44e75..8cc030e82 100644 --- a/src/libs/vpatterndb/vnodedetail.h +++ b/src/libs/vpatterndb/vnodedetail.h @@ -74,11 +74,10 @@ public: */ VNodeDetail &operator=(const VNodeDetail &node); #ifdef Q_COMPILER_RVALUE_REFS + VNodeDetail(const VNodeDetail &&node) Q_DECL_NOTHROW; VNodeDetail &operator=(VNodeDetail &&node) Q_DECL_NOTHROW; #endif - void Swap(VNodeDetail &node) Q_DECL_NOTHROW; - /** * @brief getId return object id. * @return id. diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index e593d8f43..9f2326e37 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -132,21 +132,20 @@ VPiece &VPiece::operator=(const VPiece &piece) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VPiece::VPiece(const VPiece &&piece) Q_DECL_NOTHROW + : VAbstractPiece(piece), d (piece.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VPiece &VPiece::operator=(VPiece &&piece) Q_DECL_NOTHROW { - Swap(piece); + VAbstractPiece::operator=(piece); + std::swap(d, piece.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VPiece::Swap(VPiece &piece) Q_DECL_NOTHROW -{ - VAbstractPiece::Swap(piece); - std::swap(d, piece.d); -} - //--------------------------------------------------------------------------------------------------------------------- VPiece::~VPiece() {} diff --git a/src/libs/vpatterndb/vpiece.h b/src/libs/vpatterndb/vpiece.h index 5fd24fc1e..1a9d96ba4 100644 --- a/src/libs/vpatterndb/vpiece.h +++ b/src/libs/vpatterndb/vpiece.h @@ -57,11 +57,10 @@ public: VPiece &operator=(const VPiece &piece); #ifdef Q_COMPILER_RVALUE_REFS + VPiece(const VPiece &&piece) Q_DECL_NOTHROW; VPiece &operator=(VPiece &&piece) Q_DECL_NOTHROW; #endif - void Swap(VPiece &piece) Q_DECL_NOTHROW; - VPiecePath GetPath() const; VPiecePath &GetPath(); void SetPath(const VPiecePath &path); diff --git a/src/libs/vpatterndb/vpiecenode.cpp b/src/libs/vpatterndb/vpiecenode.cpp index 35fc73bf4..7068c6264 100644 --- a/src/libs/vpatterndb/vpiecenode.cpp +++ b/src/libs/vpatterndb/vpiecenode.cpp @@ -66,20 +66,19 @@ VPieceNode &VPieceNode::operator=(const VPieceNode &node) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VPieceNode::VPieceNode(const VPieceNode &&node) Q_DECL_NOTHROW + : d (node.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VPieceNode &VPieceNode::operator=(VPieceNode &&node) Q_DECL_NOTHROW { - Swap(node); + std::swap(d, node.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VPieceNode::Swap(VPieceNode &node) Q_DECL_NOTHROW -{ - std::swap(d, node.d); -} - //--------------------------------------------------------------------------------------------------------------------- VPieceNode::~VPieceNode() {} diff --git a/src/libs/vpatterndb/vpiecenode.h b/src/libs/vpatterndb/vpiecenode.h index 7de127e4e..34c90b10c 100644 --- a/src/libs/vpatterndb/vpiecenode.h +++ b/src/libs/vpatterndb/vpiecenode.h @@ -49,11 +49,10 @@ public: VPieceNode &operator=(const VPieceNode &node); #ifdef Q_COMPILER_RVALUE_REFS + VPieceNode(const VPieceNode &&node) Q_DECL_NOTHROW; VPieceNode &operator=(VPieceNode &&node) Q_DECL_NOTHROW; #endif - void Swap(VPieceNode &node) Q_DECL_NOTHROW; - friend QDataStream& operator<<(QDataStream& out, const VPieceNode& p); friend QDataStream& operator>>(QDataStream& in, VPieceNode& p); diff --git a/src/libs/vpatterndb/vpiecepath.cpp b/src/libs/vpatterndb/vpiecepath.cpp index 49505190f..31bd3c4d9 100644 --- a/src/libs/vpatterndb/vpiecepath.cpp +++ b/src/libs/vpatterndb/vpiecepath.cpp @@ -219,20 +219,19 @@ VPiecePath &VPiecePath::operator=(const VPiecePath &path) } #ifdef Q_COMPILER_RVALUE_REFS +//--------------------------------------------------------------------------------------------------------------------- +VPiecePath::VPiecePath(const VPiecePath &&path) Q_DECL_NOTHROW + : d (path.d) +{} + //--------------------------------------------------------------------------------------------------------------------- VPiecePath &VPiecePath::operator=(VPiecePath &&path) Q_DECL_NOTHROW { - Swap(path); + std::swap(d, path.d); return *this; } #endif -//--------------------------------------------------------------------------------------------------------------------- -void VPiecePath::Swap(VPiecePath &path) Q_DECL_NOTHROW -{ - std::swap(d, path.d); -} - //--------------------------------------------------------------------------------------------------------------------- VPiecePath::~VPiecePath() {} diff --git a/src/libs/vpatterndb/vpiecepath.h b/src/libs/vpatterndb/vpiecepath.h index 6d1850050..c6d74dd32 100644 --- a/src/libs/vpatterndb/vpiecepath.h +++ b/src/libs/vpatterndb/vpiecepath.h @@ -54,11 +54,10 @@ public: VPiecePath &operator=(const VPiecePath &path); #ifdef Q_COMPILER_RVALUE_REFS + VPiecePath(const VPiecePath &&path) Q_DECL_NOTHROW; VPiecePath &operator=(VPiecePath &&path) Q_DECL_NOTHROW; #endif - void Swap(VPiecePath &path) Q_DECL_NOTHROW; - void Append(const VPieceNode &node); void Clear(); qint32 CountNodes() const;