summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-27 16:25:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-27 20:48:20 +0000
commitf40aba6bf6ebe6a2b0da7d5e2fe53e470fe9e0f2 (patch)
tree551f3ab6931e939aea37e571d3abbe60670d4d94
parent15a2a39ce621dc78449f28301beee895e67aa64f (diff)
coverity#1371303 Missing move assignment operator
Change-Id: I0dec3e192f3da895398a8b011c0e7275aab59d73
-rw-r--r--vcl/inc/impgraph.hxx2
-rw-r--r--vcl/source/gdi/impgraph.cxx41
2 files changed, 43 insertions, 0 deletions
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 041caf15f505..574a907346b5 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 0b03cee50785..51b58c60f1ac 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;