From 1c7fdf561bc924741a121439a6cb42f96f285b58 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 30 Aug 2019 09:09:08 +0200 Subject: 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 --- tools/source/generic/poly2.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tools') 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; } -- cgit v1.2.3