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
This commit is contained in:
Stephan Bergmann
2013-01-15 18:16:01 +01:00
parent fc9d23ff55
commit 9e2972dbf1
3 changed files with 16 additions and 157 deletions

View File

@@ -27,7 +27,10 @@
#include "sal/types.h" #include "sal/types.h"
namespace com { namespace sun { namespace star { namespace com { namespace sun { namespace star {
namespace lang { class XMultiServiceFactory; } namespace lang {
class XMultiComponentFactory;
class XMultiServiceFactory;
}
namespace reflection { class XIdlClass; } namespace reflection { class XIdlClass; }
namespace registry { class XSimpleRegistry; } namespace registry { class XSimpleRegistry; }
namespace uno { class XComponentContext; } namespace uno { class XComponentContext; }
@@ -36,6 +39,17 @@ namespace rtl { class OUString; }
// Stubs for removed functionality, to be killed when we bump cppuhelper SONAME // 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 SAL_DLLPUBLIC_EXPORT css::uno::Reference< css::uno::XComponentContext > SAL_CALL
bootstrap_InitialComponentContext( bootstrap_InitialComponentContext(
css::uno::Reference< css::registry::XSimpleRegistry > const &, css::uno::Reference< css::registry::XSimpleRegistry > const &,

View File

@@ -20,35 +20,13 @@
#include <vector> #include <vector>
#include "rtl/string.hxx"
#include "rtl/bootstrap.hxx" #include "rtl/bootstrap.hxx"
#include "rtl/strbuf.hxx"
#include "osl/diagnose.h" #include "osl/diagnose.h"
#include "osl/file.h"
#include "osl/module.h"
#include "osl/process.h" #include "osl/process.h"
#include "cppuhelper/shlib.hxx"
#include "cppuhelper/factory.hxx"
#include "cppuhelper/component_context.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 <com/sun/star/lang/XServiceInfo.hpp>
#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" #include "com/sun/star/uno/SecurityException.hpp"
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
#include "macro_expander.hxx"
#include "paths.hxx"
#include "servicefactory_detail.hxx" #include "servicefactory_detail.hxx"
#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
@@ -62,30 +40,6 @@ using namespace ::com::sun::star::uno;
namespace cppu 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: /** bootstrap variables:
UNO_AC=<mode> [mandatory] UNO_AC=<mode> [mandatory]
@@ -234,103 +188,6 @@ void add_access_control_entries(
context_values.push_back( entry ); 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -25,17 +25,10 @@
#include <vector> #include <vector>
#include "com/sun/star/uno/Exception.hpp" #include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
#include "sal/types.h" #include "sal/types.h"
namespace com { namespace sun { namespace star { namespace lang {
class XMultiComponentFactory;
} } } }
namespace cppu { struct ContextEntry_Init; } namespace cppu { struct ContextEntry_Init; }
namespace rtl { namespace rtl { class Bootstrap; }
class Bootstrap;
class OUString;
}
namespace cppu { namespace cppu {
@@ -44,11 +37,6 @@ void add_access_control_entries(
rtl::Bootstrap const & bootstrap) rtl::Bootstrap const & bootstrap)
SAL_THROW((com::sun::star::uno::Exception)); 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 #endif