From 9e2972dbf1a9526f30ffd3e001a6eaf473d76ae9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 15 Jan 2013 18:16:01 +0100 Subject: API CHANGE: Remove obsolete cppu::bootstrapInitialSF An aborting stub is left in cppuhelper/source/compat.cxx to avoid having to incompatibly change cppuhelper/source/gcc3.map. Change-Id: I28359397fa9c06ac955ee646b5ad3486e9200a10 --- cppuhelper/source/compat.cxx | 16 +++- cppuhelper/source/servicefactory.cxx | 143 ---------------------------- cppuhelper/source/servicefactory_detail.hxx | 14 +-- 3 files changed, 16 insertions(+), 157 deletions(-) (limited to 'cppuhelper') diff --git a/cppuhelper/source/compat.cxx b/cppuhelper/source/compat.cxx index a90d7e56f638..ab57a2aea882 100644 --- a/cppuhelper/source/compat.cxx +++ b/cppuhelper/source/compat.cxx @@ -27,7 +27,10 @@ #include "sal/types.h" namespace com { namespace sun { namespace star { - namespace lang { class XMultiServiceFactory; } + namespace lang { + class XMultiComponentFactory; + class XMultiServiceFactory; + } namespace reflection { class XIdlClass; } namespace registry { class XSimpleRegistry; } namespace uno { class XComponentContext; } @@ -36,6 +39,17 @@ namespace rtl { class OUString; } // Stubs for removed functionality, to be killed when we bump cppuhelper SONAME +namespace cppu { + +SAL_DLLPUBLIC_EXPORT +css::uno::Reference< css::lang::XMultiComponentFactory > bootstrapInitialSF( + rtl::OUString const &) SAL_THROW((com::sun::star::uno::Exception)) +{ + for (;;) { std::abort(); } // avoid "must return a value" warnings +} + +} + SAL_DLLPUBLIC_EXPORT css::uno::Reference< css::uno::XComponentContext > SAL_CALL bootstrap_InitialComponentContext( css::uno::Reference< css::registry::XSimpleRegistry > const &, diff --git a/cppuhelper/source/servicefactory.cxx b/cppuhelper/source/servicefactory.cxx index ac7e93f75099..268ddaa990b4 100644 --- a/cppuhelper/source/servicefactory.cxx +++ b/cppuhelper/source/servicefactory.cxx @@ -20,35 +20,13 @@ #include -#include "rtl/string.hxx" #include "rtl/bootstrap.hxx" -#include "rtl/strbuf.hxx" #include "osl/diagnose.h" -#include "osl/file.h" -#include "osl/module.h" #include "osl/process.h" -#include "cppuhelper/shlib.hxx" -#include "cppuhelper/factory.hxx" #include "cppuhelper/component_context.hxx" -#include "cppuhelper/bootstrap.hxx" -#include "com/sun/star/uno/DeploymentException.hpp" -#include "com/sun/star/uno/XComponentContext.hpp" -#include "com/sun/star/lang/XInitialization.hpp" -#include -#include "com/sun/star/lang/XSingleServiceFactory.hpp" -#include "com/sun/star/lang/XSingleComponentFactory.hpp" -#include "com/sun/star/beans/XPropertySet.hpp" -#include "com/sun/star/container/XSet.hpp" -#include "com/sun/star/container/XHierarchicalNameAccess.hpp" -#include "com/sun/star/registry/XSimpleRegistry.hpp" #include "com/sun/star/uno/SecurityException.hpp" -#if OSL_DEBUG_LEVEL > 1 -#include -#endif -#include "macro_expander.hxx" -#include "paths.hxx" #include "servicefactory_detail.hxx" #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) @@ -62,30 +40,6 @@ using namespace ::com::sun::star::uno; namespace cppu { -static Reference< XInterface > SAL_CALL createInstance( - Reference< XInterface > const & xFactory, - Reference< XComponentContext > const & xContext = - Reference< XComponentContext >() ) -{ - Reference< lang::XSingleComponentFactory > xFac( xFactory, UNO_QUERY ); - if (xFac.is()) - { - return xFac->createInstanceWithContext( xContext ); - } - else - { - Reference< lang::XSingleServiceFactory > xFac2( xFactory, UNO_QUERY ); - if (xFac2.is()) - { - OSL_ENSURE( !xContext.is(), "### ignoring context!" ); - return xFac2->createInstance(); - } - } - throw RuntimeException( - OUSTR("no factory object given!"), - Reference< XInterface >() ); -} - /** bootstrap variables: UNO_AC= [mandatory] @@ -234,103 +188,6 @@ void add_access_control_entries( context_values.push_back( entry ); } -namespace { -void addFactories( - char const * const * ppNames /* 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 implName( OUString::createFromAscii( *ppNames++ ) ); - - Any aFac( makeAny( loadSharedLibComponentFactory( - OUSTR("bootstrap.uno" SAL_DLLEXTENSION), - 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( "bootstrap.uno" SAL_DLLEXTENSION ); - buf.append( "\"!!!" ); - OString str( buf.makeStringAndClear() ); - OSL_FAIL( str.getStr() ); - } -#endif - } -} - -} // namespace - -Reference< lang::XMultiComponentFactory > bootstrapInitialSF( - OUString const & rBootstrapPath ) - SAL_THROW( (Exception) ) -{ - OUString const & bootstrap_path = - rBootstrapPath.isEmpty() ? get_this_libpath() : rBootstrapPath; - - Reference< lang::XMultiComponentFactory > xMgr( - createInstance( - loadSharedLibComponentFactory( - OUSTR("bootstrap.uno" SAL_DLLEXTENSION), bootstrap_path, - OUSTR("com.sun.star.comp.stoc.ORegistryServiceManager"), - Reference< lang::XMultiServiceFactory >(), - Reference< registry::XRegistryKey >() ) ), - UNO_QUERY ); - - // add initial bootstrap services - static char const * ar[] = { - "com.sun.star.comp.stoc.OServiceManagerWrapper", - "com.sun.star.comp.stoc.DLLComponentLoader", - "com.sun.star.comp.stoc.SimpleRegistry", - "com.sun.star.comp.stoc.NestedRegistry", - "com.sun.star.comp.stoc.TypeDescriptionManager", - "com.sun.star.comp.stoc.ImplementationRegistration", - "com.sun.star.security.comp.stoc.AccessController", - "com.sun.star.security.comp.stoc.FilePolicy", - 0 - }; - addFactories( - ar, bootstrap_path, - xMgr, Reference< registry::XRegistryKey >() ); - - return xMgr; -} - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppuhelper/source/servicefactory_detail.hxx b/cppuhelper/source/servicefactory_detail.hxx index 40fe77f036ed..09c3997a2ed9 100644 --- a/cppuhelper/source/servicefactory_detail.hxx +++ b/cppuhelper/source/servicefactory_detail.hxx @@ -25,17 +25,10 @@ #include #include "com/sun/star/uno/Exception.hpp" -#include "com/sun/star/uno/Reference.hxx" #include "sal/types.h" -namespace com { namespace sun { namespace star { namespace lang { - class XMultiComponentFactory; -} } } } namespace cppu { struct ContextEntry_Init; } -namespace rtl { - class Bootstrap; - class OUString; -} +namespace rtl { class Bootstrap; } namespace cppu { @@ -44,11 +37,6 @@ void add_access_control_entries( rtl::Bootstrap const & bootstrap) SAL_THROW((com::sun::star::uno::Exception)); -SAL_DLLPUBLIC_EXPORT -com::sun::star::uno::Reference< com::sun::star::lang::XMultiComponentFactory > -bootstrapInitialSF(rtl::OUString const & rBootstrapPath) - SAL_THROW((com::sun::star::uno::Exception)); - } #endif -- cgit