diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-27 16:25:09 +0000 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-05-22 12:16:58 +0200 |
commit | c918223fdeadd2008950c463ddb751fcf5ad9bbd (patch) | |
tree | 7c0108b155d8a0c1aea6d2dbea247f36c27bf57c /vcl | |
parent | d621e4e4991521bda416451611167214c3645747 (diff) |
coverity#1371303 Missing move assignment operator
Change-Id: I0dec3e192f3da895398a8b011c0e7275aab59d73
(cherry picked from commit f40aba6bf6ebe6a2b0da7d5e2fe53e470fe9e0f2)
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/impgraph.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 41 |
2 files changed, 43 insertions, 0 deletions
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 3f7b63ebca24..fb1a9c16d657 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -55,6 +55,7 @@ private: ImpGraphic(); ImpGraphic( const ImpGraphic& rImpGraphic ); + ImpGraphic( ImpGraphic&& rImpGraphic ); ImpGraphic( const Bitmap& rBmp ); ImpGraphic( const BitmapEx& rBmpEx ); ImpGraphic(const SvgDataPtr& rSvgDataPtr); @@ -65,6 +66,7 @@ public: private: ImpGraphic& operator=( const ImpGraphic& rImpGraphic ); + ImpGraphic& operator=( ImpGraphic&& rImpGraphic ); bool operator==( const ImpGraphic& rImpGraphic ) const; bool operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); } diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 1099f90dbb29..884305fa952a 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -128,6 +128,25 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic) } } +ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic) + : maMetaFile(std::move(rImpGraphic.maMetaFile)) + , maEx(std::move(rImpGraphic.maEx)) + , maSwapInfo(std::move(rImpGraphic.maSwapInfo)) + , mpAnimation(std::move(rImpGraphic.mpAnimation)) + , mpContext(std::move(rImpGraphic.mpContext)) + , mpSwapFile(std::move(rImpGraphic.mpSwapFile)) + , mpGfxLink(std::move(rImpGraphic.mpGfxLink)) + , meType(rImpGraphic.meType) + , mnSizeBytes(rImpGraphic.mnSizeBytes) + , mbSwapOut(rImpGraphic.mbSwapOut) + , mbDummyContext(rImpGraphic.mbDummyContext) + , maSvgData(std::move(rImpGraphic.maSvgData)) + , maPdfData(std::move(rImpGraphic.maPdfData)) +{ + rImpGraphic.ImplClear(); + rImpGraphic.mbDummyContext = false; +} + ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) : maEx ( rBitmap ), meType ( !rBitmap.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ), @@ -217,6 +236,28 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic ) return *this; } +ImpGraphic& ImpGraphic::operator=(ImpGraphic&& rImpGraphic) +{ + maMetaFile = std::move(rImpGraphic.maMetaFile); + meType = rImpGraphic.meType; + mnSizeBytes = rImpGraphic.mnSizeBytes; + maSwapInfo = std::move(rImpGraphic.maSwapInfo); + mpContext = std::move(rImpGraphic.mpContext); + mbDummyContext = rImpGraphic.mbDummyContext; + mpAnimation = std::move(rImpGraphic.mpAnimation); + maEx = std::move(rImpGraphic.maEx); + mbSwapOut = rImpGraphic.mbSwapOut; + mpSwapFile = std::move(rImpGraphic.mpSwapFile); + mpGfxLink = std::move(rImpGraphic.mpGfxLink); + maSvgData = std::move(rImpGraphic.maSvgData); + maPdfData = std::move(rImpGraphic.maPdfData); + + rImpGraphic.ImplClear(); + rImpGraphic.mbDummyContext = false; + + return *this; +} + bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const { bool bRet = false; |