[Libreoffice-commits] core.git: tools/source

Thomas Arnhold thomas at arnhold.org
Sun Jun 30 11:33:06 PDT 2013


 tools/source/rc/resmgr.cxx |   26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

New commits:
commit 504499ad9f17be5350b878fa99e814612eaffb5f
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sun Jun 30 20:28:58 2013 +0200

    resmgr: bInUse is useless
    
    Change-Id: I619d5d1ff9f6242be652674e4df54ad5c5ddc017

diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index d734242..e0c9f72 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -623,28 +623,20 @@ void InternalResMgr::FreeGlobalRes( void * pResHandle, void * pResource )
 
 OUString GetTypeRes_Impl( const ResId& rTypeId )
 {
-    // Return on resource errors
-    static int bInUse = false;
     OUString aTypStr(OUString::number(rTypeId.GetId()));
 
-    if ( !bInUse )
-    {
-        bInUse = true;
-
-        ResId aResId( sal_uInt32(RSCVERSION_ID), *rTypeId.GetResMgr() );
-        aResId.SetRT( RSC_VERSIONCONTROL );
+    ResId aResId( sal_uInt32(RSCVERSION_ID), *rTypeId.GetResMgr() );
+    aResId.SetRT( RSC_VERSIONCONTROL );
 
-        if ( rTypeId.GetResMgr()->GetResource( aResId ) )
+    if ( rTypeId.GetResMgr()->GetResource( aResId ) )
+    {
+        rTypeId.SetRT( RSC_STRING );
+        if ( rTypeId.GetResMgr()->IsAvailable( rTypeId ) )
         {
-            rTypeId.SetRT( RSC_STRING );
-            if ( rTypeId.GetResMgr()->IsAvailable( rTypeId ) )
-            {
-                aTypStr = rTypeId.toString();
-                // Set class pointer to the end
-                rTypeId.GetResMgr()->Increment( sizeof( RSHEADER_TYPE ) );
-            }
+            aTypStr = rTypeId.toString();
+            // Set class pointer to the end
+            rTypeId.GetResMgr()->Increment( sizeof( RSHEADER_TYPE ) );
         }
-        bInUse = false;
     }
 
     return aTypStr;


More information about the Libreoffice-commits mailing list