include/tools/poly.hxx | 3 ++- tools/source/generic/poly2.cxx | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-)
New commits: commit 1c7fdf561bc924741a121439a6cb42f96f285b58 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Aug 30 09:09:08 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Aug 30 11:13:09 2019 +0200 fix PolyPolygon move operator= and add move constructor, found by loplugin:noexceptmove Change-Id: I89507113b354c4ae080f7107c996b55ab1285738 Reviewed-on: https://gerrit.libreoffice.org/78285 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx index aed40ece0367..765865b5a228 100644 --- a/include/tools/poly.hxx +++ b/include/tools/poly.hxx @@ -197,6 +197,7 @@ public: PolyPolygon( sal_uInt16 nInitSize = 16 ); PolyPolygon( const tools::Polygon& rPoly ); PolyPolygon( const tools::PolyPolygon& rPolyPoly ); + PolyPolygon( tools::PolyPolygon&& rPolyPoly ) noexcept; ~PolyPolygon(); void Insert( const tools::Polygon& rPoly, sal_uInt16 nPos = POLYPOLY_APPEND ); @@ -242,7 +243,7 @@ public: tools::Polygon& operator[]( sal_uInt16 nPos ); tools::PolyPolygon& operator=( const tools::PolyPolygon& rPolyPoly ); - tools::PolyPolygon& operator=( tools::PolyPolygon&& rPolyPoly ); + tools::PolyPolygon& operator=( tools::PolyPolygon&& rPolyPoly ) noexcept; bool operator==( const tools::PolyPolygon& rPolyPoly ) const; bool operator!=( const tools::PolyPolygon& rPolyPoly ) const { return !(PolyPolygon::operator==( rPolyPoly )); } diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx index 0603a1dc8513..d37ba809f2fb 100644 --- a/tools/source/generic/poly2.cxx +++ b/tools/source/generic/poly2.cxx @@ -45,6 +45,11 @@ PolyPolygon::PolyPolygon( const tools::PolyPolygon& rPolyPoly ) { } +PolyPolygon::PolyPolygon( tools::PolyPolygon&& rPolyPoly ) noexcept + : mpImplPolyPolygon( std::move(rPolyPoly.mpImplPolyPolygon) ) +{ +} + PolyPolygon::~PolyPolygon() { } @@ -341,9 +346,9 @@ PolyPolygon& PolyPolygon::operator=( const tools::PolyPolygon& rPolyPoly ) return *this; } -PolyPolygon& PolyPolygon::operator=( tools::PolyPolygon&& rPolyPoly ) +PolyPolygon& PolyPolygon::operator=( tools::PolyPolygon&& rPolyPoly ) noexcept { - mpImplPolyPolygon = rPolyPoly.mpImplPolyPolygon; + mpImplPolyPolygon = std::move(rPolyPoly.mpImplPolyPolygon); return *this; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits