diff options
author | Noel Grandin <noel@peralex.com> | 2014-07-10 11:03:27 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-07-10 12:03:16 +0200 |
commit | 5a3d129a46a9f749439eeaff473ffb848a9650cf (patch) | |
tree | a81d5288d9dfa1c66a6682c906da4037dda852c4 | |
parent | 3549bd49561ddfdd8b4891d4c8874f7e7772f2c2 (diff) |
remove SvRefBase::ReleaseReference
because no-one is using the return value of ReleaseRef, but everyone is
calling ReleaseRef, so make ReleaseRef void-returning and remove
ReleaseReference
Change-Id: I0bedcb65a887ba7a4953132b4c1ccefbdd554a43
-rw-r--r-- | cui/source/dialogs/linkdlg.cxx | 2 | ||||
-rw-r--r-- | include/tools/ref.hxx | 21 |
2 files changed, 8 insertions, 15 deletions
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index 91553257015a..27abd8541cf3 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -60,7 +60,7 @@ public: { SvBaseLink* p = *it; if( p ) - p->ReleaseReference(); + p->ReleaseRef(); } } diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx index 87aed32048f2..a87d0999ac15 100644 --- a/include/tools/ref.hxx +++ b/include/tools/ref.hxx @@ -37,13 +37,13 @@ public: SvRef(T * pObjP): pObj(pObjP) { if (pObj != 0) pObj->AddRef(); } - ~SvRef() { if (pObj != 0) pObj->ReleaseReference(); } + ~SvRef() { if (pObj != 0) pObj->ReleaseRef(); } void Clear() { if (pObj != 0) { T * pRefObj = pObj; pObj = 0; - pRefObj->ReleaseReference(); + pRefObj->ReleaseRef(); } } @@ -54,7 +54,7 @@ public: T * pRefObj = pObj; pObj = rObj.pObj; if (pRefObj != 0) { - pRefObj->ReleaseReference(); + pRefObj->ReleaseRef(); } return *this; } @@ -102,7 +102,7 @@ public: { T p = *it; if( p ) - p->ReleaseReference(); + p->ReleaseRef(); } base_t::clear(); } @@ -126,7 +126,7 @@ public: T p = base_t::back(); base_t::pop_back(); if( p ) - p->ReleaseReference(); + p->ReleaseRef(); return p; } }; @@ -159,18 +159,11 @@ public: nRefCount -= SV_NO_DELETE_REFCOUNT; return ++nRefCount; } - void ReleaseReference() + void ReleaseRef() { if( !--nRefCount ) QueryDelete(); } - sal_uIntPtr ReleaseRef() - { - sal_uIntPtr n = --nRefCount; - if( !n ) - QueryDelete(); - return n; - } sal_uIntPtr GetRefCount() const { return nRefCount; } }; @@ -196,7 +189,7 @@ class SvCompatWeakBase public: SvCompatWeakHdl* GetHdl() { return _xHdl; } - // does not use Initalizer due to compiler warnings + // does not use initalizer due to compiler warnings SvCompatWeakBase( void* pObj ) { _xHdl = new SvCompatWeakHdl( pObj ); } ~SvCompatWeakBase() { _xHdl->ResetWeakBase(); } }; |