Kaydet (Commit) 2fdacd01 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Move function to the file where it is used

üst 5207c9fd
......@@ -119,66 +119,6 @@ Bootstrap const & get_unorc() SAL_THROW( () )
return *(Bootstrap const *)&s_bstrap;
}
void addFactories(
char const * const * ppNames /* lib, implname, ..., 0 */,
OUString const & bootstrapPath,
Reference< lang::XMultiComponentFactory > const & xMgr,
Reference< registry::XRegistryKey > const & xKey )
SAL_THROW( (Exception) )
{
Reference< container::XSet > xSet( xMgr, UNO_QUERY );
OSL_ASSERT( xSet.is() );
Reference< lang::XMultiServiceFactory > xSF( xMgr, UNO_QUERY );
while (*ppNames)
{
OUString lib( OUString::createFromAscii( *ppNames++ ) );
OUString implName( OUString::createFromAscii( *ppNames++ ) );
Any aFac( makeAny( loadSharedLibComponentFactory(
lib, bootstrapPath, implName, xSF, xKey ) ) );
xSet->insert( aFac );
#if OSL_DEBUG_LEVEL > 1
if (xSet->has( aFac ))
{
Reference< lang::XServiceInfo > xInfo;
if (aFac >>= xInfo)
{
::fprintf(
stderr, "> implementation %s supports: ", ppNames[ -1 ] );
Sequence< OUString > supported(
xInfo->getSupportedServiceNames() );
for ( sal_Int32 nPos = supported.getLength(); nPos--; )
{
OString str( OUStringToOString(
supported[ nPos ], RTL_TEXTENCODING_ASCII_US ) );
::fprintf( stderr, nPos ? "%s, " : "%s\n", str.getStr() );
}
}
else
{
::fprintf(
stderr,
"> implementation %s provides NO lang::XServiceInfo!!!\n",
ppNames[ -1 ] );
}
}
#endif
#if OSL_DEBUG_LEVEL > 0
if (! xSet->has( aFac ))
{
OStringBuffer buf( 64 );
buf.append( "### failed inserting shared lib \"" );
buf.append( ppNames[ -2 ] );
buf.append( "\"!!!" );
OString str( buf.makeStringAndClear() );
OSL_FAIL( str.getStr() );
}
#endif
}
}
// private forward decl
Reference< lang::XMultiComponentFactory > bootstrapInitialSF(
OUString const & rBootstrapPath )
......
......@@ -33,6 +33,7 @@
#include "rtl/string.hxx"
#include "rtl/bootstrap.hxx"
#include "rtl/strbuf.hxx"
#include "osl/diagnose.h"
#include "osl/file.h"
#include "osl/module.h"
......@@ -67,14 +68,6 @@ namespace css = com::sun::star;
namespace cppu
{
// private forward decl
void addFactories(
char const * const * ppNames /* lib, implname, ..., 0 */,
OUString const & bootstrapPath,
Reference< lang::XMultiComponentFactory > const & xMgr,
Reference< registry::XRegistryKey > const & xKey )
SAL_THROW( (Exception) );
Reference< security::XAccessController >
createDefaultAccessController() SAL_THROW( () );
......@@ -321,6 +314,68 @@ static void add_access_control_entries(
context_values.push_back( entry );
}
namespace {
void addFactories(
char const * const * ppNames /* lib, implname, ..., 0 */,
OUString const & bootstrapPath,
Reference< lang::XMultiComponentFactory > const & xMgr,
Reference< registry::XRegistryKey > const & xKey )
SAL_THROW( (Exception) )
{
Reference< container::XSet > xSet( xMgr, UNO_QUERY );
OSL_ASSERT( xSet.is() );
Reference< lang::XMultiServiceFactory > xSF( xMgr, UNO_QUERY );
while (*ppNames)
{
OUString lib( OUString::createFromAscii( *ppNames++ ) );
OUString implName( OUString::createFromAscii( *ppNames++ ) );
Any aFac( makeAny( loadSharedLibComponentFactory(
lib, bootstrapPath, implName, xSF, xKey ) ) );
xSet->insert( aFac );
#if OSL_DEBUG_LEVEL > 1
if (xSet->has( aFac ))
{
Reference< lang::XServiceInfo > xInfo;
if (aFac >>= xInfo)
{
::fprintf(
stderr, "> implementation %s supports: ", ppNames[ -1 ] );
Sequence< OUString > supported(
xInfo->getSupportedServiceNames() );
for ( sal_Int32 nPos = supported.getLength(); nPos--; )
{
OString str( OUStringToOString(
supported[ nPos ], RTL_TEXTENCODING_ASCII_US ) );
::fprintf( stderr, nPos ? "%s, " : "%s\n", str.getStr() );
}
}
else
{
::fprintf(
stderr,
"> implementation %s provides NO lang::XServiceInfo!!!\n",
ppNames[ -1 ] );
}
}
#endif
#if OSL_DEBUG_LEVEL > 0
if (! xSet->has( aFac ))
{
OStringBuffer buf( 64 );
buf.append( "### failed inserting shared lib \"" );
buf.append( ppNames[ -2 ] );
buf.append( "\"!!!" );
OString str( buf.makeStringAndClear() );
OSL_FAIL( str.getStr() );
}
#endif
}
}
} // namespace
Reference< lang::XMultiComponentFactory > bootstrapInitialSF(
OUString const & rBootstrapPath )
SAL_THROW( (Exception) )
......
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