diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-05 15:28:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-10 08:13:00 +0000 |
commit | cc589883a98e8d21c57480719c9d4380fc292a59 (patch) | |
tree | 92a568d93d335a4eba83eb9cc495d7ba4824e63d | |
parent | 842873d37c2716ced5674ebaadfb2fae9620632d (diff) |
rename SetResMgr to ClearResMgr
since that is it's only use.
Also clean up the comment block nearby.
Change-Id: Iff67aeec176963132bb8a1e64e0c81853f0912d7
Reviewed-on: https://gerrit.libreoffice.org/29654
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/tools/resid.hxx | 21 | ||||
-rw-r--r-- | tools/source/rc/resmgr.cxx | 6 |
2 files changed, 12 insertions, 15 deletions
diff --git a/include/tools/resid.hxx b/include/tools/resid.hxx index 29452c66fecd..0feec42f8f39 100644 --- a/include/tools/resid.hxx +++ b/include/tools/resid.hxx @@ -35,15 +35,16 @@ class ResMgr; class ResId { /* - consider two cases: either m_pResource is valid and points - two a resource data buffer; then m_nResId and m_pResMgr are - not used and may be 0 resp. NULL - or m_pResource is NULL, the m_nResId and m_pResMgr must be valid. - In this case the highest bit if set decides whether to - not to release the Resource context after loading this id + Consider two cases: + either + (a) m_pResource is valid and points to a resource data buffer; + then m_nResId and m_pResMgr are not used and may be 0 and nullptr respectively + or + (b) m_pResource is NULL, then m_nResId and m_pResMgr must be valid. + In this case the highest bit, if set, decides whether or not to + release the Resource context after loading this id. */ RSHEADER_TYPE* m_pResource; - mutable sal_uInt32 m_nResId; // Resource Identifier mutable RESOURCE_TYPE m_nRT; // type for loading (mutable to be set later) mutable ResMgr * m_pResMgr; // load from this ResMgr (mutable for setting on demand) @@ -85,11 +86,7 @@ public: } ResMgr * GetResMgr() const { return m_pResMgr; } - void SetResMgr( ResMgr * pMgr ) const - { - m_pResMgr = pMgr; - OSL_ENSURE( m_pResMgr != nullptr, "invalid ResMgr set on ResId" ); - } + void ClearResMgr() const { m_pResMgr = nullptr; } const ResId & SetAutoRelease(bool bRelease) const { diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index 473b900a6c5b..18d4a59515c4 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -923,7 +923,7 @@ bool ResMgr::IsAvailable( const ResId& rId, const Resource* pResObj ) const if( pMgr->pFallbackResMgr ) { ResId aId( rId ); - aId.SetResMgr( nullptr ); + aId.ClearResMgr(); return pMgr->pFallbackResMgr->IsAvailable( aId, pResObj ); } @@ -961,7 +961,7 @@ bool ResMgr::GetResource( const ResId& rId, const Resource* pResObj ) if( pFallbackResMgr ) { ResId aId( rId ); - aId.SetResMgr( nullptr ); + aId.ClearResMgr(); return pFallbackResMgr->GetResource( aId, pResObj ); } @@ -1094,7 +1094,7 @@ RSHEADER_TYPE* ResMgr::CreateBlock( const ResId& rId ) if( pFallbackResMgr ) { ResId aId( rId ); - aId.SetResMgr( nullptr ); + aId.ClearResMgr(); return pFallbackResMgr->CreateBlock( aId ); } |