diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-09-23 11:44:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-09-23 16:14:41 +0000 |
commit | d17d7c63d2d15495f7faeead11672c1a9e798610 (patch) | |
tree | 9458fbd9f167a6ec21f8c7d7696fcf3634486bf7 | |
parent | c136c978751e6d3f86fd2ca6c3d468049c0d3f51 (diff) |
coverity#1371156 Missing move assignment operator
Change-Id: I187bc61678b5283843227612c243c5a09d0e7eb1
Reviewed-on: https://gerrit.libreoffice.org/29227
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/vcl/graph.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/graph.cxx | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index 66f07a476520..31df428baca9 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -116,6 +116,7 @@ public: public: Graphic(); Graphic( const Graphic& rGraphic ); + Graphic( Graphic&& rGraphic ); Graphic( const Bitmap& rBmp ); Graphic( const BitmapEx& rBmpEx ); Graphic( const SvgDataPtr& rSvgDataPtr ); @@ -125,6 +126,7 @@ public: virtual ~Graphic() override; Graphic& operator=( const Graphic& rGraphic ); + Graphic& operator=( Graphic&& rGraphic ); bool operator==( const Graphic& rGraphic ) const; bool operator!=( const Graphic& rGraphic ) const; bool operator!() const; diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 316b5ad65ae2..791a65971294 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -183,8 +183,7 @@ Graphic::Graphic() { } -Graphic::Graphic( const Graphic& rGraphic ) : -SvDataCopyStream() +Graphic::Graphic(const Graphic& rGraphic) { if( rGraphic.IsAnimated() ) mxImpGraphic.reset(new ImpGraphic(*rGraphic.mxImpGraphic)); @@ -192,6 +191,11 @@ SvDataCopyStream() mxImpGraphic = rGraphic.mxImpGraphic; } +Graphic::Graphic(Graphic&& rGraphic) + : mxImpGraphic(std::move(rGraphic.mxImpGraphic)) +{ +} + Graphic::Graphic(const Bitmap& rBmp) : mxImpGraphic(new ImpGraphic(rBmp)) { @@ -264,6 +268,12 @@ Graphic& Graphic::operator=( const Graphic& rGraphic ) return *this; } +Graphic& Graphic::operator=(Graphic&& rGraphic) +{ + mxImpGraphic = std::move(rGraphic.mxImpGraphic); + return *this; +} + bool Graphic::operator==( const Graphic& rGraphic ) const { return (*mxImpGraphic == *rGraphic.mxImpGraphic); |