include/svx/xpoly.hxx | 16 +++++----- svx/inc/xpolyimp.hxx | 4 -- svx/source/xoutdev/_xpoly.cxx | 67 ++++++------------------------------------ 3 files changed, 19 insertions(+), 68 deletions(-)
New commits: commit 84f7b97e4e5e7183fdd98dd2c618a2a25b1cdaed Author: Jochen Nitschke <j.nitschke+loger...@ok.de> Date: Sun Mar 25 15:18:58 2018 +0200 clang-tidy modernize-use-equals-default in XPolygon Change-Id: I82a4a56bf02c6ff2495bd7a6058640d77e8c0b73 Reviewed-on: https://gerrit.libreoffice.org/51832 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svx/xpoly.hxx b/include/svx/xpoly.hxx index 2c6f848d00be..08f7c866aa4d 100644 --- a/include/svx/xpoly.hxx +++ b/include/svx/xpoly.hxx @@ -54,8 +54,8 @@ class SVX_DLLPUBLIC XPolygon final public: XPolygon( sal_uInt16 nSize=16 ); - XPolygon( const XPolygon& rXPoly ); - XPolygon( XPolygon&& rXPoly ); + XPolygon( const XPolygon& ); + XPolygon( XPolygon&& ); XPolygon( const tools::Polygon& rPoly ); XPolygon( const tools::Rectangle& rRect, long nRx = 0, long nRy = 0 ); XPolygon( const Point& rCenter, long nRx, long nRy, @@ -77,8 +77,8 @@ public: const Point& operator[]( sal_uInt16 nPos ) const; Point& operator[]( sal_uInt16 nPos ); - XPolygon& operator=( const XPolygon& rXPoly ); - XPolygon& operator=( XPolygon&& rXPoly ); + XPolygon& operator=( const XPolygon& ); + XPolygon& operator=( XPolygon&& ); bool operator==( const XPolygon& rXPoly ) const; PolyFlags GetFlags( sal_uInt16 nPos ) const; @@ -116,8 +116,8 @@ class SVX_DLLPUBLIC XPolyPolygon final public: XPolyPolygon(); - XPolyPolygon( const XPolyPolygon& rXPolyPoly ); - XPolyPolygon( XPolyPolygon&& rXPolyPoly ); + XPolyPolygon( const XPolyPolygon& ); + XPolyPolygon( XPolyPolygon&& ); ~XPolyPolygon(); @@ -135,8 +135,8 @@ public: { return GetObject( nPos ); } XPolygon& operator[]( sal_uInt16 nPos ); - XPolyPolygon& operator=( const XPolyPolygon& rXPolyPoly ); - XPolyPolygon& operator=( XPolyPolygon&& rXPolyPoly ); + XPolyPolygon& operator=( const XPolyPolygon& ); + XPolyPolygon& operator=( XPolyPolygon&& ); // transformations void Distort(const tools::Rectangle& rRefRect, const XPolygon& rDistortedRect); diff --git a/svx/inc/xpolyimp.hxx b/svx/inc/xpolyimp.hxx index 4b73dd6fe556..425d2a551058 100644 --- a/svx/inc/xpolyimp.hxx +++ b/svx/inc/xpolyimp.hxx @@ -55,10 +55,6 @@ class ImpXPolyPolygon { public: ::std::vector< XPolygon > aXPolyList; - - ImpXPolyPolygon() {} - ImpXPolyPolygon( const ImpXPolyPolygon& rImpXPolyPoly ); - ~ImpXPolyPolygon(); }; diff --git a/svx/source/xoutdev/_xpoly.cxx b/svx/source/xoutdev/_xpoly.cxx index a4024a061954..63d53d8585b9 100644 --- a/svx/source/xoutdev/_xpoly.cxx +++ b/svx/source/xoutdev/_xpoly.cxx @@ -209,15 +209,9 @@ XPolygon::XPolygon( sal_uInt16 nSize ) { } -XPolygon::XPolygon( const XPolygon& rXPoly ) - : pImpXPolygon(rXPoly.pImpXPolygon) -{ -} +XPolygon::XPolygon( const XPolygon& ) = default; -XPolygon::XPolygon( XPolygon&& rXPoly ) - : pImpXPolygon(std::move(rXPoly.pImpXPolygon)) -{ -} +XPolygon::XPolygon( XPolygon&& ) = default; /// create a XPolygon out of a standard polygon XPolygon::XPolygon( const tools::Polygon& rPoly ) @@ -333,9 +327,7 @@ XPolygon::XPolygon(const Point& rCenter, long nRx, long nRy, pImpXPolygon->nPoints = nPos + 1; } -XPolygon::~XPolygon() -{ -} +XPolygon::~XPolygon() = default; void XPolygon::SetPointCount( sal_uInt16 nPoints ) { @@ -455,17 +447,9 @@ Point& XPolygon::operator[]( sal_uInt16 nPos ) return pImpXPolygon->pPointAry[nPos]; } -XPolygon& XPolygon::operator=( const XPolygon& rXPoly ) -{ - pImpXPolygon = rXPoly.pImpXPolygon; - return *this; -} +XPolygon& XPolygon::operator=( const XPolygon& ) = default; -XPolygon& XPolygon::operator=( XPolygon&& rXPoly ) -{ - pImpXPolygon = std::move(rXPoly.pImpXPolygon); - return *this; -} +XPolygon& XPolygon::operator=( XPolygon&& ) = default; bool XPolygon::operator==( const XPolygon& rXPoly ) const { @@ -866,30 +850,11 @@ XPolygon::XPolygon(const basegfx::B2DPolygon& rPolygon) } // XPolyPolygon +XPolyPolygon::XPolyPolygon() = default; -ImpXPolyPolygon::ImpXPolyPolygon( const ImpXPolyPolygon& rImpXPolyPoly ) - : aXPolyList( rImpXPolyPoly.aXPolyList ) -{ -} - -ImpXPolyPolygon::~ImpXPolyPolygon() -{ -} - -XPolyPolygon::XPolyPolygon() - : pImpXPolyPolygon() -{ -} +XPolyPolygon::XPolyPolygon( const XPolyPolygon& ) = default; -XPolyPolygon::XPolyPolygon( const XPolyPolygon& rXPolyPoly ) - : pImpXPolyPolygon( rXPolyPoly.pImpXPolyPolygon ) -{ -} - -XPolyPolygon::XPolyPolygon( XPolyPolygon&& rXPolyPoly ) - : pImpXPolyPolygon( std::move(rXPolyPoly.pImpXPolyPolygon) ) -{ -} +XPolyPolygon::XPolyPolygon( XPolyPolygon&& ) = default; XPolyPolygon::XPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon) : pImpXPolyPolygon() @@ -901,9 +866,7 @@ XPolyPolygon::XPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon) } } -XPolyPolygon::~XPolyPolygon() -{ -} +XPolyPolygon::~XPolyPolygon() = default; void XPolyPolygon::Insert( XPolygon&& rXPoly ) { @@ -958,17 +921,9 @@ XPolygon& XPolyPolygon::operator[]( sal_uInt16 nPos ) return pImpXPolyPolygon->aXPolyList[ nPos ]; } -XPolyPolygon& XPolyPolygon::operator=( const XPolyPolygon& rXPolyPoly ) -{ - pImpXPolyPolygon = rXPolyPoly.pImpXPolyPolygon; - return *this; -} +XPolyPolygon& XPolyPolygon::operator=( const XPolyPolygon& ) = default; -XPolyPolygon& XPolyPolygon::operator=( XPolyPolygon&& rXPolyPoly ) -{ - pImpXPolyPolygon = std::move(rXPolyPoly.pImpXPolyPolygon); - return *this; -} +XPolyPolygon& XPolyPolygon::operator=( XPolyPolygon&& ) = default; /** * Distort a polygon by scaling its coordinates relative to a reference _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits