diff options
author | Oliver Bolte <obo@openoffice.org> | 2003-09-04 09:56:04 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2003-09-04 09:56:04 +0000 |
commit | 7f5925f25c6373d0e13ab9e7cf8cfdc9a469e49c (patch) | |
tree | f9fdd288e4bf1ffa80b87386b58d11b72c46a375 /sal/inc/rtl/ref.hxx | |
parent | 3741d81dc405e24afdc8a1e574c5939fdd561943 (diff) |
INTEGRATION: CWS cliuno01 (1.3.134); FILE MERGED
2003/07/29 13:43:34 dbo 1.3.134.1: fixing self assignment
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. |