diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-06-30 20:46:58 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-06-30 20:46:58 +0200 |
commit | d70786a761025e7689a39d4026c8965d74962d4d (patch) | |
tree | eebc8acede732d78305d6078b395adcd6c27225a /tools/source | |
parent | resmgr: bInUse is useless (diff) | |
download | core-d70786a761025e7689a39d4026c8965d74962d4d.tar.gz core-d70786a761025e7689a39d4026c8965d74962d4d.zip |
Revert "resmgr: bInUse is useless"
This was pretty lame. It's static. To be sure revert it.
This reverts commit 504499ad9f17be5350b878fa99e814612eaffb5f.
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/rc/resmgr.cxx | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index e0c9f7271c7b..d734242ed5ec 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; |