diff options
author | Daniel Boelzle <dbo@openoffice.org> | 2001-05-10 13:36:45 +0000 |
---|---|---|
committer | Daniel Boelzle <dbo@openoffice.org> | 2001-05-10 13:36:45 +0000 |
commit | f5f82091c2256ed10a2e0c6ea450f2c67c0ae92f (patch) | |
tree | a72cbe711f52642f73fa672253173032dbb4412d /stoc/source | |
parent | 4ba5e08fa941e03205864544f43c9cf0bb8a342f (diff) |
adopted to component context: reads tdmgr out of context
Diffstat (limited to 'stoc/source')
-rw-r--r-- | stoc/source/corereflection/base.hxx | 7 | ||||
-rw-r--r-- | stoc/source/corereflection/corefl.xml | 2 | ||||
-rw-r--r-- | stoc/source/corereflection/crefl.cxx | 26 |
3 files changed, 19 insertions, 16 deletions
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx index d74904f91..40c22f9ba 100644 --- a/stoc/source/corereflection/base.hxx +++ b/stoc/source/corereflection/base.hxx @@ -2,9 +2,9 @@ * * $RCSfile: base.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jsc $ $Date: 2001-05-03 13:56:57 $ + * last change: $Author: dbo $ $Date: 2001-05-10 14:36:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,6 +98,7 @@ #endif #include <hash_map> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> @@ -173,7 +174,7 @@ public: { return _xMgr; } // ctor/ dtor - IdlReflectionServiceImpl( const Reference< XMultiServiceFactory > & xMgr ); + IdlReflectionServiceImpl( const Reference< XComponentContext > & xContext ); virtual ~IdlReflectionServiceImpl(); // XInterface diff --git a/stoc/source/corereflection/corefl.xml b/stoc/source/corereflection/corefl.xml index 55f0d3d93..9687236ec 100644 --- a/stoc/source/corereflection/corefl.xml +++ b/stoc/source/corereflection/corefl.xml @@ -23,9 +23,11 @@ The service provides reflection and access to all uno types <type> com.sun.star.lang.XComponent </type> <type> com.sun.star.lang.XTypeProvider </type> <type> com.sun.star.lang.XServiceInfo </type> + <type> com.sun.star.lang.XSingleComponentFactory </type> <type> com.sun.star.lang.XSingleServiceFactory </type> <type> com.sun.star.lang.XMultiServiceFactory </type> <type> com.sun.star.registry.XRegistryKey </type> + <type> com.sun.star.uno.XComponentContext </type> <type> com.sun.star.uno.XAggregation </type> <type> com.sun.star.uno.XWeak </type> <type> com.sun.star.uno.TypeClass </type> diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index 623e2d8bf..79aa0c1c6 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: crefl.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jl $ $Date: 2001-03-12 15:32:15 $ + * last change: $Author: dbo $ $Date: 2001-05-10 14:36:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -89,14 +89,15 @@ inline static Sequence< OUString > getSupportedServiceNames() } //__________________________________________________________________________________________________ -IdlReflectionServiceImpl::IdlReflectionServiceImpl( const Reference< XMultiServiceFactory > & xMgr ) +IdlReflectionServiceImpl::IdlReflectionServiceImpl( + const Reference< XComponentContext > & xContext ) : OComponentHelper( _aComponentMutex ) - , _xMgr( xMgr ) - , _xTDMgr( xMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.TypeDescriptionManager") ) ), - UNO_QUERY ) + , _xMgr( xContext->getServiceManager(), UNO_QUERY ) , _aElements( CACHE_SIZE ) { - OSL_ENSURE( _xTDMgr.is(), "### cannot get service \"com.sun.star.reflection.TypeDescriptionManager\"!" ); + xContext->getValueByName( OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.TypeDescriptionManager") ) ) >>= _xTDMgr; + OSL_ENSURE( _xTDMgr.is(), "### cannot get \"com.sun.star.reflection.TypeDescriptionManager\"!" ); } //__________________________________________________________________________________________________ IdlReflectionServiceImpl::~IdlReflectionServiceImpl() @@ -412,10 +413,10 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forType( typelib_TypeDescriptio //================================================================================================== Reference< XInterface > SAL_CALL IdlReflectionServiceImpl_create( - const Reference< XMultiServiceFactory > & xMgr ) + const Reference< XComponentContext > & xContext ) throw(::com::sun::star::uno::Exception) { - return Reference< XInterface >( (XWeak *)(OWeakObject *)new IdlReflectionServiceImpl( xMgr ) ); + return Reference< XInterface >( (XWeak *)(OWeakObject *)new IdlReflectionServiceImpl( xContext ) ); } } @@ -468,11 +469,10 @@ void * SAL_CALL component_getFactory( if (pServiceManager && rtl_str_compare( pImplName, IMPLNAME ) == 0) { - Reference< XSingleServiceFactory > xFactory( createOneInstanceFactory( - reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), - OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME) ), + Reference< XSingleServiceFactory > xFactory( createSingleComponentFactory( stoc_corefl::IdlReflectionServiceImpl_create, - stoc_corefl::getSupportedServiceNames() ) ); + OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME) ), + stoc_corefl::getSupportedServiceNames() ), UNO_QUERY ); if (xFactory.is()) { |