1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski // MARKER(update_precomp.py): autogen include statement, do not remove
25*b1cdbd2cSJim Jagielski #include "precompiled_stoc.hxx"
26*b1cdbd2cSJim Jagielski #include <osl/diagnose.h>
27*b1cdbd2cSJim Jagielski #include <osl/mutex.hxx>
28*b1cdbd2cSJim Jagielski #include <uno/dispatcher.h>
29*b1cdbd2cSJim Jagielski #include <uno/mapping.hxx>
30*b1cdbd2cSJim Jagielski #include <cppuhelper/factory.hxx>
31*b1cdbd2cSJim Jagielski #include <cppuhelper/compbase4.hxx>
32*b1cdbd2cSJim Jagielski #include <cppuhelper/implbase2.hxx>
33*b1cdbd2cSJim Jagielski #include <cppuhelper/typeprovider.hxx>
34*b1cdbd2cSJim Jagielski
35*b1cdbd2cSJim Jagielski #include <cppuhelper/weakref.hxx>
36*b1cdbd2cSJim Jagielski
37*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XServiceInfo.hpp>
38*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XComponent.hpp>
39*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XTypeProvider.hpp>
40*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XInitialization.hpp>
41*b1cdbd2cSJim Jagielski #include <com/sun/star/registry/XSimpleRegistry.hpp>
42*b1cdbd2cSJim Jagielski #include <com/sun/star/registry/XRegistryKey.hpp>
43*b1cdbd2cSJim Jagielski #include <com/sun/star/beans/XPropertySet.hpp>
44*b1cdbd2cSJim Jagielski #include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
45*b1cdbd2cSJim Jagielski #include "com/sun/star/uno/RuntimeException.hpp"
46*b1cdbd2cSJim Jagielski
47*b1cdbd2cSJim Jagielski #include "registry/reader.hxx"
48*b1cdbd2cSJim Jagielski #include "registry/version.h"
49*b1cdbd2cSJim Jagielski #include "base.hxx"
50*b1cdbd2cSJim Jagielski #include "rdbtdp_tdenumeration.hxx"
51*b1cdbd2cSJim Jagielski #include "structtypedescription.hxx"
52*b1cdbd2cSJim Jagielski
53*b1cdbd2cSJim Jagielski #define SERVICENAME "com.sun.star.reflection.TypeDescriptionProvider"
54*b1cdbd2cSJim Jagielski #define IMPLNAME "com.sun.star.comp.stoc.RegistryTypeDescriptionProvider"
55*b1cdbd2cSJim Jagielski
56*b1cdbd2cSJim Jagielski using namespace com::sun::star;
57*b1cdbd2cSJim Jagielski using namespace com::sun::star::beans;
58*b1cdbd2cSJim Jagielski using namespace com::sun::star::registry;
59*b1cdbd2cSJim Jagielski
60*b1cdbd2cSJim Jagielski extern rtl_StandardModuleCount g_moduleCount;
61*b1cdbd2cSJim Jagielski
62*b1cdbd2cSJim Jagielski namespace stoc_bootstrap
63*b1cdbd2cSJim Jagielski {
rdbtdp_getSupportedServiceNames()64*b1cdbd2cSJim Jagielski uno::Sequence< OUString > rdbtdp_getSupportedServiceNames()
65*b1cdbd2cSJim Jagielski {
66*b1cdbd2cSJim Jagielski static Sequence < OUString > *pNames = 0;
67*b1cdbd2cSJim Jagielski if( ! pNames )
68*b1cdbd2cSJim Jagielski {
69*b1cdbd2cSJim Jagielski MutexGuard guard( Mutex::getGlobalMutex() );
70*b1cdbd2cSJim Jagielski if( !pNames )
71*b1cdbd2cSJim Jagielski {
72*b1cdbd2cSJim Jagielski static Sequence< OUString > seqNames(1);
73*b1cdbd2cSJim Jagielski seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME));
74*b1cdbd2cSJim Jagielski pNames = &seqNames;
75*b1cdbd2cSJim Jagielski }
76*b1cdbd2cSJim Jagielski }
77*b1cdbd2cSJim Jagielski return *pNames;
78*b1cdbd2cSJim Jagielski }
79*b1cdbd2cSJim Jagielski
rdbtdp_getImplementationName()80*b1cdbd2cSJim Jagielski OUString rdbtdp_getImplementationName()
81*b1cdbd2cSJim Jagielski {
82*b1cdbd2cSJim Jagielski static OUString *pImplName = 0;
83*b1cdbd2cSJim Jagielski if( ! pImplName )
84*b1cdbd2cSJim Jagielski {
85*b1cdbd2cSJim Jagielski MutexGuard guard( Mutex::getGlobalMutex() );
86*b1cdbd2cSJim Jagielski if( ! pImplName )
87*b1cdbd2cSJim Jagielski {
88*b1cdbd2cSJim Jagielski static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) );
89*b1cdbd2cSJim Jagielski pImplName = &implName;
90*b1cdbd2cSJim Jagielski }
91*b1cdbd2cSJim Jagielski }
92*b1cdbd2cSJim Jagielski return *pImplName;
93*b1cdbd2cSJim Jagielski }
94*b1cdbd2cSJim Jagielski }
95*b1cdbd2cSJim Jagielski
96*b1cdbd2cSJim Jagielski namespace stoc_rdbtdp
97*b1cdbd2cSJim Jagielski {
98*b1cdbd2cSJim Jagielski struct MutexHolder
99*b1cdbd2cSJim Jagielski {
100*b1cdbd2cSJim Jagielski Mutex _aComponentMutex;
101*b1cdbd2cSJim Jagielski };
102*b1cdbd2cSJim Jagielski //==================================================================================================
103*b1cdbd2cSJim Jagielski class ProviderImpl
104*b1cdbd2cSJim Jagielski : public MutexHolder
105*b1cdbd2cSJim Jagielski , public WeakComponentImplHelper4< XServiceInfo,
106*b1cdbd2cSJim Jagielski XHierarchicalNameAccess,
107*b1cdbd2cSJim Jagielski XTypeDescriptionEnumerationAccess,
108*b1cdbd2cSJim Jagielski XInitialization >
109*b1cdbd2cSJim Jagielski {
110*b1cdbd2cSJim Jagielski // XHierarchicalNameAccess + XTypeDescriptionEnumerationAccess wrapper
111*b1cdbd2cSJim Jagielski // first asking the tdmgr instance, then looking up locally
112*b1cdbd2cSJim Jagielski class TypeDescriptionManagerWrapper
113*b1cdbd2cSJim Jagielski : public ::cppu::WeakImplHelper2<
114*b1cdbd2cSJim Jagielski container::XHierarchicalNameAccess,
115*b1cdbd2cSJim Jagielski reflection::XTypeDescriptionEnumerationAccess>
116*b1cdbd2cSJim Jagielski {
117*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference<container::XHierarchicalNameAccess>
118*b1cdbd2cSJim Jagielski m_xTDMgr;
119*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference<container::XHierarchicalNameAccess>
120*b1cdbd2cSJim Jagielski m_xThisProvider;
121*b1cdbd2cSJim Jagielski public:
TypeDescriptionManagerWrapper(ProviderImpl * pProvider)122*b1cdbd2cSJim Jagielski TypeDescriptionManagerWrapper( ProviderImpl * pProvider )
123*b1cdbd2cSJim Jagielski : m_xTDMgr( pProvider->_xContext->getValueByName(
124*b1cdbd2cSJim Jagielski OUString( RTL_CONSTASCII_USTRINGPARAM(
125*b1cdbd2cSJim Jagielski "/singletons/com.sun.star.reflection."
126*b1cdbd2cSJim Jagielski "theTypeDescriptionManager") ) ),
127*b1cdbd2cSJim Jagielski UNO_QUERY_THROW ),
128*b1cdbd2cSJim Jagielski m_xThisProvider( pProvider )
129*b1cdbd2cSJim Jagielski {}
130*b1cdbd2cSJim Jagielski // XHierarchicalNameAccess
131*b1cdbd2cSJim Jagielski virtual Any SAL_CALL getByHierarchicalName( OUString const & name )
132*b1cdbd2cSJim Jagielski throw (container::NoSuchElementException, RuntimeException);
133*b1cdbd2cSJim Jagielski virtual sal_Bool SAL_CALL hasByHierarchicalName( OUString const & name )
134*b1cdbd2cSJim Jagielski throw (RuntimeException);
135*b1cdbd2cSJim Jagielski
136*b1cdbd2cSJim Jagielski // XTypeDescriptionEnumerationAccess
137*b1cdbd2cSJim Jagielski virtual uno::Reference<
138*b1cdbd2cSJim Jagielski reflection::XTypeDescriptionEnumeration > SAL_CALL
139*b1cdbd2cSJim Jagielski createTypeDescriptionEnumeration(
140*b1cdbd2cSJim Jagielski const ::rtl::OUString& moduleName,
141*b1cdbd2cSJim Jagielski const uno::Sequence< uno::TypeClass >& types,
142*b1cdbd2cSJim Jagielski reflection::TypeDescriptionSearchDepth depth )
143*b1cdbd2cSJim Jagielski throw ( reflection::NoSuchTypeNameException,
144*b1cdbd2cSJim Jagielski reflection::InvalidTypeNameException,
145*b1cdbd2cSJim Jagielski uno::RuntimeException );
146*b1cdbd2cSJim Jagielski };
147*b1cdbd2cSJim Jagielski friend class TypeDescriptionManagerWrapper;
148*b1cdbd2cSJim Jagielski
149*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XComponentContext > _xContext;
150*b1cdbd2cSJim Jagielski com::sun::star::uno::WeakReference<XHierarchicalNameAccess> _xTDMgr;
151*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XHierarchicalNameAccess > getTDMgr() SAL_THROW( () );
152*b1cdbd2cSJim Jagielski
153*b1cdbd2cSJim Jagielski RegistryKeyList _aBaseKeys;
154*b1cdbd2cSJim Jagielski
155*b1cdbd2cSJim Jagielski protected:
156*b1cdbd2cSJim Jagielski virtual void SAL_CALL disposing();
157*b1cdbd2cSJim Jagielski
158*b1cdbd2cSJim Jagielski public:
159*b1cdbd2cSJim Jagielski ProviderImpl( const com::sun::star::uno::Reference< XComponentContext > & xContext );
160*b1cdbd2cSJim Jagielski virtual ~ProviderImpl();
161*b1cdbd2cSJim Jagielski
162*b1cdbd2cSJim Jagielski // XInitialization
163*b1cdbd2cSJim Jagielski virtual void SAL_CALL initialize( const Sequence< Any > & args ) throw (Exception, RuntimeException);
164*b1cdbd2cSJim Jagielski
165*b1cdbd2cSJim Jagielski // XServiceInfo
166*b1cdbd2cSJim Jagielski virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
167*b1cdbd2cSJim Jagielski virtual sal_Bool SAL_CALL supportsService( const OUString & rServiceName ) throw(::com::sun::star::uno::RuntimeException);
168*b1cdbd2cSJim Jagielski virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
169*b1cdbd2cSJim Jagielski
170*b1cdbd2cSJim Jagielski // XHierarchicalNameAccess
171*b1cdbd2cSJim Jagielski Any getByHierarchicalNameImpl( const OUString & rName );
172*b1cdbd2cSJim Jagielski
173*b1cdbd2cSJim Jagielski virtual Any SAL_CALL getByHierarchicalName( const OUString & rName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
174*b1cdbd2cSJim Jagielski virtual sal_Bool SAL_CALL hasByHierarchicalName( const OUString & rName ) throw(::com::sun::star::uno::RuntimeException);
175*b1cdbd2cSJim Jagielski
176*b1cdbd2cSJim Jagielski // XTypeDescriptionEnumerationAccess
177*b1cdbd2cSJim Jagielski virtual ::com::sun::star::uno::Reference<
178*b1cdbd2cSJim Jagielski ::com::sun::star::reflection::XTypeDescriptionEnumeration > SAL_CALL
179*b1cdbd2cSJim Jagielski createTypeDescriptionEnumeration(
180*b1cdbd2cSJim Jagielski const ::rtl::OUString& moduleName,
181*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Sequence<
182*b1cdbd2cSJim Jagielski ::com::sun::star::uno::TypeClass >& types,
183*b1cdbd2cSJim Jagielski ::com::sun::star::reflection::TypeDescriptionSearchDepth depth )
184*b1cdbd2cSJim Jagielski throw ( ::com::sun::star::reflection::NoSuchTypeNameException,
185*b1cdbd2cSJim Jagielski ::com::sun::star::reflection::InvalidTypeNameException,
186*b1cdbd2cSJim Jagielski ::com::sun::star::uno::RuntimeException );
187*b1cdbd2cSJim Jagielski };
188*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
ProviderImpl(const com::sun::star::uno::Reference<XComponentContext> & xContext)189*b1cdbd2cSJim Jagielski ProviderImpl::ProviderImpl( const com::sun::star::uno::Reference< XComponentContext > & xContext )
190*b1cdbd2cSJim Jagielski : WeakComponentImplHelper4<
191*b1cdbd2cSJim Jagielski XServiceInfo, XHierarchicalNameAccess,
192*b1cdbd2cSJim Jagielski XTypeDescriptionEnumerationAccess, XInitialization >( _aComponentMutex )
193*b1cdbd2cSJim Jagielski , _xContext( xContext )
194*b1cdbd2cSJim Jagielski {
195*b1cdbd2cSJim Jagielski g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
196*b1cdbd2cSJim Jagielski }
197*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
~ProviderImpl()198*b1cdbd2cSJim Jagielski ProviderImpl::~ProviderImpl()
199*b1cdbd2cSJim Jagielski {
200*b1cdbd2cSJim Jagielski g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
201*b1cdbd2cSJim Jagielski }
202*b1cdbd2cSJim Jagielski
203*b1cdbd2cSJim Jagielski //______________________________________________________________________________
getByHierarchicalName(OUString const & name)204*b1cdbd2cSJim Jagielski Any ProviderImpl::TypeDescriptionManagerWrapper::getByHierarchicalName(
205*b1cdbd2cSJim Jagielski OUString const & name ) throw (container::NoSuchElementException,
206*b1cdbd2cSJim Jagielski RuntimeException)
207*b1cdbd2cSJim Jagielski {
208*b1cdbd2cSJim Jagielski try
209*b1cdbd2cSJim Jagielski {
210*b1cdbd2cSJim Jagielski // first try tdmgr:
211*b1cdbd2cSJim Jagielski return m_xTDMgr->getByHierarchicalName( name );
212*b1cdbd2cSJim Jagielski }
213*b1cdbd2cSJim Jagielski catch (container::NoSuchElementException &)
214*b1cdbd2cSJim Jagielski {
215*b1cdbd2cSJim Jagielski // then lookup locally:
216*b1cdbd2cSJim Jagielski return m_xThisProvider->getByHierarchicalName( name );
217*b1cdbd2cSJim Jagielski }
218*b1cdbd2cSJim Jagielski }
219*b1cdbd2cSJim Jagielski
220*b1cdbd2cSJim Jagielski //______________________________________________________________________________
hasByHierarchicalName(OUString const & name)221*b1cdbd2cSJim Jagielski sal_Bool ProviderImpl::TypeDescriptionManagerWrapper::hasByHierarchicalName(
222*b1cdbd2cSJim Jagielski OUString const & name ) throw (RuntimeException)
223*b1cdbd2cSJim Jagielski {
224*b1cdbd2cSJim Jagielski return m_xTDMgr->hasByHierarchicalName( name ) || m_xThisProvider->hasByHierarchicalName( name );
225*b1cdbd2cSJim Jagielski }
226*b1cdbd2cSJim Jagielski
227*b1cdbd2cSJim Jagielski //______________________________________________________________________________
228*b1cdbd2cSJim Jagielski uno::Reference< reflection::XTypeDescriptionEnumeration > SAL_CALL
createTypeDescriptionEnumeration(const::rtl::OUString & moduleName,const uno::Sequence<uno::TypeClass> & types,reflection::TypeDescriptionSearchDepth depth)229*b1cdbd2cSJim Jagielski ProviderImpl::TypeDescriptionManagerWrapper::createTypeDescriptionEnumeration(
230*b1cdbd2cSJim Jagielski const ::rtl::OUString& moduleName,
231*b1cdbd2cSJim Jagielski const uno::Sequence< uno::TypeClass >& types,
232*b1cdbd2cSJim Jagielski reflection::TypeDescriptionSearchDepth depth )
233*b1cdbd2cSJim Jagielski throw ( reflection::NoSuchTypeNameException,
234*b1cdbd2cSJim Jagielski reflection::InvalidTypeNameException,
235*b1cdbd2cSJim Jagielski uno::RuntimeException )
236*b1cdbd2cSJim Jagielski {
237*b1cdbd2cSJim Jagielski try
238*b1cdbd2cSJim Jagielski {
239*b1cdbd2cSJim Jagielski // first try tdmgr:
240*b1cdbd2cSJim Jagielski uno::Reference< reflection::XTypeDescriptionEnumerationAccess > xTDEA(
241*b1cdbd2cSJim Jagielski m_xTDMgr, uno::UNO_QUERY_THROW );
242*b1cdbd2cSJim Jagielski return
243*b1cdbd2cSJim Jagielski xTDEA->createTypeDescriptionEnumeration( moduleName, types, depth );
244*b1cdbd2cSJim Jagielski }
245*b1cdbd2cSJim Jagielski catch (reflection::NoSuchTypeNameException &)
246*b1cdbd2cSJim Jagielski {
247*b1cdbd2cSJim Jagielski // then lookup locally:
248*b1cdbd2cSJim Jagielski uno::Reference< reflection::XTypeDescriptionEnumerationAccess > xTDEA(
249*b1cdbd2cSJim Jagielski m_xThisProvider, uno::UNO_QUERY_THROW );
250*b1cdbd2cSJim Jagielski return
251*b1cdbd2cSJim Jagielski xTDEA->createTypeDescriptionEnumeration( moduleName, types, depth );
252*b1cdbd2cSJim Jagielski }
253*b1cdbd2cSJim Jagielski }
254*b1cdbd2cSJim Jagielski
255*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
getTDMgr()256*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XHierarchicalNameAccess > ProviderImpl::getTDMgr()
257*b1cdbd2cSJim Jagielski SAL_THROW( () )
258*b1cdbd2cSJim Jagielski {
259*b1cdbd2cSJim Jagielski // harden weak reference:
260*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference<container::XHierarchicalNameAccess> xTDMgr(
261*b1cdbd2cSJim Jagielski _xTDMgr );
262*b1cdbd2cSJim Jagielski if (! xTDMgr.is())
263*b1cdbd2cSJim Jagielski {
264*b1cdbd2cSJim Jagielski xTDMgr.set( new TypeDescriptionManagerWrapper(this) );
265*b1cdbd2cSJim Jagielski {
266*b1cdbd2cSJim Jagielski MutexGuard guard( _aComponentMutex );
267*b1cdbd2cSJim Jagielski _xTDMgr = xTDMgr;
268*b1cdbd2cSJim Jagielski }
269*b1cdbd2cSJim Jagielski }
270*b1cdbd2cSJim Jagielski return xTDMgr;
271*b1cdbd2cSJim Jagielski }
272*b1cdbd2cSJim Jagielski
273*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
disposing()274*b1cdbd2cSJim Jagielski void ProviderImpl::disposing()
275*b1cdbd2cSJim Jagielski {
276*b1cdbd2cSJim Jagielski _xContext.clear();
277*b1cdbd2cSJim Jagielski
278*b1cdbd2cSJim Jagielski for ( RegistryKeyList::const_iterator iPos( _aBaseKeys.begin() );
279*b1cdbd2cSJim Jagielski iPos != _aBaseKeys.end(); ++iPos )
280*b1cdbd2cSJim Jagielski {
281*b1cdbd2cSJim Jagielski (*iPos)->closeKey();
282*b1cdbd2cSJim Jagielski }
283*b1cdbd2cSJim Jagielski _aBaseKeys.clear();
284*b1cdbd2cSJim Jagielski }
285*b1cdbd2cSJim Jagielski
286*b1cdbd2cSJim Jagielski // XInitialization
287*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
initialize(const Sequence<Any> & args)288*b1cdbd2cSJim Jagielski void ProviderImpl::initialize(
289*b1cdbd2cSJim Jagielski const Sequence< Any > & args )
290*b1cdbd2cSJim Jagielski throw (Exception, RuntimeException)
291*b1cdbd2cSJim Jagielski {
292*b1cdbd2cSJim Jagielski // registries to read from
293*b1cdbd2cSJim Jagielski Any const * pRegistries = args.getConstArray();
294*b1cdbd2cSJim Jagielski for ( sal_Int32 nPos = 0; nPos < args.getLength(); ++nPos )
295*b1cdbd2cSJim Jagielski {
296*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XSimpleRegistry > xRegistry( pRegistries[ nPos ], UNO_QUERY );
297*b1cdbd2cSJim Jagielski if (xRegistry.is() && xRegistry->isValid())
298*b1cdbd2cSJim Jagielski {
299*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XRegistryKey > xKey( xRegistry->getRootKey()->openKey(
300*b1cdbd2cSJim Jagielski OUString( RTL_CONSTASCII_USTRINGPARAM("/UCR") ) ) );
301*b1cdbd2cSJim Jagielski if (xKey.is() && xKey->isValid())
302*b1cdbd2cSJim Jagielski {
303*b1cdbd2cSJim Jagielski _aBaseKeys.push_back( xKey );
304*b1cdbd2cSJim Jagielski }
305*b1cdbd2cSJim Jagielski }
306*b1cdbd2cSJim Jagielski }
307*b1cdbd2cSJim Jagielski }
308*b1cdbd2cSJim Jagielski
309*b1cdbd2cSJim Jagielski // XServiceInfo
310*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
getImplementationName()311*b1cdbd2cSJim Jagielski OUString ProviderImpl::getImplementationName()
312*b1cdbd2cSJim Jagielski throw(::com::sun::star::uno::RuntimeException)
313*b1cdbd2cSJim Jagielski {
314*b1cdbd2cSJim Jagielski return stoc_bootstrap::rdbtdp_getImplementationName();
315*b1cdbd2cSJim Jagielski }
316*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
supportsService(const OUString & rServiceName)317*b1cdbd2cSJim Jagielski sal_Bool ProviderImpl::supportsService( const OUString & rServiceName )
318*b1cdbd2cSJim Jagielski throw(::com::sun::star::uno::RuntimeException)
319*b1cdbd2cSJim Jagielski {
320*b1cdbd2cSJim Jagielski const Sequence< OUString > & rSNL = getSupportedServiceNames();
321*b1cdbd2cSJim Jagielski const OUString * pArray = rSNL.getConstArray();
322*b1cdbd2cSJim Jagielski for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
323*b1cdbd2cSJim Jagielski {
324*b1cdbd2cSJim Jagielski if (pArray[nPos] == rServiceName)
325*b1cdbd2cSJim Jagielski return sal_True;
326*b1cdbd2cSJim Jagielski }
327*b1cdbd2cSJim Jagielski return sal_False;
328*b1cdbd2cSJim Jagielski }
329*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
getSupportedServiceNames()330*b1cdbd2cSJim Jagielski Sequence< OUString > ProviderImpl::getSupportedServiceNames()
331*b1cdbd2cSJim Jagielski throw(::com::sun::star::uno::RuntimeException)
332*b1cdbd2cSJim Jagielski {
333*b1cdbd2cSJim Jagielski return stoc_bootstrap::rdbtdp_getSupportedServiceNames();
334*b1cdbd2cSJim Jagielski }
335*b1cdbd2cSJim Jagielski
336*b1cdbd2cSJim Jagielski // XHierarchicalNameAccess
337*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
getByHierarchicalNameImpl(const OUString & rName)338*b1cdbd2cSJim Jagielski Any ProviderImpl::getByHierarchicalNameImpl( const OUString & rName )
339*b1cdbd2cSJim Jagielski {
340*b1cdbd2cSJim Jagielski Any aRet;
341*b1cdbd2cSJim Jagielski
342*b1cdbd2cSJim Jagielski // read from registry
343*b1cdbd2cSJim Jagielski OUString aKey( rName.replace( '.', '/' ) );
344*b1cdbd2cSJim Jagielski for ( RegistryKeyList::const_iterator iPos( _aBaseKeys.begin() );
345*b1cdbd2cSJim Jagielski !aRet.hasValue() && iPos != _aBaseKeys.end(); ++iPos )
346*b1cdbd2cSJim Jagielski {
347*b1cdbd2cSJim Jagielski try
348*b1cdbd2cSJim Jagielski {
349*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XRegistryKey > xBaseKey( *iPos );
350*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XRegistryKey > xKey( xBaseKey->openKey( aKey ) );
351*b1cdbd2cSJim Jagielski if (xKey.is())
352*b1cdbd2cSJim Jagielski {
353*b1cdbd2cSJim Jagielski // closes key in it's dtor (which is
354*b1cdbd2cSJim Jagielski // called even in case of exceptions).
355*b1cdbd2cSJim Jagielski RegistryKeyCloser aCloser( xKey );
356*b1cdbd2cSJim Jagielski
357*b1cdbd2cSJim Jagielski if ( xKey->isValid() )
358*b1cdbd2cSJim Jagielski {
359*b1cdbd2cSJim Jagielski if (xKey->getValueType() == RegistryValueType_BINARY)
360*b1cdbd2cSJim Jagielski {
361*b1cdbd2cSJim Jagielski Sequence< sal_Int8 > aBytes( xKey->getBinaryValue() );
362*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XTypeDescription > xTD(
363*b1cdbd2cSJim Jagielski createTypeDescription( aBytes,
364*b1cdbd2cSJim Jagielski getTDMgr(),
365*b1cdbd2cSJim Jagielski true ) );
366*b1cdbd2cSJim Jagielski if ( xTD.is() )
367*b1cdbd2cSJim Jagielski aRet <<= xTD;
368*b1cdbd2cSJim Jagielski }
369*b1cdbd2cSJim Jagielski }
370*b1cdbd2cSJim Jagielski }
371*b1cdbd2cSJim Jagielski else // might be a constant
372*b1cdbd2cSJim Jagielski {
373*b1cdbd2cSJim Jagielski sal_Int32 nIndex = aKey.lastIndexOf( '/' );
374*b1cdbd2cSJim Jagielski if (nIndex > 0)
375*b1cdbd2cSJim Jagielski {
376*b1cdbd2cSJim Jagielski // open module
377*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XRegistryKey > xKey2( xBaseKey->openKey( aKey.copy( 0, nIndex ) ) );
378*b1cdbd2cSJim Jagielski if (xKey2.is())
379*b1cdbd2cSJim Jagielski {
380*b1cdbd2cSJim Jagielski // closes key in it's dtor (which is
381*b1cdbd2cSJim Jagielski // called even in case of exceptions).
382*b1cdbd2cSJim Jagielski RegistryKeyCloser aCloser( xKey2 );
383*b1cdbd2cSJim Jagielski
384*b1cdbd2cSJim Jagielski if ( xKey2->isValid() )
385*b1cdbd2cSJim Jagielski {
386*b1cdbd2cSJim Jagielski if (xKey2->getValueType() == RegistryValueType_BINARY)
387*b1cdbd2cSJim Jagielski {
388*b1cdbd2cSJim Jagielski Sequence< sal_Int8 > aBytes( xKey2->getBinaryValue() );
389*b1cdbd2cSJim Jagielski typereg::Reader aReader(
390*b1cdbd2cSJim Jagielski aBytes.getConstArray(), aBytes.getLength(),
391*b1cdbd2cSJim Jagielski false, TYPEREG_VERSION_1);
392*b1cdbd2cSJim Jagielski
393*b1cdbd2cSJim Jagielski if (aReader.getTypeClass() == RT_TYPE_MODULE ||
394*b1cdbd2cSJim Jagielski aReader.getTypeClass() == RT_TYPE_CONSTANTS ||
395*b1cdbd2cSJim Jagielski aReader.getTypeClass() == RT_TYPE_ENUM)
396*b1cdbd2cSJim Jagielski {
397*b1cdbd2cSJim Jagielski OUString aFieldName( aKey.copy( nIndex+1, aKey.getLength() - nIndex -1 ) );
398*b1cdbd2cSJim Jagielski sal_Int16 nPos = aReader.getFieldCount();
399*b1cdbd2cSJim Jagielski while (nPos--)
400*b1cdbd2cSJim Jagielski {
401*b1cdbd2cSJim Jagielski if (aFieldName.equals(
402*b1cdbd2cSJim Jagielski aReader.getFieldName(nPos)))
403*b1cdbd2cSJim Jagielski break;
404*b1cdbd2cSJim Jagielski }
405*b1cdbd2cSJim Jagielski if (nPos >= 0)
406*b1cdbd2cSJim Jagielski aRet = getRTValue(
407*b1cdbd2cSJim Jagielski aReader.getFieldValue(nPos));
408*b1cdbd2cSJim Jagielski }
409*b1cdbd2cSJim Jagielski }
410*b1cdbd2cSJim Jagielski }
411*b1cdbd2cSJim Jagielski }
412*b1cdbd2cSJim Jagielski }
413*b1cdbd2cSJim Jagielski }
414*b1cdbd2cSJim Jagielski }
415*b1cdbd2cSJim Jagielski catch ( InvalidRegistryException const & )
416*b1cdbd2cSJim Jagielski {
417*b1cdbd2cSJim Jagielski OSL_ENSURE( sal_False,
418*b1cdbd2cSJim Jagielski "ProviderImpl::getByHierarchicalName "
419*b1cdbd2cSJim Jagielski "- Caught InvalidRegistryException!" );
420*b1cdbd2cSJim Jagielski
421*b1cdbd2cSJim Jagielski // openKey, closeKey, getValueType, getBinaryValue, isValid
422*b1cdbd2cSJim Jagielski
423*b1cdbd2cSJim Jagielski // Don't stop iteration in this case.
424*b1cdbd2cSJim Jagielski }
425*b1cdbd2cSJim Jagielski catch ( NoSuchElementException const & )
426*b1cdbd2cSJim Jagielski {
427*b1cdbd2cSJim Jagielski }
428*b1cdbd2cSJim Jagielski }
429*b1cdbd2cSJim Jagielski return aRet;
430*b1cdbd2cSJim Jagielski }
431*b1cdbd2cSJim Jagielski
getByHierarchicalName(const OUString & rName)432*b1cdbd2cSJim Jagielski Any SAL_CALL ProviderImpl::getByHierarchicalName( const OUString & rName )
433*b1cdbd2cSJim Jagielski throw(::com::sun::star::uno::RuntimeException, com::sun::star::container::NoSuchElementException)
434*b1cdbd2cSJim Jagielski {
435*b1cdbd2cSJim Jagielski Any aRet( getByHierarchicalNameImpl( rName ) );
436*b1cdbd2cSJim Jagielski
437*b1cdbd2cSJim Jagielski if ( !aRet.hasValue() )
438*b1cdbd2cSJim Jagielski throw NoSuchElementException(
439*b1cdbd2cSJim Jagielski rName, static_cast< cppu::OWeakObject * >( this ) );
440*b1cdbd2cSJim Jagielski
441*b1cdbd2cSJim Jagielski return aRet;
442*b1cdbd2cSJim Jagielski }
443*b1cdbd2cSJim Jagielski
444*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
hasByHierarchicalName(const OUString & rName)445*b1cdbd2cSJim Jagielski sal_Bool ProviderImpl::hasByHierarchicalName( const OUString & rName )
446*b1cdbd2cSJim Jagielski throw(::com::sun::star::uno::RuntimeException)
447*b1cdbd2cSJim Jagielski {
448*b1cdbd2cSJim Jagielski return getByHierarchicalNameImpl( rName ).hasValue();
449*b1cdbd2cSJim Jagielski }
450*b1cdbd2cSJim Jagielski
451*b1cdbd2cSJim Jagielski // XTypeDescriptionEnumerationAccess
452*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
453*b1cdbd2cSJim Jagielski // virtual
454*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XTypeDescriptionEnumeration > SAL_CALL
createTypeDescriptionEnumeration(const OUString & moduleName,const Sequence<TypeClass> & types,TypeDescriptionSearchDepth depth)455*b1cdbd2cSJim Jagielski ProviderImpl::createTypeDescriptionEnumeration(
456*b1cdbd2cSJim Jagielski const OUString & moduleName,
457*b1cdbd2cSJim Jagielski const Sequence< TypeClass > & types,
458*b1cdbd2cSJim Jagielski TypeDescriptionSearchDepth depth )
459*b1cdbd2cSJim Jagielski throw ( NoSuchTypeNameException,
460*b1cdbd2cSJim Jagielski InvalidTypeNameException,
461*b1cdbd2cSJim Jagielski RuntimeException )
462*b1cdbd2cSJim Jagielski {
463*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescriptionEnumeration >(
464*b1cdbd2cSJim Jagielski TypeDescriptionEnumerationImpl::createInstance( getTDMgr(),
465*b1cdbd2cSJim Jagielski moduleName,
466*b1cdbd2cSJim Jagielski types,
467*b1cdbd2cSJim Jagielski depth,
468*b1cdbd2cSJim Jagielski _aBaseKeys ).get() );
469*b1cdbd2cSJim Jagielski }
470*b1cdbd2cSJim Jagielski
471*b1cdbd2cSJim Jagielski //__________________________________________________________________________________________________
472*b1cdbd2cSJim Jagielski // global helper function
473*b1cdbd2cSJim Jagielski
resolveTypedefs(com::sun::star::uno::Reference<XTypeDescription> const & type)474*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XTypeDescription > resolveTypedefs(
475*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XTypeDescription > const & type)
476*b1cdbd2cSJim Jagielski {
477*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XTypeDescription > resolved(type);
478*b1cdbd2cSJim Jagielski while (resolved->getTypeClass() == TypeClass_TYPEDEF) {
479*b1cdbd2cSJim Jagielski resolved = com::sun::star::uno::Reference< XIndirectTypeDescription >(
480*b1cdbd2cSJim Jagielski resolved, UNO_QUERY_THROW)->getReferencedType();
481*b1cdbd2cSJim Jagielski }
482*b1cdbd2cSJim Jagielski return resolved;
483*b1cdbd2cSJim Jagielski }
484*b1cdbd2cSJim Jagielski
createTypeDescription(const Sequence<sal_Int8> & rData,const com::sun::star::uno::Reference<XHierarchicalNameAccess> & xNameAccess,bool bReturnEmptyRefForUnknownType)485*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XTypeDescription > createTypeDescription(
486*b1cdbd2cSJim Jagielski const Sequence< sal_Int8 > & rData,
487*b1cdbd2cSJim Jagielski const com::sun::star::uno::Reference< XHierarchicalNameAccess > & xNameAccess,
488*b1cdbd2cSJim Jagielski bool bReturnEmptyRefForUnknownType )
489*b1cdbd2cSJim Jagielski {
490*b1cdbd2cSJim Jagielski typereg::Reader aReader(
491*b1cdbd2cSJim Jagielski rData.getConstArray(), rData.getLength(), false, TYPEREG_VERSION_1);
492*b1cdbd2cSJim Jagielski
493*b1cdbd2cSJim Jagielski OUString aName( aReader.getTypeName().replace( '/', '.' ) );
494*b1cdbd2cSJim Jagielski
495*b1cdbd2cSJim Jagielski switch (aReader.getTypeClass())
496*b1cdbd2cSJim Jagielski {
497*b1cdbd2cSJim Jagielski case RT_TYPE_INTERFACE:
498*b1cdbd2cSJim Jagielski {
499*b1cdbd2cSJim Jagielski sal_uInt16 n = aReader.getSuperTypeCount();
500*b1cdbd2cSJim Jagielski com::sun::star::uno::Sequence< rtl::OUString > aBaseTypeNames(n);
501*b1cdbd2cSJim Jagielski {for (sal_uInt16 i = 0; i < n; ++i) {
502*b1cdbd2cSJim Jagielski aBaseTypeNames[i] = aReader.getSuperTypeName(i).replace(
503*b1cdbd2cSJim Jagielski '/', '.');
504*b1cdbd2cSJim Jagielski }}
505*b1cdbd2cSJim Jagielski sal_uInt16 n2 = aReader.getReferenceCount();
506*b1cdbd2cSJim Jagielski com::sun::star::uno::Sequence< rtl::OUString >
507*b1cdbd2cSJim Jagielski aOptionalBaseTypeNames(n2);
508*b1cdbd2cSJim Jagielski {for (sal_uInt16 i = 0; i < n2; ++i) {
509*b1cdbd2cSJim Jagielski OSL_ASSERT(
510*b1cdbd2cSJim Jagielski aReader.getReferenceSort(i) == RT_REF_SUPPORTS
511*b1cdbd2cSJim Jagielski && aReader.getReferenceFlags(i) == RT_ACCESS_OPTIONAL);
512*b1cdbd2cSJim Jagielski aOptionalBaseTypeNames[i] = aReader.getReferenceTypeName(i);
513*b1cdbd2cSJim Jagielski }}
514*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
515*b1cdbd2cSJim Jagielski new InterfaceTypeDescriptionImpl( xNameAccess,
516*b1cdbd2cSJim Jagielski aName,
517*b1cdbd2cSJim Jagielski aBaseTypeNames,
518*b1cdbd2cSJim Jagielski aOptionalBaseTypeNames,
519*b1cdbd2cSJim Jagielski rData,
520*b1cdbd2cSJim Jagielski aReader.isPublished() ) );
521*b1cdbd2cSJim Jagielski }
522*b1cdbd2cSJim Jagielski
523*b1cdbd2cSJim Jagielski case RT_TYPE_MODULE:
524*b1cdbd2cSJim Jagielski {
525*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference<
526*b1cdbd2cSJim Jagielski XTypeDescriptionEnumerationAccess > xTDEA(
527*b1cdbd2cSJim Jagielski xNameAccess, UNO_QUERY );
528*b1cdbd2cSJim Jagielski
529*b1cdbd2cSJim Jagielski OSL_ENSURE( xTDEA.is(),
530*b1cdbd2cSJim Jagielski "No XTypeDescriptionEnumerationAccess!" );
531*b1cdbd2cSJim Jagielski
532*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
533*b1cdbd2cSJim Jagielski new ModuleTypeDescriptionImpl( xTDEA, aName ) );
534*b1cdbd2cSJim Jagielski }
535*b1cdbd2cSJim Jagielski
536*b1cdbd2cSJim Jagielski case RT_TYPE_STRUCT:
537*b1cdbd2cSJim Jagielski {
538*b1cdbd2cSJim Jagielski rtl::OUString superTypeName;
539*b1cdbd2cSJim Jagielski if (aReader.getSuperTypeCount() == 1) {
540*b1cdbd2cSJim Jagielski superTypeName = aReader.getSuperTypeName(0).replace(
541*b1cdbd2cSJim Jagielski '/', '.');
542*b1cdbd2cSJim Jagielski }
543*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
544*b1cdbd2cSJim Jagielski new stoc::registry_tdprovider::StructTypeDescription(
545*b1cdbd2cSJim Jagielski xNameAccess, aName, superTypeName, rData,
546*b1cdbd2cSJim Jagielski aReader.isPublished()));
547*b1cdbd2cSJim Jagielski }
548*b1cdbd2cSJim Jagielski
549*b1cdbd2cSJim Jagielski case RT_TYPE_ENUM:
550*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
551*b1cdbd2cSJim Jagielski new EnumTypeDescriptionImpl( xNameAccess,
552*b1cdbd2cSJim Jagielski aName,
553*b1cdbd2cSJim Jagielski getRTValueAsInt32(
554*b1cdbd2cSJim Jagielski aReader.getFieldValue( 0 ) ),
555*b1cdbd2cSJim Jagielski rData, aReader.isPublished() ) );
556*b1cdbd2cSJim Jagielski
557*b1cdbd2cSJim Jagielski case RT_TYPE_EXCEPTION:
558*b1cdbd2cSJim Jagielski {
559*b1cdbd2cSJim Jagielski rtl::OUString superTypeName;
560*b1cdbd2cSJim Jagielski if (aReader.getSuperTypeCount() == 1) {
561*b1cdbd2cSJim Jagielski superTypeName = aReader.getSuperTypeName(0).replace(
562*b1cdbd2cSJim Jagielski '/', '.');
563*b1cdbd2cSJim Jagielski }
564*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
565*b1cdbd2cSJim Jagielski new CompoundTypeDescriptionImpl(
566*b1cdbd2cSJim Jagielski xNameAccess, TypeClass_EXCEPTION, aName, superTypeName,
567*b1cdbd2cSJim Jagielski rData, aReader.isPublished()));
568*b1cdbd2cSJim Jagielski }
569*b1cdbd2cSJim Jagielski
570*b1cdbd2cSJim Jagielski case RT_TYPE_TYPEDEF:
571*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
572*b1cdbd2cSJim Jagielski new TypedefTypeDescriptionImpl( xNameAccess,
573*b1cdbd2cSJim Jagielski aName,
574*b1cdbd2cSJim Jagielski aReader.getSuperTypeName(0)
575*b1cdbd2cSJim Jagielski .replace( '/', '.' ),
576*b1cdbd2cSJim Jagielski aReader.isPublished() ) );
577*b1cdbd2cSJim Jagielski case RT_TYPE_SERVICE:
578*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
579*b1cdbd2cSJim Jagielski new ServiceTypeDescriptionImpl(
580*b1cdbd2cSJim Jagielski xNameAccess, aName, rData, aReader.isPublished() ) );
581*b1cdbd2cSJim Jagielski
582*b1cdbd2cSJim Jagielski case RT_TYPE_CONSTANTS:
583*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
584*b1cdbd2cSJim Jagielski new ConstantsTypeDescriptionImpl(
585*b1cdbd2cSJim Jagielski aName, rData, aReader.isPublished() ) );
586*b1cdbd2cSJim Jagielski
587*b1cdbd2cSJim Jagielski case RT_TYPE_SINGLETON:
588*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
589*b1cdbd2cSJim Jagielski new SingletonTypeDescriptionImpl( xNameAccess,
590*b1cdbd2cSJim Jagielski aName,
591*b1cdbd2cSJim Jagielski aReader.getSuperTypeName(0)
592*b1cdbd2cSJim Jagielski .replace( '/', '.' ),
593*b1cdbd2cSJim Jagielski aReader.isPublished() ) );
594*b1cdbd2cSJim Jagielski case RT_TYPE_INVALID:
595*b1cdbd2cSJim Jagielski case RT_TYPE_OBJECT: // deprecated and not used
596*b1cdbd2cSJim Jagielski case RT_TYPE_UNION: // deprecated and not used
597*b1cdbd2cSJim Jagielski OSL_ENSURE( sal_False, "createTypeDescription - Unsupported Type!" );
598*b1cdbd2cSJim Jagielski break;
599*b1cdbd2cSJim Jagielski
600*b1cdbd2cSJim Jagielski default:
601*b1cdbd2cSJim Jagielski OSL_ENSURE( sal_False, "createTypeDescription - Unknown Type!" );
602*b1cdbd2cSJim Jagielski break;
603*b1cdbd2cSJim Jagielski }
604*b1cdbd2cSJim Jagielski
605*b1cdbd2cSJim Jagielski // Unknown type.
606*b1cdbd2cSJim Jagielski
607*b1cdbd2cSJim Jagielski if ( bReturnEmptyRefForUnknownType )
608*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >();
609*b1cdbd2cSJim Jagielski
610*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XTypeDescription >(
611*b1cdbd2cSJim Jagielski new TypeDescriptionImpl( TypeClass_UNKNOWN, aName ) );
612*b1cdbd2cSJim Jagielski }
613*b1cdbd2cSJim Jagielski
614*b1cdbd2cSJim Jagielski }
615*b1cdbd2cSJim Jagielski
616*b1cdbd2cSJim Jagielski namespace stoc_bootstrap
617*b1cdbd2cSJim Jagielski {
618*b1cdbd2cSJim Jagielski //==================================================================================================
ProviderImpl_create(com::sun::star::uno::Reference<XComponentContext> const & xContext)619*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XInterface > SAL_CALL ProviderImpl_create(
620*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< XComponentContext > const & xContext )
621*b1cdbd2cSJim Jagielski throw(::com::sun::star::uno::Exception)
622*b1cdbd2cSJim Jagielski {
623*b1cdbd2cSJim Jagielski return com::sun::star::uno::Reference< XInterface >( *new stoc_rdbtdp::ProviderImpl( xContext ) );
624*b1cdbd2cSJim Jagielski }
625*b1cdbd2cSJim Jagielski }
626