diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-09-29 21:06:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-09-29 22:02:24 +0100 |
commit | ea2b56a72a6d7deb68793d7b8bcdb2fded1fbd68 (patch) | |
tree | 2c8e8d075825fcdb1569be58a3782efe1fc5ac41 | |
parent | 57d80be7fcd35625bd9e8007cb75088491ed5a1c (diff) |
coverity#1371164 Missing move assignment operator
Change-Id: I9817115f3bc0af542ed27605f8d0ca50107dd7d8
-rw-r--r-- | include/vcl/region.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/region.cxx | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/vcl/region.hxx b/include/vcl/region.hxx index 45d12a88ebf1..1235b3dddcec 100644 --- a/include/vcl/region.hxx +++ b/include/vcl/region.hxx @@ -73,6 +73,7 @@ public: explicit Region(const tools::PolyPolygon& rPolyPoly); explicit Region(const basegfx::B2DPolyPolygon&); Region(const vcl::Region& rRegion); + Region(vcl::Region&& rRegion); ~Region(); // direct access to contents @@ -114,6 +115,7 @@ public: bool IsOver( const Rectangle& rRect ) const; vcl::Region& operator=( const vcl::Region& rRegion ); + vcl::Region& operator=( vcl::Region&& rRegion ); vcl::Region& operator=( const Rectangle& rRect ); bool operator==( const vcl::Region& rRegion ) const; diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 0046743678a9..e9f5c424f643 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -372,6 +372,15 @@ Region::Region(const vcl::Region& rRegion) { } +Region::Region(vcl::Region&& rRegion) +: mpB2DPolyPolygon(std::move(rRegion.mpB2DPolyPolygon)), + mpPolyPolygon(std::move(rRegion.mpPolyPolygon)), + mpRegionBand(std::move(rRegion.mpRegionBand)), + mbIsNull(rRegion.mbIsNull) +{ + rRegion.mbIsNull = true; +} + Region::~Region() { } @@ -1454,6 +1463,17 @@ Region& vcl::Region::operator=( const vcl::Region& rRegion ) return *this; } +Region& vcl::Region::operator=( vcl::Region&& rRegion ) +{ + mpB2DPolyPolygon = std::move(rRegion.mpB2DPolyPolygon); + mpPolyPolygon = std::move(rRegion.mpPolyPolygon); + mpRegionBand = std::move(rRegion.mpRegionBand); + mbIsNull = rRegion.mbIsNull; + rRegion.mbIsNull = true; + + return *this; +} + Region& vcl::Region::operator=( const Rectangle& rRect ) { mpB2DPolyPolygon.reset(); |