diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-29 11:08:31 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-29 11:08:54 +0200 |
commit | 5586629f7519bc7e9d715f043327e9b87e54e597 (patch) | |
tree | 03025c3bf382a80fe5d39111e1812b784dabb699 | |
parent | 86c0ce4d4637142b939ebaeb79c6bd35e49c1082 (diff) |
cid#1371230 Missing move assignment operator
Change-Id: Ia58dda7eaadf6a91b7af67e011a6f44a4e7a3c0b
-rw-r--r-- | include/sfx2/objsh.hxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index e9697720b141..2cc4af3055bf 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -755,10 +755,12 @@ protected: public: inline SfxObjectShellLock() { pObj = nullptr; } inline SfxObjectShellLock( const SfxObjectShellLock & rObj ); + inline SfxObjectShellLock( SfxObjectShellLock && rObj ); inline SfxObjectShellLock( SfxObjectShell * pObjP ); inline void Clear(); inline ~SfxObjectShellLock(); inline SfxObjectShellLock & operator = ( const SfxObjectShellLock & rObj ); + inline SfxObjectShellLock & operator = ( SfxObjectShellLock && rObj ); inline SfxObjectShellLock & operator = ( SfxObjectShell * pObj ); inline bool Is() const { return pObj != nullptr; } inline SfxObjectShell * operator & () const { return pObj; } @@ -772,6 +774,11 @@ inline SfxObjectShellLock::SfxObjectShellLock( const SfxObjectShellLock & rObj ) if( pObj ) pObj->OwnerLock( true ); } +inline SfxObjectShellLock::SfxObjectShellLock( SfxObjectShellLock && rObj ) +{ + pObj = rObj.pObj; + rObj.pObj = nullptr; +} inline SfxObjectShellLock::SfxObjectShellLock( SfxObjectShell * pObjP ) { pObj = pObjP; @@ -802,6 +809,14 @@ inline SfxObjectShellLock & SfxObjectShellLock::operator=( const SfxObjectShellL pRefObj->OwnerLock( false ); return *this; } +inline SfxObjectShellLock & SfxObjectShellLock::operator=( SfxObjectShellLock && rObj ) +{ + if (pObj) + pObj->OwnerLock( false ); + pObj = rObj.pObj; + rObj.pObj = nullptr; + return *this; +} inline SfxObjectShellLock & SfxObjectShellLock::operator=( SfxObjectShell * pObjP ) { return *this = SfxObjectShellLock( pObjP ); |