summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-09-02 09:38:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-09-02 15:24:51 +0100
commit85cf08c19f3ba3ca9dc7b5320c0bdab90242b94a (patch)
treed58867819c2365dcf7773ae9019e81f3b9a25462
parent590fc29a66bc3301023f28a7d4c33ac0b0f5eba6 (diff)
coverity#1371213 Missing move assignment operator
Change-Id: I2454a230cd9a524086beba1a2ca32ea0b70bf17e
-rw-r--r--include/tools/poly.hxx2
-rw-r--r--tools/source/generic/poly.cxx6
-rw-r--r--tools/source/generic/poly2.cxx6
3 files changed, 14 insertions, 0 deletions
diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
index 79da3e8c7d18..3258a841d83a 100644
--- a/include/tools/poly.hxx
+++ b/include/tools/poly.hxx
@@ -159,6 +159,7 @@ public:
Point& operator[]( sal_uInt16 nPos );
tools::Polygon& operator=( const tools::Polygon& rPoly );
+ tools::Polygon& operator=( tools::Polygon&& rPoly );
bool operator==( const tools::Polygon& rPoly ) const;
bool operator!=( const tools::Polygon& rPoly ) const
{ return !(Polygon::operator==( rPoly )); }
@@ -246,6 +247,7 @@ public:
tools::Polygon& operator[]( sal_uInt16 nPos );
tools::PolyPolygon& operator=( const tools::PolyPolygon& rPolyPoly );
+ tools::PolyPolygon& operator=( tools::PolyPolygon&& rPolyPoly );
bool operator==( const tools::PolyPolygon& rPolyPoly ) const;
bool operator!=( const tools::PolyPolygon& rPolyPoly ) const
{ return !(PolyPolygon::operator==( rPolyPoly )); }
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 25baea04fb9f..a49d998b1354 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1525,6 +1525,12 @@ tools::Polygon& Polygon::operator=( const tools::Polygon& rPoly )
return *this;
}
+tools::Polygon& Polygon::operator=( tools::Polygon&& rPoly )
+{
+ std::swap(mpImplPolygon, rPoly.mpImplPolygon);
+ return *this;
+}
+
bool Polygon::operator==( const tools::Polygon& rPoly ) const
{
diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx
index 08f1bb877f2d..df7c51545d92 100644
--- a/tools/source/generic/poly2.cxx
+++ b/tools/source/generic/poly2.cxx
@@ -536,6 +536,12 @@ PolyPolygon& PolyPolygon::operator=( const tools::PolyPolygon& rPolyPoly )
return *this;
}
+PolyPolygon& PolyPolygon::operator=( tools::PolyPolygon&& rPolyPoly )
+{
+ std::swap(mpImplPolyPolygon, rPolyPoly.mpImplPolyPolygon);
+ return *this;
+}
+
bool PolyPolygon::operator==( const tools::PolyPolygon& rPolyPoly ) const
{
if ( rPolyPoly.mpImplPolyPolygon == mpImplPolyPolygon )