Kaydet (Commit) 4c182392 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

cid#1371304: Add move semantics

Change-Id: I60051e720e816b1bd72193cbc028ce7264ba1e6a
üst 6b51e526
...@@ -58,6 +58,12 @@ public: ...@@ -58,6 +58,12 @@ public:
inline UnoInterfaceReference( uno_Interface * pUnoI ); inline UnoInterfaceReference( uno_Interface * pUnoI );
inline UnoInterfaceReference( UnoInterfaceReference const & ref ); inline UnoInterfaceReference( UnoInterfaceReference const & ref );
#if defined LIBO_INTERNAL_ONLY
UnoInterfaceReference(UnoInterfaceReference && other):
m_pUnoI(other.m_pUnoI)
{ other.m_pUnoI = nullptr; }
#endif
inline uno_Interface * get() const inline uno_Interface * get() const
{ return m_pUnoI; } { return m_pUnoI; }
...@@ -74,6 +80,17 @@ public: ...@@ -74,6 +80,17 @@ public:
uno_Interface * pUnoI ) uno_Interface * pUnoI )
{ return set( pUnoI ); } { return set( pUnoI ); }
#if defined LIBO_INTERNAL_ONLY
UnoInterfaceReference & operator =(UnoInterfaceReference && other) {
if (m_pUnoI != nullptr) {
(*m_pUnoI->release)(m_pUnoI);
}
m_pUnoI = other.m_pUnoI;
other.m_pUnoI = nullptr;
return *this;
}
#endif
inline void dispatch( inline void dispatch(
struct _typelib_TypeDescription const * pMemberType, struct _typelib_TypeDescription const * pMemberType,
void * pReturn, void * pArgs [], uno_Any ** ppException ) const; void * pReturn, void * pArgs [], uno_Any ** ppException ) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment