include/tools/resid.hxx    |   21 +++++++++------------
 tools/source/rc/resmgr.cxx |    6 +++---
 2 files changed, 12 insertions(+), 15 deletions(-)

New commits:
commit cc589883a98e8d21c57480719c9d4380fc292a59
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Oct 5 15:28:34 2016 +0200

    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 <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/tools/resid.hxx b/include/tools/resid.hxx
index 29452c6..0feec42 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 473b900..18d4a59 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 );
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to