diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-23 14:14:41 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-23 23:39:03 +0100 |
commit | c9e52cffff6cfa8724b4f6b2c31118166bf51eda (patch) | |
tree | f2f04aacbd5a02da711c81d330ac97ddf87b1ab4 /toolkit | |
parent | 08d10512b4c67ab0a90d7985dc22cc681094393c (diff) |
tk: Constructor feature for AsyncCallback.
Change-Id: I8be86768e3a9cbe11282e9caeb0f31141d2590e6
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/asynccallback.cxx | 70 | ||||
-rw-r--r-- | toolkit/source/helper/registerservices.cxx | 7 | ||||
-rw-r--r-- | toolkit/util/tk.component | 3 |
3 files changed, 13 insertions, 67 deletions
diff --git a/toolkit/source/awt/asynccallback.cxx b/toolkit/source/awt/asynccallback.cxx index 8d041643508e..6b61543ff9b0 100644 --- a/toolkit/source/awt/asynccallback.cxx +++ b/toolkit/source/awt/asynccallback.cxx @@ -28,19 +28,6 @@ #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/awt/XRequestCallback.hpp" - -// component helper namespace -namespace comp_AsyncCallback { - -// component and service helper functions: -OUString SAL_CALL _getImplementationName(); -css::uno::Sequence< OUString > SAL_CALL _getSupportedServiceNames(); -css::uno::Reference< css::uno::XInterface > SAL_CALL _create( css::uno::Reference< css::uno::XComponentContext > const & context ); - -} // closing component helper namespace - - - /// anonymous implementation namespace namespace { @@ -50,7 +37,7 @@ class AsyncCallback: css::awt::XRequestCallback> { public: - explicit AsyncCallback(css::uno::Reference< css::uno::XComponentContext > const & context); + AsyncCallback() {} // ::com::sun::star::lang::XServiceInfo: virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException); @@ -77,18 +64,12 @@ private: void operator =(AsyncCallback &); // not defined virtual ~AsyncCallback() {} - - css::uno::Reference< css::uno::XComponentContext > m_xContext; }; -AsyncCallback::AsyncCallback(css::uno::Reference< css::uno::XComponentContext > const & context) : - m_xContext(context) -{} - // com.sun.star.uno.XServiceInfo: OUString SAL_CALL AsyncCallback::getImplementationName() throw (css::uno::RuntimeException) { - return comp_AsyncCallback::_getImplementationName(); + return OUString("com.sun.star.awt.comp.AsyncCallback"); } ::sal_Bool SAL_CALL AsyncCallback::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException) @@ -98,7 +79,9 @@ OUString SAL_CALL AsyncCallback::getImplementationName() throw (css::uno::Runtim css::uno::Sequence< OUString > SAL_CALL AsyncCallback::getSupportedServiceNames() throw (css::uno::RuntimeException) { - return comp_AsyncCallback::_getSupportedServiceNames(); + css::uno::Sequence< OUString > s(1); + s[0] = "com.sun.star.awt.AsyncCallback"; + return s; } // ::com::sun::star::awt::XRequestCallback: @@ -133,45 +116,12 @@ IMPL_STATIC_LINK_NOINSTANCE( AsyncCallback, Notify_Impl, CallbackData*, pCallbac } // closing anonymous implementation namespace - - -// component helper namespace -namespace comp_AsyncCallback { - -OUString SAL_CALL _getImplementationName() { - return OUString("com.sun.star.awt.comp.AsyncCallback"); -} - -css::uno::Sequence< OUString > SAL_CALL _getSupportedServiceNames() -{ - css::uno::Sequence< OUString > s(1); - s[0] = "com.sun.star.awt.AsyncCallback"; - return s; -} - -css::uno::Reference< css::uno::XInterface > SAL_CALL _create( - const css::uno::Reference< css::uno::XComponentContext > & context) - SAL_THROW((css::uno::Exception)) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_awt_comp_AsyncCallback_get_implementation( + css::uno::XComponentContext *, + css::uno::Sequence<css::uno::Any> const &) { - return static_cast< ::cppu::OWeakObject * >(new AsyncCallback(context)); + return cppu::acquire(new AsyncCallback()); } -} // closing component helper namespace - -static ::cppu::ImplementationEntry const entries[] = { - { &comp_AsyncCallback::_create, - &comp_AsyncCallback::_getImplementationName, - &comp_AsyncCallback::_getSupportedServiceNames, - &::cppu::createSingleComponentFactory, 0, 0 }, - { 0, 0, 0, 0, 0, 0 } -}; - -void * SAL_CALL comp_AsyncCallback_component_getFactory( - const char * implName, void * serviceManager, void * registryKey) -{ - return ::cppu::component_getFactoryHelper( - implName, serviceManager, registryKey, entries); -} - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index 0bbecd76ac36..b22f78d9f4f0 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -181,12 +181,10 @@ extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridColumn_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SortableGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); -extern void * SAL_CALL comp_AsyncCallback_component_getFactory( const char * implName, void * serviceManager, void * registryKey ); - extern "C" { -TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) +TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* ) { void* pRet = NULL; @@ -267,9 +265,6 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImple GET_FACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL ); GET_FACTORY_WITH_IMPL_PREFIX( GridColumn, "org.openoffice.comp.toolkit", szServiceName_GridColumn, NULL ); GET_FACTORY_WITH_IMPL_PREFIX( SortableGridDataModel, "org.openoffice.comp.toolkit", szServiceName_SortableGridDataModel, NULL ); - - if ( rtl_str_compare( sImplementationName, "com.sun.star.awt.comp.AsyncCallback" ) == 0 ) - return comp_AsyncCallback_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey ); } return pRet; } diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component index 1abea8c5a524..f63d3fa4be50 100644 --- a/toolkit/util/tk.component +++ b/toolkit/util/tk.component @@ -19,7 +19,8 @@ <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" prefix="tk" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.awt.comp.AsyncCallback"> + <implementation name="com.sun.star.awt.comp.AsyncCallback" + constructor="com_sun_star_awt_comp_AsyncCallback_get_implementation"> <service name="com.sun.star.awt.AsyncCallback"/> </implementation> <implementation name="com.sun.star.comp.awt.Layout"> |