diff options
-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; |