From 8efb852024336b455a9d078c675645e01589afdc Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 27 Apr 2017 11:28:29 +0100 Subject: another name for a nonlocalized string is a string Change-Id: Ic4ff92720edd1c10dd6d5eff026e79cb02990005 --- comphelper/source/misc/logging.cxx | 66 -------------------------------------- 1 file changed, 66 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/misc/logging.cxx b/comphelper/source/misc/logging.cxx index ed6a79c0c5f6..4f88ce3d17ef 100644 --- a/comphelper/source/misc/logging.cxx +++ b/comphelper/source/misc/logging.cxx @@ -191,51 +191,6 @@ namespace comphelper } }; - - bool lcl_loadBundle_nothrow( Reference< XComponentContext > const & _rContext, ResourceBasedEventLogger_Data& _rLoggerData ) - { - if ( _rLoggerData.bBundleLoaded ) - return _rLoggerData.xBundle.is(); - - // no matter what happens below, don't attempt creation ever again - _rLoggerData.bBundleLoaded = true; - - try - { - Reference< XResourceBundleLoader > xLoader( - css::resource::OfficeResourceLoader::get( - _rContext ) ); - _rLoggerData.xBundle.set( xLoader->loadBundle_Default( _rLoggerData.sBundleBaseName ), UNO_QUERY_THROW ); - } - catch( const Exception& e ) - { - (void)e; - OSL_FAIL( "lcl_loadBundle_nothrow: caught an exception!" ); - } - - return _rLoggerData.xBundle.is(); - } - - - OUString lcl_loadString_nothrow( const Reference< XResourceBundle >& _rxBundle, const sal_Int32 _nMessageResID ) - { - OSL_PRECOND( _rxBundle.is(), "lcl_loadString_nothrow: this will crash!" ); - OUString sMessage; - try - { - OUStringBuffer aBuffer; - aBuffer.append( "string:" ); - aBuffer.append( _nMessageResID ); - OSL_VERIFY( _rxBundle->getDirectElement( aBuffer.makeStringAndClear() ) >>= sMessage ); - } - catch( const Exception& e ) - { - (void)e; - OSL_FAIL( "lcl_loadString_nothrow: caught an exception!" ); - } - return sMessage; - } - ResourceBasedEventLogger::ResourceBasedEventLogger( const Reference< XComponentContext >& _rxContext, const sal_Char* _pResourceBundleBaseName, const sal_Char* _pAsciiLoggerName ) :EventLogger( _rxContext, _pAsciiLoggerName ) @@ -243,27 +198,6 @@ namespace comphelper { m_pData->sBundleBaseName = OUString::createFromAscii( _pResourceBundleBaseName ); } - - - OUString ResourceBasedEventLogger::impl_loadStringMessage_nothrow( const sal_Int32 _nMessageResID ) const - { - OUString sMessage; - if ( lcl_loadBundle_nothrow( m_pImpl->getContext(), *m_pData ) ) - sMessage = lcl_loadString_nothrow( m_pData->xBundle, _nMessageResID ); - if ( sMessage.isEmpty() ) - { - OUStringBuffer aBuffer; - aBuffer.append( "sBundleBaseName ); - aBuffer.append( ":" ); - aBuffer.append( _nMessageResID ); - aBuffer.append( "'>" ); - sMessage = aBuffer.makeStringAndClear(); - } - return sMessage; - } - - } // namespace comphelper -- cgit