diff options
Diffstat (limited to 'sal/inc/rtl/ref.hxx')
-rw-r--r-- | sal/inc/rtl/ref.hxx | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/sal/inc/rtl/ref.hxx b/sal/inc/rtl/ref.hxx index 6e0592c21..7e932d3a1 100644 --- a/sal/inc/rtl/ref.hxx +++ b/sal/inc/rtl/ref.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ref.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jsc $ $Date: 2001-04-26 13:34:01 $ + * last change: $Author: obo $ $Date: 2003-09-04 10:56:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -137,49 +137,36 @@ public: m_pBody->release(); } - - /** Assignment. - Unbinds this instance from its body (if bound) and - bind it to the body represented by the handle. + /** Set... + Similar to assignment. */ inline Reference<reference_type> & - SAL_CALL operator= (const Reference<reference_type> & handle) + SAL_CALL set (reference_type * pBody) { + if (pBody) + pBody->acquire(); if (m_pBody) m_pBody->release(); - m_pBody = handle.m_pBody; - if (m_pBody) - m_pBody->acquire(); + m_pBody = pBody; return *this; } - - /** Assignment... + /** Assignment. + Unbinds this instance from its body (if bound) and + bind it to the body represented by the handle. */ inline Reference<reference_type> & - SAL_CALL operator= (reference_type * pBody) + SAL_CALL operator= (const Reference<reference_type> & handle) { - if (m_pBody) - m_pBody->release(); - m_pBody = pBody; - if (m_pBody) - m_pBody->acquire(); - return *this; + return set( handle.m_pBody ); } - - /** Set... - Similar to assignment. + /** Assignment... */ inline Reference<reference_type> & - SAL_CALL set (reference_type * pBody) + SAL_CALL operator= (reference_type * pBody) { - if (m_pBody) - m_pBody->release(); - m_pBody = pBody; - if (m_pBody) - m_pBody->acquire(); - return *this; + return set( pBody ); } /** Unbind the body from this handle. |