Kaydet (Commit) 5a3d129a authored tarafından Noel Grandin's avatar Noel Grandin

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
üst 3549bd49
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
{ {
SvBaseLink* p = *it; SvBaseLink* p = *it;
if( p ) if( p )
p->ReleaseReference(); p->ReleaseRef();
} }
} }
......
...@@ -37,13 +37,13 @@ public: ...@@ -37,13 +37,13 @@ public:
SvRef(T * pObjP): pObj(pObjP) { if (pObj != 0) pObj->AddRef(); } SvRef(T * pObjP): pObj(pObjP) { if (pObj != 0) pObj->AddRef(); }
~SvRef() { if (pObj != 0) pObj->ReleaseReference(); } ~SvRef() { if (pObj != 0) pObj->ReleaseRef(); }
void Clear() { void Clear() {
if (pObj != 0) { if (pObj != 0) {
T * pRefObj = pObj; T * pRefObj = pObj;
pObj = 0; pObj = 0;
pRefObj->ReleaseReference(); pRefObj->ReleaseRef();
} }
} }
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
T * pRefObj = pObj; T * pRefObj = pObj;
pObj = rObj.pObj; pObj = rObj.pObj;
if (pRefObj != 0) { if (pRefObj != 0) {
pRefObj->ReleaseReference(); pRefObj->ReleaseRef();
} }
return *this; return *this;
} }
...@@ -102,7 +102,7 @@ public: ...@@ -102,7 +102,7 @@ public:
{ {
T p = *it; T p = *it;
if( p ) if( p )
p->ReleaseReference(); p->ReleaseRef();
} }
base_t::clear(); base_t::clear();
} }
...@@ -126,7 +126,7 @@ public: ...@@ -126,7 +126,7 @@ public:
T p = base_t::back(); T p = base_t::back();
base_t::pop_back(); base_t::pop_back();
if( p ) if( p )
p->ReleaseReference(); p->ReleaseRef();
return p; return p;
} }
}; };
...@@ -159,18 +159,11 @@ public: ...@@ -159,18 +159,11 @@ public:
nRefCount -= SV_NO_DELETE_REFCOUNT; nRefCount -= SV_NO_DELETE_REFCOUNT;
return ++nRefCount; return ++nRefCount;
} }
void ReleaseReference() void ReleaseRef()
{ {
if( !--nRefCount ) if( !--nRefCount )
QueryDelete(); QueryDelete();
} }
sal_uIntPtr ReleaseRef()
{
sal_uIntPtr n = --nRefCount;
if( !n )
QueryDelete();
return n;
}
sal_uIntPtr GetRefCount() const { return nRefCount; } sal_uIntPtr GetRefCount() const { return nRefCount; }
}; };
...@@ -196,7 +189,7 @@ class SvCompatWeakBase ...@@ -196,7 +189,7 @@ class SvCompatWeakBase
public: public:
SvCompatWeakHdl* GetHdl() { return _xHdl; } 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( void* pObj ) { _xHdl = new SvCompatWeakHdl( pObj ); }
~SvCompatWeakBase() { _xHdl->ResetWeakBase(); } ~SvCompatWeakBase() { _xHdl->ResetWeakBase(); }
}; };
......
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