diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-01-22 11:54:19 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-01-22 15:09:28 +0100 |
commit | c2c530da69152ff9192b9726aa95961803ce9b29 (patch) | |
tree | 15e514573f35d9f376520fc2c015634dc4ee8c25 /framework | |
parent | 219a2939c9f58690356b2a3f64c580a0865fdc64 (diff) |
Introduce static inline cppu::acquire(), and make use of that.
This is much better approach compared to the callback function, as it allows
passing arguments to the c++ constructor directly, while still allowing some
additional initialization after having acquired the instance.
Change-Id: I5a0f981915dd58f1522ee6054e53a3550b29d624
Diffstat (limited to 'framework')
21 files changed, 105 insertions, 112 deletions
diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx index 39c32b3584ec..8019e81e5694 100644 --- a/framework/source/accelerators/documentacceleratorconfiguration.cxx +++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx @@ -68,10 +68,8 @@ public: reference to an uno service manager, which is used internaly. */ DocumentAcceleratorConfiguration( - const css::uno::Reference< css::uno::XComponentContext >& xContext); - - void SAL_CALL constructorInit(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments) - throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Sequence< css::uno::Any >& lArguments); virtual ~DocumentAcceleratorConfiguration(); @@ -114,13 +112,10 @@ private: //----------------------------------------------- DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration( - const css::uno::Reference< css::uno::XComponentContext >& xContext) + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& lArguments) : DocumentAcceleratorConfiguration_BASE(xContext) { -} - -void DocumentAcceleratorConfiguration::constructorInit(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& lArguments) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) -{ WriteGuard aWriteLock(m_aLock); css::uno::Reference<css::embed::XStorage> xRoot; @@ -229,12 +224,9 @@ void DocumentAcceleratorConfiguration::impl_ts_clearCache() extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_DocumentAcceleratorConfiguration_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &init_func) + css::uno::Sequence<css::uno::Any> const &arguments) { - // 2nd phase initialization needed - init_func = static_cast<cppu::constructor_InitializationFunc>(&DocumentAcceleratorConfiguration::constructorInit); - - return static_cast<cppu::OWeakObject *>(new DocumentAcceleratorConfiguration(context)); + return cppu::acquire(new DocumentAcceleratorConfiguration(context, arguments)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/accelerators/globalacceleratorconfiguration.cxx b/framework/source/accelerators/globalacceleratorconfiguration.cxx index 697faaff35c7..3b809ee9e274 100644 --- a/framework/source/accelerators/globalacceleratorconfiguration.cxx +++ b/framework/source/accelerators/globalacceleratorconfiguration.cxx @@ -81,9 +81,8 @@ public: // XComponent virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); - /// Initialization function after having acquire()'d. - void SAL_CALL constructorInit(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >&) - throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + /// This has to be called after when the instance is acquire()'d. + void fillCache(); private: @@ -98,7 +97,7 @@ GlobalAcceleratorConfiguration::GlobalAcceleratorConfiguration(const css::uno::R { } -void GlobalAcceleratorConfiguration::constructorInit(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >&) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) +void GlobalAcceleratorConfiguration::fillCache() { /** read all data into the cache. */ @@ -150,12 +149,14 @@ void SAL_CALL GlobalAcceleratorConfiguration::dispose() extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_GlobalAcceleratorConfiguration_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &init_func) + css::uno::Sequence<css::uno::Any> const &) { - // 2nd phase initialization needed - init_func = static_cast<cppu::constructor_InitializationFunc>(&GlobalAcceleratorConfiguration::constructorInit); + GlobalAcceleratorConfiguration *inst = new GlobalAcceleratorConfiguration(context); + css::uno::XInterface *acquired_inst = cppu::acquire(inst); - return static_cast<cppu::OWeakObject *>(new GlobalAcceleratorConfiguration(context)); + inst->fillCache(); + + return acquired_inst; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/accelerators/moduleacceleratorconfiguration.cxx b/framework/source/accelerators/moduleacceleratorconfiguration.cxx index 731161615564..7648c2792b1a 100644 --- a/framework/source/accelerators/moduleacceleratorconfiguration.cxx +++ b/framework/source/accelerators/moduleacceleratorconfiguration.cxx @@ -68,7 +68,8 @@ public: reference to an uno service manager, which is used internaly. */ ModuleAcceleratorConfiguration( - const css::uno::Reference< css::uno::XComponentContext >& xContext); + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& lArguments); /** TODO */ virtual ~ModuleAcceleratorConfiguration(); @@ -96,9 +97,8 @@ public: // XComponent virtual void SAL_CALL dispose() throw (css::uno::RuntimeException); - /// Initialization function after having acquire()'d. - void SAL_CALL constructorInit(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >&) - throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + /// This has to be called after when the instance is acquire()'d. + void SAL_CALL fillCache(); private: /** helper to listen for configuration changes without ownership cycle problems */ @@ -106,17 +106,10 @@ private: }; ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration( - const css::uno::Reference< css::uno::XComponentContext >& xContext) + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& lArguments) : ModuleAcceleratorConfiguration_BASE(xContext) { -} - -ModuleAcceleratorConfiguration::~ModuleAcceleratorConfiguration() -{ -} - -void ModuleAcceleratorConfiguration::constructorInit(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& lArguments) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) -{ WriteGuard aWriteLock(m_aLock); OUString sModule; @@ -136,7 +129,14 @@ void ModuleAcceleratorConfiguration::constructorInit(const ::com::sun::star::uno static_cast< ::cppu::OWeakObject* >(this)); aWriteLock.unlock(); +} +ModuleAcceleratorConfiguration::~ModuleAcceleratorConfiguration() +{ +} + +void ModuleAcceleratorConfiguration::fillCache() +{ // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); m_sModuleCFG = m_sModule; @@ -192,12 +192,14 @@ void SAL_CALL ModuleAcceleratorConfiguration::dispose() extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_ModuleAcceleratorConfiguration_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &init_func) + css::uno::Sequence<css::uno::Any> const &arguments) { - // 2nd phase initialization needed - init_func = static_cast<cppu::constructor_InitializationFunc>(&ModuleAcceleratorConfiguration::constructorInit); + ModuleAcceleratorConfiguration *inst = new ModuleAcceleratorConfiguration(context, arguments); + css::uno::XInterface *acquired_inst = cppu::acquire(inst); + + inst->fillCache(); - return static_cast<cppu::OWeakObject *>(new ModuleAcceleratorConfiguration(context)); + return acquired_inst; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index 17d2f7c785bc..61dc16df16df 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -606,9 +606,9 @@ void StatusIndicatorFactory::impl_stopWakeUpThread() extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new framework::StatusIndicatorFactory(context)); + return cppu::acquire(new framework::StatusIndicatorFactory(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/jobs/jobdispatch.cxx b/framework/source/jobs/jobdispatch.cxx index 9da2198a5662..4cda0c03b20d 100644 --- a/framework/source/jobs/jobdispatch.cxx +++ b/framework/source/jobs/jobdispatch.cxx @@ -534,9 +534,9 @@ void SAL_CALL JobDispatch::removeStatusListener( /*IN*/ const css::uno::Referenc extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_jobs_JobDispatch_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new JobDispatch(context)); + return cppu::acquire(new JobDispatch(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx index 8844ef4dd954..7c8b7961ab26 100644 --- a/framework/source/jobs/jobexecutor.cxx +++ b/framework/source/jobs/jobexecutor.cxx @@ -111,7 +111,7 @@ public: virtual void SAL_CALL trigger( const OUString& sEvent ) throw(css::uno::RuntimeException); /// Initialization function after having acquire()'d. - void SAL_CALL constructorInit( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::Exception, css::uno::RuntimeException); + void initListeners(); // document.XEventListener virtual void SAL_CALL notifyEvent( const css::document::EventObject& aEvent ) throw(css::uno::RuntimeException); @@ -123,8 +123,6 @@ public: // lang.XEventListener virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw(css::uno::RuntimeException); - - void onCreate(); }; /** @@ -142,7 +140,7 @@ JobExecutor::JobExecutor( /*IN*/ const css::uno::Reference< css::uno::XComponent { } -void JobExecutor::constructorInit(const css::uno::Sequence< css::uno::Any >& ) throw (css::uno::Exception, css::uno::RuntimeException) +void JobExecutor::initListeners() { // read the list of all currently registered events inside configuration. // e.g. "/org.openoffice.Office.Jobs/Events/<event name>" @@ -404,12 +402,14 @@ void SAL_CALL JobExecutor::disposing( const css::lang::EventObject& aEvent ) thr extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_JobExecutor_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &init_func) + css::uno::Sequence<css::uno::Any> const &) { - // 2nd phase initialization needed - init_func = static_cast<cppu::constructor_InitializationFunc>(&JobExecutor::constructorInit); + JobExecutor *inst = new JobExecutor(context); + css::uno::XInterface *acquired_inst = cppu::acquire(inst); + + inst->initListeners(); - return static_cast<cppu::OWeakObject *>(new JobExecutor(context)); + return acquired_inst; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 9f052a30d58e..bca54870731f 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -3225,9 +3225,9 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL LayoutManager::getPropertySet extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_LayoutManager_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new framework::LayoutManager(context)); + return cppu::acquire(new framework::LayoutManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 0cd13705122b..c83cdfbd7b2d 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -541,7 +541,7 @@ public: virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& type) throw ( css::uno::RuntimeException ); /// Initialization function after having acquire()'d. - void SAL_CALL constructorInit( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::Exception, css::uno::RuntimeException); + void initListeners(); // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException); @@ -1418,7 +1418,7 @@ AutoRecovery::AutoRecovery(const css::uno::Reference< css::uno::XComponentContex { } -void AutoRecovery::constructorInit(const css::uno::Sequence< css::uno::Any >& ) throw (css::uno::Exception, css::uno::RuntimeException) +void AutoRecovery::initListeners() { // read configuration to know if autosave/recovery is on/off etcpp... implts_readConfig(); @@ -4634,12 +4634,14 @@ void AutoRecovery::st_impl_removeLockFile() extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_AutoRecovery_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &init_func) + css::uno::Sequence<css::uno::Any> const &) { - // 2nd phase initialization needed - init_func = static_cast<cppu::constructor_InitializationFunc>(&AutoRecovery::constructorInit); + AutoRecovery *inst = new AutoRecovery(context); + css::uno::XInterface *acquired_inst = cppu::acquire(inst); - return static_cast<cppu::OWeakObject *>(new AutoRecovery(context)); + inst->initListeners(); + + return acquired_inst; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 4a47cdafcdaf..08642a5c7799 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -129,9 +129,7 @@ enum EActiveState @devstatus ready to use @threadsafe yes *//*-*************************************************************************************************************/ -class Frame : - public ::cppu::OWeakObject , // helper implements XInterface, XWeak - // interfaces +class Frame : // interfaces public css::lang::XTypeProvider , public css::lang::XServiceInfo , public css::frame::XFrame2 , @@ -147,7 +145,8 @@ class Frame : // Order is necessary for right initialization of this class! public ThreadHelpBase , public TransactionBase , - public PropertySetHelper // helper implements ThreadHelpbase, TransactionBase, XPropertySet, XPropertySetInfo + public PropertySetHelper , // helper implements ThreadHelpbase, TransactionBase, XPropertySet, XPropertySetInfo + public ::cppu::OWeakObject // helper implements XInterface, XWeak { public: @@ -155,7 +154,7 @@ public: virtual ~Frame(); /// Initialization function after having acquire()'d. - void SAL_CALL constructorInit( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::Exception, css::uno::RuntimeException); + void initListeners(); FWK_DECLARE_XINTERFACE FWK_DECLARE_XTYPEPROVIDER @@ -586,7 +585,7 @@ Frame::Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext { } -void Frame::constructorInit(const css::uno::Sequence< css::uno::Any >&) throw (css::uno::Exception, css::uno::RuntimeException) +void Frame::initListeners() { css::uno::Reference< css::uno::XInterface > xThis(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY_THROW); @@ -3585,12 +3584,14 @@ sal_Bool Frame::implcp_disposing( const css::lang::EventObject& aEvent ) extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_Frame_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &init_func) + css::uno::Sequence<css::uno::Any> const &) { - // 2nd phase initialization needed - init_func = static_cast<cppu::constructor_InitializationFunc>(&Frame::constructorInit); + Frame *inst = new Frame(context); + css::uno::XInterface *acquired_inst = cppu::acquire(inst); - return static_cast<cppu::OWeakObject *>(new Frame(context)); + inst->initListeners(); + + return acquired_inst; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx index c2c5d9e71a0d..84e1c9b25ac0 100644 --- a/framework/source/services/modulemanager.cxx +++ b/framework/source/services/modulemanager.cxx @@ -492,9 +492,9 @@ OUString ModuleManager::implts_identify(const css::uno::Reference< css::uno::XIn extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_ModuleManager_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new ModuleManager(context)); + return cppu::acquire(new ModuleManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx index f108e8d54cc4..2630ff951a4b 100644 --- a/framework/source/services/tabwindowservice.cxx +++ b/framework/source/services/tabwindowservice.cxx @@ -97,7 +97,7 @@ public: virtual ~TabWindowService(); /// Initialization function after having acquire()'d. - void SAL_CALL constructorInit( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::Exception, css::uno::RuntimeException); + void initProperties(); FWK_DECLARE_XINTERFACE FWK_DECLARE_XTYPEPROVIDER @@ -229,7 +229,7 @@ TabWindowService::TabWindowService() { } -void TabWindowService::constructorInit(const css::uno::Sequence< css::uno::Any >&) throw (css::uno::Exception, css::uno::RuntimeException) +void TabWindowService::initProperties() { impl_initializePropInfo(); m_aTransactionManager.setWorkingMode( E_WORK ); @@ -584,12 +584,14 @@ FwkTabWindow* TabWindowService::mem_TabWin () extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_TabWindowService_get_implementation( css::uno::XComponentContext *, - cppu::constructor_InitializationFunc &init_func) + css::uno::Sequence<css::uno::Any> const &) { - // 2nd phase initialization needed - init_func = static_cast<cppu::constructor_InitializationFunc>(&TabWindowService::constructorInit); + TabWindowService *inst = new TabWindowService; + css::uno::XInterface *acquired_inst = cppu::acquire(inst); - return static_cast<cppu::OWeakObject *>(new TabWindowService); + inst->initProperties(); + + return acquired_inst; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx index cf5e24720a9a..2716740aa69d 100644 --- a/framework/source/services/urltransformer.cxx +++ b/framework/source/services/urltransformer.cxx @@ -337,9 +337,9 @@ OUString SAL_CALL URLTransformer::getPresentation( const css::util::URL& aURL, extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_URLTransformer_get_implementation( css::uno::XComponentContext *, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new URLTransformer()); + return cppu::acquire(new URLTransformer()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uiconfiguration/imagemanager.cxx b/framework/source/uiconfiguration/imagemanager.cxx index 3ceecda48c37..8540e2400945 100644 --- a/framework/source/uiconfiguration/imagemanager.cxx +++ b/framework/source/uiconfiguration/imagemanager.cxx @@ -210,9 +210,9 @@ sal_Bool SAL_CALL ImageManager::isReadOnly() throw (::com::sun::star::uno::Runti extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_ImageManager_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new framework::ImageManager(context)); + return cppu::acquire(new framework::ImageManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 69c3963c4731..4279482c6e56 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -72,10 +72,8 @@ class ModuleUIConfigurationManager : private ThreadHelpBase, // Struct for rig { public: ModuleUIConfigurationManager( - const css::uno::Reference< css::uno::XComponentContext >& xServiceManager); - - /// Initialization function after having acquire()'d. - void SAL_CALL constructorInit( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::Exception, css::uno::RuntimeException); + const css::uno::Reference< css::uno::XComponentContext >& xServiceManager, + const css::uno::Sequence< css::uno::Any >& aArguments); virtual ~ModuleUIConfigurationManager(); @@ -847,7 +845,8 @@ void ModuleUIConfigurationManager::impl_Initialize() } ModuleUIConfigurationManager::ModuleUIConfigurationManager( - const Reference< XComponentContext >& xContext) + const Reference< XComponentContext >& xContext, + const css::uno::Sequence< css::uno::Any >& aArguments) : ThreadHelpBase( &Application::GetSolarMutex() ) , m_xDefaultConfigStorage( 0 ) , m_xUserConfigStorage( 0 ) @@ -868,10 +867,7 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager( // The following code depends on this! m_aUIElements[LAYER_DEFAULT].resize( ::com::sun::star::ui::UIElementType::COUNT ); m_aUIElements[LAYER_USERDEFINED].resize( ::com::sun::star::ui::UIElementType::COUNT ); -} -void ModuleUIConfigurationManager::constructorInit(const css::uno::Sequence< css::uno::Any >& aArguments) throw (css::uno::Exception, css::uno::RuntimeException) -{ ResetableGuard aLock( m_aLock ); if( aArguments.getLength() == 2 && (aArguments[0] >>= m_aModuleShortName) && (aArguments[1] >>= m_aModuleIdentifier)) @@ -1715,12 +1711,9 @@ void ModuleUIConfigurationManager::implts_notifyContainerListener( const ui::Con extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_ModuleUIConfigurationManager_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &init_func) + css::uno::Sequence<css::uno::Any> const &arguments) { - // 2nd phase initialization needed - init_func = static_cast<cppu::constructor_InitializationFunc>(&ModuleUIConfigurationManager::constructorInit); - - return static_cast<cppu::OWeakObject *>(new ModuleUIConfigurationManager(context)); + return cppu::acquire(new ModuleUIConfigurationManager(context, arguments)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index 7f79fb04ec29..29ccd8796137 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -1430,9 +1430,9 @@ void UIConfigurationManager::implts_notifyContainerListener( const Configuration extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_UIConfigurationManager_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new UIConfigurationManager(context)); + return cppu::acquire(new UIConfigurationManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index 2a187e28205c..3a542b334fdf 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -461,9 +461,9 @@ void SAL_CALL ControlMenuController::initialize( const Sequence< Any >& aArgumen extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_ControlMenuController_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new ControlMenuController(context)); + return cppu::acquire(new ControlMenuController(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx index a463ce2a063e..f06197afc9ab 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -366,9 +366,9 @@ throw ( RuntimeException ) extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_LangSelectionStatusbarController_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new LangSelectionStatusbarController(context)); + return cppu::acquire(new LangSelectionStatusbarController(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uielement/objectmenucontroller.cxx b/framework/source/uielement/objectmenucontroller.cxx index ea19f0bf5ae4..618171c1e785 100644 --- a/framework/source/uielement/objectmenucontroller.cxx +++ b/framework/source/uielement/objectmenucontroller.cxx @@ -176,9 +176,9 @@ void ObjectMenuController::impl_select(const Reference< XDispatch >& _xDispatch, extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_ObjectMenuController_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new ObjectMenuController(context)); + return cppu::acquire(new ObjectMenuController(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 0301a9504d60..c94edc5fed6b 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -580,23 +580,23 @@ void NewToolbarController::setItemImage( const OUString &rCommand ) extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL org_apache_openoffice_comp_framework_WizardsToolbarController_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new WizardsToolbarController(context)); + return cppu::acquire(new WizardsToolbarController(context)); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL org_apache_openoffice_comp_framework_OpenToolbarController_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new OpenToolbarController(context)); + return cppu::acquire(new OpenToolbarController(context)); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL org_apache_openoffice_comp_framework_NewToolbarController_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new NewToolbarController(context)); + return cppu::acquire(new NewToolbarController(context)); } diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 84753c18dbe5..99cd85781e64 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -424,9 +424,9 @@ IMPL_STATIC_LINK_NOINSTANCE( RecentFilesMenuController, ExecuteHdl_Impl, LoadRec extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_RecentFilesMenuController_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new RecentFilesMenuController(context)); + return cppu::acquire(new RecentFilesMenuController(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uifactory/addonstoolboxfactory.cxx b/framework/source/uifactory/addonstoolboxfactory.cxx index 8d965e5ffe24..ffdea9c8c570 100644 --- a/framework/source/uifactory/addonstoolboxfactory.cxx +++ b/framework/source/uifactory/addonstoolboxfactory.cxx @@ -232,9 +232,9 @@ throw ( ::com::sun::star::container::NoSuchElementException, extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_AddonsToolBarFactory_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence<css::uno::Any> const &) { - return static_cast<cppu::OWeakObject *>(new AddonsToolBoxFactory(context)); + return cppu::acquire(new AddonsToolBoxFactory(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |