Kaydet (Commit) 0e39fd1d authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS scriptingf2 (1.3.2); FILE MERGED

2003/12/09 19:03:59 npower 1.3.2.1: i22342
Make getAllProviders() method more forgiving, if it fails to create a provider it should continue to try and create any others it knows about. This resulted in failure to obtain any providers when java was turned off ( due to fact that failed to create first java provider )
üst 6e6fb5ac
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: ProviderCache.cxx,v $ * $RCSfile: ProviderCache.cxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: toconnor $ $Date: 2003-10-29 15:00:53 $ * last change: $Author: rt $ $Date: 2004-01-05 14:17:54 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -137,6 +137,7 @@ ProviderCache::getAllProviders() throw ( RuntimeException ) ...@@ -137,6 +137,7 @@ ProviderCache::getAllProviders() throw ( RuntimeException )
// should assert if size !> 0 // should assert if size !> 0
if ( m_hProviderDetailsCache.size() ) if ( m_hProviderDetailsCache.size() )
{ {
sal_Int32 providerIndex = 0;
for ( sal_Int32 index = 0; h_it != h_itEnd; ++h_it, index++ ) for ( sal_Int32 index = 0; h_it != h_itEnd; ++h_it, index++ )
{ {
Reference< provider::XScriptProvider > xScriptProvider = h_it->second.provider; Reference< provider::XScriptProvider > xScriptProvider = h_it->second.provider;
...@@ -145,7 +146,7 @@ ProviderCache::getAllProviders() throw ( RuntimeException ) ...@@ -145,7 +146,7 @@ ProviderCache::getAllProviders() throw ( RuntimeException )
OSL_TRACE("ProviderCache::getAllProviders(), service for %s already in cache", OSL_TRACE("ProviderCache::getAllProviders(), service for %s already in cache",
::rtl::OUStringToOString( h_it->first, ::rtl::OUStringToOString( h_it->first,
RTL_TEXTENCODING_ASCII_US ).pData->buffer ); RTL_TEXTENCODING_ASCII_US ).pData->buffer );
providers[ index ] = xScriptProvider; providers[ providerIndex++ ] = xScriptProvider;
} }
else else
{ {
...@@ -155,19 +156,30 @@ ProviderCache::getAllProviders() throw ( RuntimeException ) ...@@ -155,19 +156,30 @@ ProviderCache::getAllProviders() throw ( RuntimeException )
// create provider // create provider
try try
{ {
OSL_TRACE("Trying to create provider %d ", index );
xScriptProvider = createProvider( h_it->second ); xScriptProvider = createProvider( h_it->second );
providers[ index ] = xScriptProvider; providers[ providerIndex++ ] = xScriptProvider;
} }
catch ( RuntimeException& e ) catch ( RuntimeException& e )
{ {
OSL_TRACE("failed to create provider ****");
::rtl::OUString temp = OUSTR( "ProviderCache::getAllProviders: failed to create provider, " ); ::rtl::OUString temp = OUSTR( "ProviderCache::getAllProviders: failed to create provider, " );
temp.concat( e.Message ); temp.concat( e.Message );
throw RuntimeException( temp.concat( e.Message ), //throw RuntimeException( temp.concat( e.Message ),
Reference< XInterface >() ); // Reference< XInterface >() );
OSL_TRACE("ProviderCache::getAllProviders(), failed to create provider message is %s",
::rtl::OUStringToOString( temp,
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
} }
} }
} }
if ( providerIndex < index )
{
OSL_TRACE("ProviderCache::getAllProviders(), reducing providers to return to %d index is %d", providerIndex, index );
providers.realloc( providerIndex );
}
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment