diff options
Diffstat (limited to 'framework')
21 files changed, 119 insertions, 132 deletions
diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx index be029dd46667..39c32b3584ec 100644 --- a/framework/source/accelerators/documentacceleratorconfiguration.cxx +++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx @@ -68,8 +68,10 @@ public: reference to an uno service manager, which is used internaly. */ DocumentAcceleratorConfiguration( - const css::uno::Reference< css::uno::XComponentContext >& xContext, - const css::uno::Sequence< css::uno::Any >& lArguments); + 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); virtual ~DocumentAcceleratorConfiguration(); @@ -112,10 +114,13 @@ private: //----------------------------------------------- DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration( - const css::uno::Reference< css::uno::XComponentContext >& xContext, - const css::uno::Sequence< css::uno::Any >& lArguments) + const css::uno::Reference< css::uno::XComponentContext >& xContext) : 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; @@ -224,11 +229,12 @@ 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, - css::uno::Sequence<css::uno::Any> const &arguments) + cppu::constructor_InitializationFunc &init_func) { - rtl::Reference<DocumentAcceleratorConfiguration> x(new DocumentAcceleratorConfiguration(context, arguments)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + // 2nd phase initialization needed + init_func = static_cast<cppu::constructor_InitializationFunc>(&DocumentAcceleratorConfiguration::constructorInit); + + return static_cast<cppu::OWeakObject *>(new DocumentAcceleratorConfiguration(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/accelerators/globalacceleratorconfiguration.cxx b/framework/source/accelerators/globalacceleratorconfiguration.cxx index 261aa178ba55..697faaff35c7 100644 --- a/framework/source/accelerators/globalacceleratorconfiguration.cxx +++ b/framework/source/accelerators/globalacceleratorconfiguration.cxx @@ -81,7 +81,9 @@ public: // XComponent virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); - void impl_ts_fillCache(); + /// 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); private: @@ -96,7 +98,7 @@ GlobalAcceleratorConfiguration::GlobalAcceleratorConfiguration(const css::uno::R { } -void GlobalAcceleratorConfiguration::impl_ts_fillCache() +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) { /** read all data into the cache. */ @@ -148,12 +150,12 @@ 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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &init_func) { - rtl::Reference<GlobalAcceleratorConfiguration> x(new GlobalAcceleratorConfiguration(context)); - x->impl_ts_fillCache(); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + // 2nd phase initialization needed + init_func = static_cast<cppu::constructor_InitializationFunc>(&GlobalAcceleratorConfiguration::constructorInit); + + return static_cast<cppu::OWeakObject *>(new GlobalAcceleratorConfiguration(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/accelerators/moduleacceleratorconfiguration.cxx b/framework/source/accelerators/moduleacceleratorconfiguration.cxx index f19b91c291f2..731161615564 100644 --- a/framework/source/accelerators/moduleacceleratorconfiguration.cxx +++ b/framework/source/accelerators/moduleacceleratorconfiguration.cxx @@ -68,8 +68,7 @@ public: reference to an uno service manager, which is used internaly. */ ModuleAcceleratorConfiguration( - const css::uno::Reference< css::uno::XComponentContext >& xContext, - const css::uno::Sequence< css::uno::Any >& lArguments); + const css::uno::Reference< css::uno::XComponentContext >& xContext); /** TODO */ virtual ~ModuleAcceleratorConfiguration(); @@ -97,8 +96,9 @@ public: // XComponent virtual void SAL_CALL dispose() throw (css::uno::RuntimeException); - /** read all data into the cache. */ - void impl_ts_fillCache(); + /// 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); private: /** helper to listen for configuration changes without ownership cycle problems */ @@ -106,10 +106,17 @@ private: }; ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration( - const css::uno::Reference< css::uno::XComponentContext >& xContext, - const css::uno::Sequence< css::uno::Any >& lArguments) + const css::uno::Reference< css::uno::XComponentContext >& xContext) : 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; @@ -129,14 +136,7 @@ ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration( static_cast< ::cppu::OWeakObject* >(this)); aWriteLock.unlock(); -} -ModuleAcceleratorConfiguration::~ModuleAcceleratorConfiguration() -{ -} - -void ModuleAcceleratorConfiguration::impl_ts_fillCache() -{ // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); m_sModuleCFG = m_sModule; @@ -192,12 +192,12 @@ 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, - css::uno::Sequence<css::uno::Any> const &arguments) + cppu::constructor_InitializationFunc &init_func) { - rtl::Reference<ModuleAcceleratorConfiguration> x(new ModuleAcceleratorConfiguration(context, arguments)); - x->impl_ts_fillCache(); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + // 2nd phase initialization needed + init_func = static_cast<cppu::constructor_InitializationFunc>(&ModuleAcceleratorConfiguration::constructorInit); + + return static_cast<cppu::OWeakObject *>(new ModuleAcceleratorConfiguration(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index a81aacfe9440..17d2f7c785bc 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -606,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<framework::StatusIndicatorFactory> x(new framework::StatusIndicatorFactory(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 226bc95985dc..9da2198a5662 100644 --- a/framework/source/jobs/jobdispatch.cxx +++ b/framework/source/jobs/jobdispatch.cxx @@ -534,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<JobDispatch> x(new JobDispatch(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 05a0cfd3a9ac..8844ef4dd954 100644 --- a/framework/source/jobs/jobexecutor.cxx +++ b/framework/source/jobs/jobexecutor.cxx @@ -37,12 +37,11 @@ #include <com/sun/star/task/XJobExecutor.hpp> #include <com/sun/star/container/XContainerListener.hpp> #include <com/sun/star/lang/XEventListener.hpp> -#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/document/XEventListener.hpp> #include <com/sun/star/frame/XModuleManager2.hpp> -#include <cppuhelper/implbase5.hxx> +#include <cppuhelper/implbase4.hxx> #include <cppuhelper/supportsservice.hxx> #include <unotools/configpaths.hxx> #include <rtl/ref.hxx> @@ -60,10 +59,9 @@ namespace { liftime of such jobs too. */ class JobExecutor : private ThreadHelpBase - , public ::cppu::WeakImplHelper5< + , public ::cppu::WeakImplHelper4< css::lang::XServiceInfo , css::task::XJobExecutor - , css::lang::XInitialization , css::container::XContainerListener // => lang.XEventListener , css::document::XEventListener > { @@ -112,8 +110,8 @@ public: // task.XJobExecutor virtual void SAL_CALL trigger( const OUString& sEvent ) throw(css::uno::RuntimeException); - // XInitialization - virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::Exception, 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); // document.XEventListener virtual void SAL_CALL notifyEvent( const css::document::EventObject& aEvent ) throw(css::uno::RuntimeException); @@ -144,7 +142,7 @@ JobExecutor::JobExecutor( /*IN*/ const css::uno::Reference< css::uno::XComponent { } -void JobExecutor::initialize(const css::uno::Sequence< css::uno::Any >& ) throw (css::uno::Exception, css::uno::RuntimeException) +void JobExecutor::constructorInit(const css::uno::Sequence< css::uno::Any >& ) throw (css::uno::Exception, css::uno::RuntimeException) { // read the list of all currently registered events inside configuration. // e.g. "/org.openoffice.Office.Jobs/Events/<event name>" @@ -406,8 +404,11 @@ 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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &init_func) { + // 2nd phase initialization needed + init_func = static_cast<cppu::constructor_InitializationFunc>(&JobExecutor::constructorInit); + return static_cast<cppu::OWeakObject *>(new JobExecutor(context)); } diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index c3710c0c7b32..9f052a30d58e 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -3225,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<framework::LayoutManager> x(new framework::LayoutManager(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 badab99a40f3..0cd13705122b 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -65,7 +65,6 @@ #include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/awt/XWindow2.hpp> #include <com/sun/star/task/XStatusIndicatorFactory.hpp> -#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/frame/XDispatch.hpp> @@ -77,7 +76,7 @@ #include <comphelper/configurationhelper.hxx> #include <cppuhelper/exc_hlp.hxx> -#include <cppuhelper/implbase6.hxx> +#include <cppuhelper/implbase5.hxx> #include <cppuhelper/propshlp.hxx> #include <cppuhelper/supportsservice.hxx> #include <unotools/mediadescriptor.hxx> @@ -189,9 +188,8 @@ public: of documents - including features of an EmergencySave in case a GPF occurs. */ -typedef ::cppu::WeakImplHelper6< +typedef ::cppu::WeakImplHelper5< css::lang::XServiceInfo, - css::lang::XInitialization, css::frame::XDispatch, css::document::XEventListener, // => css.lang.XEventListener css::util::XChangesListener, // => css.lang.XEventListener @@ -542,12 +540,12 @@ public: { OWeakObject::release(); } 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); + // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException); - // XInitialization - virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::Exception, css::uno::RuntimeException); - //--------------------------------------- // css.frame.XDispatch virtual void SAL_CALL dispatch(const css::util::URL& aURL , @@ -1420,7 +1418,7 @@ AutoRecovery::AutoRecovery(const css::uno::Reference< css::uno::XComponentContex { } -void AutoRecovery::initialize(const css::uno::Sequence< css::uno::Any >& ) throw (css::uno::Exception, css::uno::RuntimeException) +void AutoRecovery::constructorInit(const css::uno::Sequence< css::uno::Any >& ) throw (css::uno::Exception, css::uno::RuntimeException) { // read configuration to know if autosave/recovery is on/off etcpp... implts_readConfig(); @@ -4636,8 +4634,11 @@ 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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &init_func) { + // 2nd phase initialization needed + init_func = static_cast<cppu::constructor_InitializationFunc>(&AutoRecovery::constructorInit); + return static_cast<cppu::OWeakObject *>(new AutoRecovery(context)); } diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 590d4116df25..230707cea74b 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -153,7 +153,8 @@ public: Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~Frame(); - void onCreate(); + /// 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); FWK_DECLARE_XINTERFACE FWK_DECLARE_XTYPEPROVIDER @@ -584,7 +585,7 @@ Frame::Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext { } -void Frame::onCreate() +void Frame::constructorInit(const css::uno::Sequence< css::uno::Any >&) throw (css::uno::Exception, css::uno::RuntimeException) { css::uno::Reference< css::uno::XInterface > xThis(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY_THROW); @@ -3583,12 +3584,12 @@ 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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &init_func) { - rtl::Reference<Frame> x(new Frame(context)); - x->onCreate(); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + // 2nd phase initialization needed + init_func = static_cast<cppu::constructor_InitializationFunc>(&Frame::constructorInit); + + return static_cast<cppu::OWeakObject *>(new Frame(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx index 1815c269879f..c2c5d9e71a0d 100644 --- a/framework/source/services/modulemanager.cxx +++ b/framework/source/services/modulemanager.cxx @@ -492,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<ModuleManager> x(new ModuleManager(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 3aae564236df..f108e8d54cc4 100644 --- a/framework/source/services/tabwindowservice.cxx +++ b/framework/source/services/tabwindowservice.cxx @@ -96,7 +96,8 @@ public: TabWindowService(); virtual ~TabWindowService(); - void onCreate(); + /// 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); FWK_DECLARE_XINTERFACE FWK_DECLARE_XTYPEPROVIDER @@ -228,7 +229,7 @@ TabWindowService::TabWindowService() { } -void TabWindowService::onCreate() +void TabWindowService::constructorInit(const css::uno::Sequence< css::uno::Any >&) throw (css::uno::Exception, css::uno::RuntimeException) { impl_initializePropInfo(); m_aTransactionManager.setWorkingMode( E_WORK ); @@ -583,12 +584,12 @@ 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 *, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &init_func) { - rtl::Reference<TabWindowService> x(new TabWindowService); - x->onCreate(); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + // 2nd phase initialization needed + init_func = static_cast<cppu::constructor_InitializationFunc>(&TabWindowService::constructorInit); + + return static_cast<cppu::OWeakObject *>(new TabWindowService); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx index d8aaacf321e1..cf5e24720a9a 100644 --- a/framework/source/services/urltransformer.cxx +++ b/framework/source/services/urltransformer.cxx @@ -337,11 +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 *, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<URLTransformer> x(new URLTransformer()); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new URLTransformer()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uiconfiguration/imagemanager.cxx b/framework/source/uiconfiguration/imagemanager.cxx index 4d08b66a59cc..3ceecda48c37 100644 --- a/framework/source/uiconfiguration/imagemanager.cxx +++ b/framework/source/uiconfiguration/imagemanager.cxx @@ -210,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<framework::ImageManager> x(new framework::ImageManager(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 6d8104cbffef..69c3963c4731 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -72,8 +72,10 @@ class ModuleUIConfigurationManager : private ThreadHelpBase, // Struct for rig { public: ModuleUIConfigurationManager( - const css::uno::Reference< css::uno::XComponentContext >& xServiceManager, - const css::uno::Sequence< css::uno::Any >& aArguments ); + 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); virtual ~ModuleUIConfigurationManager(); @@ -845,8 +847,7 @@ void ModuleUIConfigurationManager::impl_Initialize() } ModuleUIConfigurationManager::ModuleUIConfigurationManager( - const Reference< XComponentContext >& xContext, - const Sequence< Any >& aArguments ) + const Reference< XComponentContext >& xContext) : ThreadHelpBase( &Application::GetSolarMutex() ) , m_xDefaultConfigStorage( 0 ) , m_xUserConfigStorage( 0 ) @@ -867,7 +868,10 @@ 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)) @@ -1711,11 +1715,12 @@ 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, - css::uno::Sequence<css::uno::Any> const &arguments) + cppu::constructor_InitializationFunc &init_func) { - rtl::Reference<ModuleUIConfigurationManager> x(new ModuleUIConfigurationManager(context, arguments)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + // 2nd phase initialization needed + init_func = static_cast<cppu::constructor_InitializationFunc>(&ModuleUIConfigurationManager::constructorInit); + + return static_cast<cppu::OWeakObject *>(new ModuleUIConfigurationManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index faa529ee9493..7f79fb04ec29 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -1430,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<UIConfigurationManager> x(new UIConfigurationManager(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 a3846d46bcf9..2a187e28205c 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -461,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<ControlMenuController> x(new ControlMenuController(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 f51ce75f0aa3..a463ce2a063e 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -366,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<LangSelectionStatusbarController> x(new LangSelectionStatusbarController(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 de84009e1f67..ea19f0bf5ae4 100644 --- a/framework/source/uielement/objectmenucontroller.cxx +++ b/framework/source/uielement/objectmenucontroller.cxx @@ -176,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<ObjectMenuController> x(new ObjectMenuController(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 a4b3ab2573c4..0301a9504d60 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -580,29 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<WizardsToolbarController> x(new WizardsToolbarController(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<OpenToolbarController> x(new OpenToolbarController(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<NewToolbarController> x(new NewToolbarController(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new NewToolbarController(context)); } diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 91340111778d..84753c18dbe5 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -424,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<RecentFilesMenuController> x(new RecentFilesMenuController(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(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 992dfb630bc9..8d965e5ffe24 100644 --- a/framework/source/uifactory/addonstoolboxfactory.cxx +++ b/framework/source/uifactory/addonstoolboxfactory.cxx @@ -232,11 +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, - css::uno::Sequence<css::uno::Any> const &) + cppu::constructor_InitializationFunc &) { - rtl::Reference<AddonsToolBoxFactory> x(new AddonsToolBoxFactory(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new AddonsToolBoxFactory(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |