diff options
author | Daniel Boelzle <dbo@openoffice.org> | 2001-05-14 09:27:32 +0000 |
---|---|---|
committer | Daniel Boelzle <dbo@openoffice.org> | 2001-05-14 09:27:32 +0000 |
commit | 6ed8b394eb110688f1961fdaeeebd637ebdf019a (patch) | |
tree | 03bfe8e5c2a4b194521d557725686288526125bc /rdbmaker | |
parent | 3967dfa45926a94b5cb76dff5cfc93d9c8f10abe (diff) |
tdmgr now registered as singleton in context
Diffstat (limited to 'rdbmaker')
-rw-r--r-- | rdbmaker/source/rdbmaker/makefile.mk | 6 | ||||
-rw-r--r-- | rdbmaker/source/rdbmaker/typeblop.cxx | 47 |
2 files changed, 39 insertions, 14 deletions
diff --git a/rdbmaker/source/rdbmaker/makefile.mk b/rdbmaker/source/rdbmaker/makefile.mk index 0aae754fa..3fc15e4ff 100644 --- a/rdbmaker/source/rdbmaker/makefile.mk +++ b/rdbmaker/source/rdbmaker/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.9 $ +# $Revision: 1.10 $ # -# last change: $Author: jsc $ $Date: 2001-03-13 12:45:16 $ +# last change: $Author: dbo $ $Date: 2001-05-14 10:27:32 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -85,6 +85,8 @@ UNOTYPES= \ com.sun.star.lang.XMultiServiceFactory \ com.sun.star.lang.XSingleServiceFactory \ com.sun.star.container.XHierarchicalNameAccess \ + com.sun.star.beans.XPropertySet \ + com.sun.star.uno.XComponentContext \ com.sun.star.reflection.XInterfaceTypeDescription \ com.sun.star.reflection.XInterfaceMemberTypeDescription \ com.sun.star.reflection.XInterfaceMethodTypeDescription \ diff --git a/rdbmaker/source/rdbmaker/typeblop.cxx b/rdbmaker/source/rdbmaker/typeblop.cxx index 0912f3546..b39b26add 100644 --- a/rdbmaker/source/rdbmaker/typeblop.cxx +++ b/rdbmaker/source/rdbmaker/typeblop.cxx @@ -2,9 +2,9 @@ * * $RCSfile: typeblop.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jsc $ $Date: 2001-03-13 12:45:16 $ + * last change: $Author: dbo $ $Date: 2001-05-14 10:27:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,9 +94,15 @@ #ifndef _COM_SUN_STAR_REFLECTION_XENUMTYPEDESCRIPTION_HPP_ #include <com/sun/star/reflection/XEnumTypeDescription.hpp> #endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif +using namespace com::sun::star; using namespace com::sun::star::uno; -using namespace com::sun::star::registry; using namespace com::sun::star::reflection; using namespace com::sun::star::lang; using namespace com::sun::star::container; @@ -294,18 +300,35 @@ sal_Bool SAL_CALL initTypeMapper( const sal_Char* pRegName ) if ( !xSMgr.is() ) return sal_False; - - Reference< XInterface > xIFace( xSMgr->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.TypeDescriptionManager"))) ); - - if ( !xIFace.is() ) - return sal_False; - - Reference< XHierarchicalNameAccess > xNAccess(xIFace, UNO_QUERY); + Reference< XHierarchicalNameAccess > xNAccess; + + Reference< beans::XPropertySet > xProps( xSMgr, UNO_QUERY ); + if (xProps.is()) + { + try + { + Reference< XComponentContext > xContext; + if (xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xContext) + { + xContext->getValueByName( + OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.TypeDescriptionManager") ) ) >>= xNAccess; + } + } + catch (beans::UnknownPropertyException &) + { + } + } + + if (! xNAccess.is()) + { + xNAccess.set( xSMgr->createInstance( + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.TypeDescriptionManager"))), UNO_QUERY ); + } + if ( !xNAccess.is() ) return sal_False; - + xNameAccess = xNAccess; } catch( Exception& ) |