diff options
author | Daniel Boelzle <dbo@openoffice.org> | 2002-11-11 15:41:53 +0000 |
---|---|---|
committer | Daniel Boelzle <dbo@openoffice.org> | 2002-11-11 15:41:53 +0000 |
commit | 116b4c50f5d60deec1e19dd47e360fcac32af990 (patch) | |
tree | cba8f86cfe1d04a66e0311506f7957565692684c | |
parent | bf7b6a0b0624ed7bcd189499eae26c9e3f7c77ae (diff) |
#104787# writing corereflection singleton entry with registration
-rw-r--r-- | stoc/source/corereflection/base.hxx | 7 | ||||
-rw-r--r-- | stoc/source/corereflection/crefl.cxx | 28 |
2 files changed, 30 insertions, 5 deletions
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx index 606e744c12fb..26bbf0230675 100644 --- a/stoc/source/corereflection/base.hxx +++ b/stoc/source/corereflection/base.hxx @@ -2,9 +2,9 @@ * * $RCSfile: base.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dbo $ $Date: 2002-10-17 07:49:57 $ + * last change: $Author: dbo $ $Date: 2002-11-11 16:41:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -108,6 +108,9 @@ #include <com/sun/star/reflection/XIdlField2.hpp> #include <com/sun/star/reflection/XIdlMethod.hpp> +#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) + + using namespace std; using namespace osl; using namespace rtl; diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index 13ef5d988a98..533b6efd6eed 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: crefl.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dbo $ $Date: 2002-10-17 07:49:57 $ + * last change: $Author: dbo $ $Date: 2002-11-11 16:41:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,6 +70,7 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/reflection/XTypeDescription.hpp> +using namespace com::sun::star; using namespace com::sun::star::lang; using namespace com::sun::star::registry; using namespace cppu; @@ -550,7 +551,28 @@ void SAL_CALL component_getImplementationEnvironment( sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey ) { - return component_writeInfoHelper( pServiceManager, pRegistryKey, g_entries ); + if (component_writeInfoHelper( pServiceManager, pRegistryKey, g_entries )) + { + try + { + // register singleton + registry::XRegistryKey * pKey = + reinterpret_cast< registry::XRegistryKey * >( pRegistryKey ); + Reference< registry::XRegistryKey > xKey( + pKey->createKey( + OUSTR(IMPLNAME "/UNO/SINGLETONS/com.sun.star.reflection.theCoreReflection") ) ); + xKey->setStringValue( OUSTR("com.sun.star.reflection.CoreReflection") ); + return sal_True; + } + catch (Exception & exc) + { +#ifdef _DEBUG + OString cstr( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) ); + OSL_ENSURE( 0, cstr.getStr() ); +#endif + } + } + return sal_False; } //================================================================================================== void * SAL_CALL component_getFactory( |