summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorDaniel Boelzle <dbo@openoffice.org>2001-05-10 13:36:45 +0000
committerDaniel Boelzle <dbo@openoffice.org>2001-05-10 13:36:45 +0000
commit5461ea00be5330c4c13cbadc446eb70888634922 (patch)
treecfd3a7ee97eb76a5b7bff84493d8749c58ab2611 /stoc
parentf8bf1ee90320c0836c193568c97bcbf35e3ffbaa (diff)
adopted to component context: reads tdmgr out of context
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/corereflection/base.hxx7
-rw-r--r--stoc/source/corereflection/corefl.xml2
-rw-r--r--stoc/source/corereflection/crefl.cxx26
3 files changed, 19 insertions, 16 deletions
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx
index be35f6711f4d..fa3244e1471f 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 e51d3683734f..bafe8bc03d57 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 123a17746240..ba61eace61b1 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())
{