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

Thomas Arnhold thomas at arnhold.org
Sun Jun 30 11:49:13 PDT 2013


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

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

    Revert "resmgr: bInUse is useless"
    
    This was pretty lame. It's static. To be sure revert it.
    
    This reverts commit 504499ad9f17be5350b878fa99e814612eaffb5f.

diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index e0c9f72..d734242 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -623,20 +623,28 @@ 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()));
 
-    ResId aResId( sal_uInt32(RSCVERSION_ID), *rTypeId.GetResMgr() );
-    aResId.SetRT( RSC_VERSIONCONTROL );
-
-    if ( rTypeId.GetResMgr()->GetResource( aResId ) )
+    if ( !bInUse )
     {
-        rTypeId.SetRT( RSC_STRING );
-        if ( rTypeId.GetResMgr()->IsAvailable( rTypeId ) )
+        bInUse = true;
+
+        ResId aResId( sal_uInt32(RSCVERSION_ID), *rTypeId.GetResMgr() );
+        aResId.SetRT( RSC_VERSIONCONTROL );
+
+        if ( rTypeId.GetResMgr()->GetResource( aResId ) )
         {
-            aTypStr = rTypeId.toString();
-            // Set class pointer to the end
-            rTypeId.GetResMgr()->Increment( sizeof( RSHEADER_TYPE ) );
+            rTypeId.SetRT( RSC_STRING );
+            if ( rTypeId.GetResMgr()->IsAvailable( rTypeId ) )
+            {
+                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