diff options
-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 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; |