diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-16 02:07:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-16 09:04:09 +0100 |
commit | f88247d9c5fe484b799600e24a96abbdd34cfe2f (patch) | |
tree | 8b6815eded898aebcbd2ccac5250e7a2c2ad1d17 /tools | |
parent | ac96fbd737d01c074232ce74ba5279550ee8ce5d (diff) |
callcatcher: unused code
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/simplerm.hxx | 10 | ||||
-rw-r--r-- | tools/source/rc/resmgr.cxx | 83 |
2 files changed, 0 insertions, 93 deletions
diff --git a/tools/inc/tools/simplerm.hxx b/tools/inc/tools/simplerm.hxx index 00767880c915..0794ed102519 100644 --- a/tools/inc/tools/simplerm.hxx +++ b/tools/inc/tools/simplerm.hxx @@ -83,13 +83,6 @@ public: bool IsValid() const { return m_pResImpl != NULL; } - /** retrieves the locale of the resource file represented by this instance - @precond - IsValid returns <TRUE/> - */ - const ::com::sun::star::lang::Locale& - GetLocale() const; - /** reads the string with the given resource id @param nId the resource id of the string to read @@ -110,9 +103,6 @@ public: <TRUE/> if and only if a resource of the given type, with the given id, is available. */ bool IsAvailable( RESOURCE_TYPE _resourceType, sal_uInt32 _resourceId ); - - sal_uInt32 ReadBlob( sal_uInt32 nId, void** pBuffer ); - void FreeBlob( void* pBuffer ); }; #endif // _TOOLS_SIMPLERESMGR_HXX_ diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index 5a44dfa24c95..c5ff7445b036 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -2035,87 +2035,4 @@ UniString SimpleResMgr::ReadString( sal_uInt32 nId ) return sReturn; } -// ----------------------------------------------------------------------- - -const ::com::sun::star::lang::Locale& SimpleResMgr::GetLocale() const -{ - DBG_ASSERT( IsValid(), "SimpleResMgr::ReadBlob: invalid, this will crash!" ); - return m_pResImpl->aLocale; -} - -// ----------------------------------------------------------------------- - -sal_uInt32 SimpleResMgr::ReadBlob( sal_uInt32 nId, void** pBuffer ) -{ - osl::MutexGuard aGuard(m_aAccessSafety); - - DBG_ASSERT( m_pResImpl, "SimpleResMgr::ReadBlob : have no impl class !" ); - - // perhaps constructed with an invalid filename ? - DBG_ASSERT( pBuffer, "SimpleResMgr::ReadBlob : invalid argument !" ); - *pBuffer = NULL; - - void* pResHandle = NULL; - InternalResMgr* pFallback = m_pResImpl; - RSHEADER_TYPE* pResHeader = (RSHEADER_TYPE*)m_pResImpl->LoadGlobalRes( RSC_RESOURCE, nId, &pResHandle ); - DBG_ASSERT( pResHeader, "SimpleResMgr::ReadBlob : couldn't find the resource with the given id !" ); - - if ( !pResHeader ) - { - osl::Guard<osl::Mutex> aGuard2( getResMgrMutex() ); - - // try fallback - while( ! pResHandle && pFallback ) - { - InternalResMgr* pOldFallback = pFallback; - pFallback = ResMgrContainer::get().getNextFallback( pFallback ); - if( pOldFallback != m_pResImpl ) - ResMgrContainer::get().freeResMgr( pOldFallback ); - if( pFallback ) - { - // handle possible recursion - if( pFallback->aLocale.Language != m_pResImpl->aLocale.Language || - pFallback->aLocale.Country != m_pResImpl->aLocale.Country || - pFallback->aLocale.Variant != m_pResImpl->aLocale.Variant ) - { - pResHeader = (RSHEADER_TYPE*)pFallback->LoadGlobalRes( RSC_RESOURCE, nId, &pResHandle ); - } - else - { - ResMgrContainer::get().freeResMgr( pFallback ); - pFallback = NULL; - } - } - } - if( ! pResHandle ) - // no exception handling, this would require the locking of the solar mutex which isn't allowed within this class - return 0; - } - - DBG_ASSERT( pResHandle == NULL, "SimpleResMgr::ReadBlob : behaviour of LoadGlobalRes changed !" ); - // if pResHandle is not NULL the FreeBlob wouldn't have to delete the pointer given as pBuffer, but - // FreeBlob doesn't know that so it would probably crash .... - - sal_uInt32 nRemaining = pResHeader->GetLocalOff() - sizeof(RSHEADER_TYPE); - *pBuffer = (void*)(((sal_uInt8*)pResHeader) + sizeof(RSHEADER_TYPE)); - - // free an eventual fallback InternalResMgr - if( m_pResImpl != pFallback ) - { - osl::Guard<osl::Mutex> aGuard2( getResMgrMutex() ); - - ResMgrContainer::get().freeResMgr( pFallback ); - } - - return nRemaining; -} - -// ----------------------------------------------------------------------- - -void SimpleResMgr::FreeBlob( void* pBuffer ) -{ - void* pCompleteBuffer = (void*)(((sal_uInt8*)pBuffer) - sizeof(RSHEADER_TYPE)); - rtl_freeMemory(pCompleteBuffer); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |