summaryrefslogtreecommitdiff
path: root/stoc/source/corereflection/crefl.cxx
diff options
context:
space:
mode:
authorDaniel Boelzle <dbo@openoffice.org>2002-11-11 15:41:53 +0000
committerDaniel Boelzle <dbo@openoffice.org>2002-11-11 15:41:53 +0000
commit116b4c50f5d60deec1e19dd47e360fcac32af990 (patch)
treecba8f86cfe1d04a66e0311506f7957565692684c /stoc/source/corereflection/crefl.cxx
parentbf7b6a0b0624ed7bcd189499eae26c9e3f7c77ae (diff)
#104787# writing corereflection singleton entry with registration
Diffstat (limited to 'stoc/source/corereflection/crefl.cxx')
-rw-r--r--stoc/source/corereflection/crefl.cxx28
1 files changed, 25 insertions, 3 deletions
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(