summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/region.hxx2
-rw-r--r--vcl/source/gdi/region.cxx20
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();