diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-12-19 08:48:56 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-12-19 08:48:56 +0100 |
commit | ae3a0c8da50b36db395984637f5ad74d3b4887bc (patch) | |
tree | c4936b9fba1f24d412d41474ebef44a5f094dbc8 /stoc/source/defaultregistry | |
parent | 80d977b896904a0261d32857469c1b3e7516ca1e (diff) |
Add .component <implementation constructor="..." feature
...to directly call constructor functions of ComponentContext-based C++
implementations of (non-single-instance) UNO services. The case where these
calls would need to be bridged across different environments (e.g., from gcc3
to gcc3:affine) is not yet implemented.
bootstrap.component and expwrap.component are adapted accordingly as a proof-of-
concept (which had previously been adapted to use the prefix="direct" feature,
which may become unnecessary again in the end, depending on how to handle
single-instance services/singletons). More to follow.
Change-Id: I18682d75bcd29d3d427e31331b4ce8161dbb846d
Diffstat (limited to 'stoc/source/defaultregistry')
-rw-r--r-- | stoc/source/defaultregistry/defaultregistry.cxx | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx index 7074683c1906..285e379d114e 100644 --- a/stoc/source/defaultregistry/defaultregistry.cxx +++ b/stoc/source/defaultregistry/defaultregistry.cxx @@ -21,7 +21,6 @@ #include <osl/diagnose.h> #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/weak.hxx> -#include <cppuhelper/factory.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase4.hxx> #include <cppuhelper/implbase3.hxx> @@ -44,13 +43,6 @@ using namespace com::sun::star::container; using namespace cppu; using namespace osl; -static Sequence< OUString > NestedRegistryImpl_getSupportedServiceNames() -{ - Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString("com.sun.star.registry.NestedRegistry"); - return seqNames; -} - namespace { class NestedKeyImpl; @@ -1207,7 +1199,9 @@ sal_Bool SAL_CALL NestedRegistryImpl::supportsService( const OUString& ServiceNa Sequence<OUString> SAL_CALL NestedRegistryImpl::getSupportedServiceNames( ) throw(RuntimeException) { - return NestedRegistryImpl_getSupportedServiceNames(); + Sequence< OUString > seqNames(1); + seqNames[0] = "com.sun.star.registry.NestedRegistry"; + return seqNames; } //************************************************************************* @@ -1355,32 +1349,16 @@ void SAL_CALL NestedRegistryImpl::mergeKey( const OUString& aKeyName, const OUSt } // namespace -static Reference<XInterface> NestedRegistry_CreateInstance( - SAL_UNUSED_PARAMETER const Reference<XComponentContext>& ) - throw(Exception) -{ - Reference<XInterface> xRet; - XSimpleRegistry *pRegistry = (XSimpleRegistry*) new NestedRegistryImpl; - - if (pRegistry) - { - xRet = Reference<XInterface>::query(pRegistry); - } - - return xRet; -} - -extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL -com_sun_star_comp_stoc_NestedRegistry_component_getFactory( - const char * , void * , void * ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_stoc_NestedRegistry( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) { - Reference< XSingleComponentFactory > xFactory; - xFactory = createSingleComponentFactory( - NestedRegistry_CreateInstance, - "com.sun.star.comp.stoc.NestedRegistry", - NestedRegistryImpl_getSupportedServiceNames() ); - xFactory->acquire(); - return xFactory.get(); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new NestedRegistryImpl)); + x->acquire(); + return x.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |