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.grandin@collabora.co.uk>
diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
index aed40ec..765865b 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 0603a1d..d37ba80 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;
}