[Libreoffice-commits] core.git: cppuhelper/source framework/source include/cppuhelper sax/source sfx2/source stoc/source svtools/source svx/source

Jan Holesovsky kendy at collabora.com
Wed Jan 22 06:51:34 PST 2014


 cppuhelper/source/servicemanager.cxx                               |   80 ++++------
 cppuhelper/source/servicemanager.hxx                               |    2 
 framework/source/accelerators/documentacceleratorconfiguration.cxx |   20 --
 framework/source/accelerators/globalacceleratorconfiguration.cxx   |   17 +-
 framework/source/accelerators/moduleacceleratorconfiguration.cxx   |   36 ++--
 framework/source/helper/statusindicatorfactory.cxx                 |    4 
 framework/source/jobs/jobdispatch.cxx                              |    4 
 framework/source/jobs/jobexecutor.cxx                              |   16 +-
 framework/source/layoutmanager/layoutmanager.cxx                   |    4 
 framework/source/services/autorecovery.cxx                         |   14 +
 framework/source/services/frame.cxx                                |   21 +-
 framework/source/services/modulemanager.cxx                        |    4 
 framework/source/services/tabwindowservice.cxx                     |   14 +
 framework/source/services/urltransformer.cxx                       |    4 
 framework/source/uiconfiguration/imagemanager.cxx                  |    4 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx  |   19 --
 framework/source/uiconfiguration/uiconfigurationmanager.cxx        |    4 
 framework/source/uielement/controlmenucontroller.cxx               |    4 
 framework/source/uielement/langselectionstatusbarcontroller.cxx    |    4 
 framework/source/uielement/objectmenucontroller.cxx                |    4 
 framework/source/uielement/popuptoolbarcontroller.cxx              |   12 -
 framework/source/uielement/recentfilesmenucontroller.cxx           |    4 
 framework/source/uifactory/addonstoolboxfactory.cxx                |    4 
 include/cppuhelper/weak.hxx                                        |   26 +--
 sax/source/expatwrap/sax_expat.cxx                                 |    4 
 sax/source/expatwrap/saxwriter.cxx                                 |    4 
 sax/source/fastparser/fastparser.cxx                               |    4 
 sfx2/source/appl/appbaslib.cxx                                     |    4 
 sfx2/source/appl/appdispatchprovider.cxx                           |   19 --
 sfx2/source/appl/macroloader.cxx                                   |   13 -
 sfx2/source/appl/shutdownicon.cxx                                  |    4 
 sfx2/source/appl/xpackcreator.cxx                                  |    4 
 sfx2/source/dialog/backingcomp.cxx                                 |    4 
 sfx2/source/doc/SfxDocumentMetaData.cxx                            |    8 -
 sfx2/source/doc/doctemplates.cxx                                   |    4 
 sfx2/source/doc/iframe.cxx                                         |   19 --
 sfx2/source/doc/ownsubfilterservice.cxx                            |   19 --
 sfx2/source/doc/plugin.cxx                                         |    4 
 sfx2/source/inc/macroloader.hxx                                    |    6 
 sfx2/source/notify/globalevents.cxx                                |    6 
 sfx2/source/view/frmload.cxx                                       |    4 
 stoc/source/defaultregistry/defaultregistry.cxx                    |    4 
 stoc/source/implementationregistration/implreg.cxx                 |    4 
 stoc/source/loader/dllcomponentloader.cxx                          |    4 
 stoc/source/security/access_controller.cxx                         |    4 
 stoc/source/security/file_policy.cxx                               |    4 
 stoc/source/servicemanager/servicemanager.cxx                      |   12 -
 stoc/source/simpleregistry/simpleregistry.cxx                      |    4 
 svtools/source/filter/SvFilterOptionsDialog.cxx                    |    4 
 svtools/source/graphic/graphicunofactory.cxx                       |   17 --
 svtools/source/graphic/provider.cxx                                |    4 
 svtools/source/graphic/renderer.cxx                                |    4 
 svtools/source/hatchwindow/documentcloser.cxx                      |   20 --
 svtools/source/hatchwindow/hatchwindowfactory.cxx                  |    4 
 svtools/source/uno/addrtempuno.cxx                                 |    6 
 svtools/source/uno/wizard/unowizard.cxx                            |    6 
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx              |    4 
 svx/source/sdr/primitive2d/primitivefactory2d.cxx                  |    4 
 svx/source/sidebar/PanelFactory.cxx                                |    4 
 svx/source/tbxctrls/tbunocontroller.cxx                            |    4 
 svx/source/tbxctrls/tbunosearchcontrollers.cxx                     |   28 +--
 svx/source/unodraw/UnoGraphicExporter.cxx                          |    4 
 svx/source/unodraw/recoveryui.cxx                                  |    4 
 svx/source/unodraw/unoctabl.cxx                                    |    4 
 svx/source/unodraw/unoshcol.cxx                                    |    4 
 svx/source/unogallery/unogalthemeprovider.cxx                      |    4 
 svx/source/xml/xmlgrhlp.cxx                                        |    8 -
 67 files changed, 274 insertions(+), 354 deletions(-)

New commits:
commit c2c530da69152ff9192b9726aa95961803ce9b29
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jan 22 11:54:19 2014 +0100

    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

diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 3d81b8b..e6c31fc 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -704,14 +704,11 @@ cppuhelper::ServiceManager::Data::Implementation::createInstance(
     if (info->singletons.empty()) {
         assert(!singletonRequest);
         if (constructor != 0) {
-            cppu::constructor_InitializationFunc init = NULL;
-            css::uno::Reference<css::uno::XInterface> inst(
-                (*constructor)(context.get(), init));
-            // call the initialization on the acquired instance
-            if (init)
-                (static_cast<OWeakObject*>(inst.get())->*init)(
-                        css::uno::Sequence<css::uno::Any>());
-            return inst;
+            // the interface is already acquired, don't acquire here
+            return css::uno::Reference<css::uno::XInterface>(
+                (*constructor)(context.get(),
+                    css::uno::Sequence<css::uno::Any>()),
+                SAL_NO_ACQUIRE);
         }
         if (factory1.is()) {
             return factory1->createInstanceWithContext(context);
@@ -727,13 +724,11 @@ cppuhelper::ServiceManager::Data::Implementation::createInstance(
             return singleton;
         }
         if (constructor != 0) {
-            cppu::constructor_InitializationFunc init = NULL;
+            // the interface is already acquired, don't acquire here
             singleton.set(
-                (*constructor)(context.get(), init));
-            // call the initialization on the acquired instance
-            if (init)
-                (static_cast<OWeakObject*>(singleton.get())->*init)(
-                        css::uno::Sequence<css::uno::Any>());
+                (*constructor)(context.get(),
+                    css::uno::Sequence<css::uno::Any>()),
+                SAL_NO_ACQUIRE);
         } else if (factory1.is()) {
             singleton = factory1->createInstanceWithContext(context);
         } else {
@@ -753,24 +748,18 @@ cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
     if (info->singletons.empty()) {
         assert(!singletonRequest);
         if (constructor != 0) {
-            cppu::constructor_InitializationFunc init = NULL;
+            // the interface is already acquired, don't acquire here
             css::uno::Reference<css::uno::XInterface> inst(
-                (*constructor)(context.get(), init));
-            // call the initialization on the acquired instance
-            if (init)
-                (static_cast<OWeakObject*>(inst.get())->*init)(
-                    arguments);
-            else {
-                // The service can implement XInitialization, and it is just
-                // too easy to do a mistake during conversion to the
-                // constructor-based initialization, and forget to add the
-                // above callback that would call it; so allow initialization
-                // through XInitialization still too.
-                css::uno::Reference<css::lang::XInitialization> xinit(
-                    inst, css::uno::UNO_QUERY);
-                if (xinit.is()) {
-                    xinit->initialize(arguments);
-                }
+                (*constructor)(context.get(), arguments), SAL_NO_ACQUIRE);
+
+            // HACK: The service can implement XInitialization too.
+            // It should be removed when converting to constructor-based
+            // initialization, but in case somebody forgets, be safe, and
+            // call it anyway for the moment.
+            css::uno::Reference<css::lang::XInitialization> xinit(
+                inst, css::uno::UNO_QUERY);
+            if (xinit.is()) {
+                xinit->initialize(arguments);
             }
             return inst;
         }
@@ -793,23 +782,18 @@ cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
             return singleton;
         }
         if (constructor != 0) {
-            cppu::constructor_InitializationFunc init = NULL;
-            singleton.set((*constructor)(context.get(), init));
-            // call the initialization on the acquired instance
-            if (init)
-                (static_cast<OWeakObject*>(singleton.get())->*init)(
-                    arguments);
-            else {
-                // The service can implement XInitialization, and it is just
-                // too easy to do a mistake during conversion to the
-                // constructor-based initialization, and forget to add the
-                // above callback that would call it; so allow initialization
-                // through XInitialization still too.
-                css::uno::Reference<css::lang::XInitialization> xinit(
-                    singleton, css::uno::UNO_QUERY);
-                if (xinit.is()) {
-                    xinit->initialize(arguments);
-                }
+            // the interface is already acquired, don't acquire here
+            singleton.set(
+                (*constructor)(context.get(), arguments), SAL_NO_ACQUIRE);
+
+            // HACK: The service can implement XInitialization too.
+            // It should be removed when converting to constructor-based
+            // initialization, but in case somebody forgets, be safe, and
+            // call it anyway for the moment.
+            css::uno::Reference<css::lang::XInitialization> xinit(
+                singleton, css::uno::UNO_QUERY);
+            if (xinit.is()) {
+                xinit->initialize(arguments);
             }
         } else if (factory1.is()) {
             singleton = factory1->createInstanceWithArgumentsAndContext(
diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx
index 2d29f58..b6e506b 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -45,7 +45,7 @@ namespace cppuhelper {
 extern "C" {
 
 typedef css::uno::XInterface * SAL_CALL ImplementationConstructorFn(
-    css::uno::XComponentContext *, cppu::constructor_InitializationFunc &);
+    css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &);
 
 }
 
diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx
index 39c32b3..8019e81 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 697faaf..3b809ee 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 7311616..7648c27 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 17d2f7c..61dc16d 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 9da2198..4cda0c0 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 8844ef4..7c8b796 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 9f052a3..bca5487 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 0cd1370..c83cdfb 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 4a47cda..08642a5 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 c2c5d9e..84e1c9b 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 f108e8d..2630ff9 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 cf5e247..2716740 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 3ceecda..8540e24 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 69c3963..4279482 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 7f79fb0..29ccd87 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 2a187e2..3a542b3 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 a463ce2..f06197a 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 ea19f0b..618171c 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 0301a95..c94edc5 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 84753c1..99cd857 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 8d965e5..ffdea9c 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: */
diff --git a/include/cppuhelper/weak.hxx b/include/cppuhelper/weak.hxx
index 0fefafc..cfae9fe 100644
--- a/include/cppuhelper/weak.hxx
+++ b/include/cppuhelper/weak.hxx
@@ -156,21 +156,25 @@ public:
         { return this; }
 };
 
-/** Function pointer declaration.
+/// @cond INTERNAL
+/** Convenience function for constructor-based service implementations.
 
-  2nd stage initialization using the service implementation pointer.
+    To be used like:
 
-  Some services have to be initialized after the object has been acquire()'d - so the
-  implementation has to provide function that does this 2nd stage initialization.
+    css::uno::XInterface * FOO_constructor_function(...) {
+        return cppu::acquire(new FOO(...));
+    }
 
-  Typically, this happens in framework/.
-
-  @param aArguments
-  Arguments the instance will use for its own initialization.
+    @param instance
+    Newly created instance that should be acquired.
 */
-
-typedef void (SAL_CALL OWeakObject::* constructor_InitializationFunc)(
-    const css::uno::Sequence< css::uno::Any >& aArguments);
+static inline ::com::sun::star::uno::XInterface * acquire(OWeakObject * instance)
+{
+    assert(instance != 0);
+    instance->acquire();
+    return instance;
+}
+/// @endcond
 
 }
 
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 3f2adc5..a5edfc5 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -1023,9 +1023,9 @@ void SaxExpatParser_Impl::callbackEndCDATA( void *pvThis )
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SaxExpatParser);
+    return cppu::acquire(new SaxExpatParser);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 2481952..b160141 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -1373,9 +1373,9 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_extensions_xml_sax_Writer_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SAXWriter);
+    return cppu::acquire(new SAXWriter);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index a97c786..a3e201c 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -1429,9 +1429,9 @@ bool FastSaxParser::hasNamespaceURL( const OUString& rPrefix ) const
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new FastSaxParser);
+    return cppu::acquire(new FastSaxParser);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx
index 39e768a..7d295cd 100644
--- a/sfx2/source/appl/appbaslib.cxx
+++ b/sfx2/source/appl/appbaslib.cxx
@@ -159,7 +159,7 @@ SfxBasicManagerHolder::LegacyPsswdBinaryLimitExceeded( Sequence< OUString >& sMo
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_sfx2_ApplicationDialogLibraryContainer_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
     SFX_APP()->GetBasicManager();
     return SFX_APP()->GetDialogContainer();
@@ -171,7 +171,7 @@ com_sun_star_comp_sfx2_ApplicationDialogLibraryContainer_get_implementation(
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_sfx2_ApplicationScriptLibraryContainer_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
     SFX_APP()->GetBasicManager();
     return SFX_APP()->GetBasicContainer();
diff --git a/sfx2/source/appl/appdispatchprovider.cxx b/sfx2/source/appl/appdispatchprovider.cxx
index 6aa197c..da2a6fd 100644
--- a/sfx2/source/appl/appdispatchprovider.cxx
+++ b/sfx2/source/appl/appdispatchprovider.cxx
@@ -62,11 +62,7 @@ class SfxAppDispatchProvider : public ::cppu::WeakImplHelper2< css::frame::XAppD
 {
     css::uno::WeakReference < css::frame::XFrame > m_xFrame;
 public:
-    SfxAppDispatchProvider()
-        throw (css::uno::Exception, css::uno::RuntimeException);
-
-    /// Initialization function after having acquire()'d.
-    void SAL_CALL constructorInit(const css::uno::Sequence< css::uno::Any >&)
+    SfxAppDispatchProvider(const css::uno::Sequence< css::uno::Any >&aArguments)
         throw (css::uno::Exception, css::uno::RuntimeException);
 
     virtual OUString SAL_CALL getImplementationName()
@@ -94,13 +90,9 @@ public:
         throw (css::uno::RuntimeException);
 };
 
-SfxAppDispatchProvider::SfxAppDispatchProvider()
+SfxAppDispatchProvider::SfxAppDispatchProvider(const css::uno::Sequence< css::uno::Any >& aArguments)
     throw (uno::Exception, uno::RuntimeException)
 {
-}
-
-void SfxAppDispatchProvider::constructorInit(const css::uno::Sequence< css::uno::Any >& aArguments) throw (css::uno::Exception, css::uno::RuntimeException)
-{
     Reference < XFrame > xFrame;
     if ( aArguments.getLength() )
     {
@@ -261,12 +253,9 @@ throw (uno::RuntimeException)
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_sfx2_AppDispatchProvider_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &init_func)
+    css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    // 2nd phase initialization needed
-    init_func = static_cast<cppu::constructor_InitializationFunc>(&SfxAppDispatchProvider::constructorInit);
-
-    return static_cast<cppu::OWeakObject *>(new SfxAppDispatchProvider());
+    return cppu::acquire(new SfxAppDispatchProvider(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx
index d485d68..9291e70 100644
--- a/sfx2/source/appl/macroloader.cxx
+++ b/sfx2/source/appl/macroloader.cxx
@@ -44,13 +44,9 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::util;
 
-SfxMacroLoader::SfxMacroLoader()
+SfxMacroLoader::SfxMacroLoader(const css::uno::Sequence< css::uno::Any >& aArguments)
     throw (css::uno::Exception, css::uno::RuntimeException)
 {
-}
-
-void SAL_CALL SfxMacroLoader::constructorInit(const css::uno::Sequence< css::uno::Any >& aArguments) throw (css::uno::Exception, css::uno::RuntimeException)
-{
     Reference < XFrame > xFrame;
     if ( aArguments.getLength() )
     {
@@ -343,12 +339,9 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, com::sun::star::uno::An
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_sfx2_SfxMacroLoader_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &init_func)
+    css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    // 2nd phase initialization needed
-    init_func = static_cast<cppu::constructor_InitializationFunc>(&SfxMacroLoader::constructorInit);
-
-    return static_cast<cppu::OWeakObject *>(new SfxMacroLoader());
+    return cppu::acquire(new SfxMacroLoader(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 20b6449..5614f49 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -974,9 +974,9 @@ void SAL_CALL ShutdownIcon::setFastPropertyValue(       ::sal_Int32
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_desktop_QuickstartWrapper_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new ShutdownIcon(context));
+    return cppu::acquire(new ShutdownIcon(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx
index 4ff41b7..6229c61 100644
--- a/sfx2/source/appl/xpackcreator.cxx
+++ b/sfx2/source/appl/xpackcreator.cxx
@@ -176,9 +176,9 @@ uno::Sequence< OUString > SAL_CALL OPackageStructureCreator::getSupportedService
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_embed_PackageStructureCreator_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new OPackageStructureCreator());
+    return cppu::acquire(new OPackageStructureCreator());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index eee5d33..d79c545 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -825,9 +825,9 @@ void SAL_CALL BackingComp::removeStatusListener( const css::uno::Reference< css:
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_sfx2_BackingComp_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new BackingComp(context));
+    return cppu::acquire(new BackingComp(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index d3fd3b0..4618ac9 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -2317,17 +2317,17 @@ void SfxDocumentMetaData::createUserDefined()
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 CompatWriterDocPropsImpl_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new CompatWriterDocPropsImpl(context));
+    return cppu::acquire(new CompatWriterDocPropsImpl(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 SfxDocumentMetaData_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SfxDocumentMetaData(context));
+    return cppu::acquire(new SfxDocumentMetaData(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 364564a..e61eeac 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -2898,9 +2898,9 @@ void SfxURLRelocator_Impl::makeAbsoluteURL( OUString & rURL )
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_sfx2_DocumentTemplates_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SfxDocTplService(context));
+    return cppu::acquire(new SfxDocTplService(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index 2343651..9e41641 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -63,14 +63,10 @@ class IFrameObject : public ::cppu::WeakImplHelper6 <
     SfxFrameDescriptor  maFrmDescr;
 
 public:
-    IFrameObject( const css::uno::Reference < css::uno::XComponentContext>& rxContext)
+    IFrameObject(const css::uno::Reference < css::uno::XComponentContext>& rxContext, const css::uno::Sequence< css::uno::Any >& aArguments)
         throw (css::uno::Exception, css::uno::RuntimeException);
     ~IFrameObject();
 
-    /// 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 OUString SAL_CALL getImplementationName()
         throw (css::uno::RuntimeException)
     {
@@ -161,15 +157,11 @@ const SfxItemPropertyMapEntry* lcl_GetIFramePropertyMap_Impl()
     return aIFramePropertyMap_Impl;
 }
 
-IFrameObject::IFrameObject( const uno::Reference < uno::XComponentContext >& rxContext )
+IFrameObject::IFrameObject(const uno::Reference < uno::XComponentContext >& rxContext, const css::uno::Sequence< css::uno::Any >& aArguments)
     throw ( uno::Exception, uno::RuntimeException )
     : mxContext( rxContext )
     , maPropMap( lcl_GetIFramePropertyMap_Impl() )
 {
-}
-
-void SAL_CALL IFrameObject::constructorInit(const css::uno::Sequence< css::uno::Any >& aArguments) throw (css::uno::Exception, css::uno::RuntimeException)
-{
     if ( aArguments.getLength() )
         aArguments[0] >>= mxObj;
 }
@@ -436,12 +428,9 @@ void SAL_CALL IFrameObject::setTitle( const OUString& ) throw (::com::sun::star:
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_sfx2_IFrameObject_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>(&IFrameObject::constructorInit);
-
-    return static_cast<cppu::OWeakObject *>(new IFrameObject(context));
+    return cppu::acquire(new IFrameObject(context, arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx
index 61d000c..4529730 100644
--- a/sfx2/source/doc/ownsubfilterservice.cxx
+++ b/sfx2/source/doc/ownsubfilterservice.cxx
@@ -41,13 +41,9 @@ class OwnSubFilterService : public cppu::WeakImplHelper2 < document::XFilter
     SfxObjectShell* m_pObjectShell;
 
 public:
-    OwnSubFilterService()
+    OwnSubFilterService(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments)
         throw (uno::Exception, uno::RuntimeException);
 
-    /// Initialization function after having acquire()'d.
-    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 ~OwnSubFilterService();
 
     // XFilter
@@ -60,14 +56,10 @@ public:
     virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw (uno::RuntimeException);
 };
 
-OwnSubFilterService::OwnSubFilterService()
+OwnSubFilterService::OwnSubFilterService(const css::uno::Sequence< css::uno::Any >& aArguments)
     throw (uno::Exception, uno::RuntimeException)
     : m_pObjectShell( NULL )
 {
-}
-
-void OwnSubFilterService::constructorInit( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::Exception, css::uno::RuntimeException)
-{
     if ( aArguments.getLength() != 2 )
         throw lang::IllegalArgumentException();
 
@@ -133,12 +125,9 @@ uno::Sequence< OUString > SAL_CALL OwnSubFilterService::getSupportedServiceNames
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_document_OwnSubFilter_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &init_func)
+    css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    // 2nd phase initialization needed
-    init_func = static_cast<cppu::constructor_InitializationFunc>(&OwnSubFilterService::constructorInit);
-
-    return static_cast<cppu::OWeakObject *>(new OwnSubFilterService);
+    return cppu::acquire(new OwnSubFilterService(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/plugin.cxx b/sfx2/source/doc/plugin.cxx
index 60eddc1..43f7397 100644
--- a/sfx2/source/doc/plugin.cxx
+++ b/sfx2/source/doc/plugin.cxx
@@ -309,9 +309,9 @@ void SAL_CALL PluginObject::removeVetoableChangeListener(const OUString&, const
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_sfx2_PluginObject_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new PluginObject());
+    return cppu::acquire(new PluginObject());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/macroloader.hxx b/sfx2/source/inc/macroloader.hxx
index 7dac814..f0a7757 100644
--- a/sfx2/source/inc/macroloader.hxx
+++ b/sfx2/source/inc/macroloader.hxx
@@ -50,13 +50,9 @@ class SfxMacroLoader : public cppu::WeakImplHelper4<
     SfxObjectShell* GetObjectShell_Impl();
 
 public:
-    SfxMacroLoader()
+    SfxMacroLoader(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments)
         throw (css::uno::Exception, 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);
-
     virtual OUString SAL_CALL getImplementationName()
         throw (css::uno::RuntimeException);
 
diff --git a/sfx2/source/notify/globalevents.cxx b/sfx2/source/notify/globalevents.cxx
index 16b7118..de482dc 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ b/sfx2/source/notify/globalevents.cxx
@@ -547,9 +547,11 @@ struct Singleton:
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_sfx2_GlobalEventBroadcaster_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return Singleton::get(context).instance.get();
+    css::uno::XInterface *inst = Singleton::get(context).instance.get();
+    inst->acquire();
+    return inst;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index c7c0ff6..9e4f716 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -776,9 +776,9 @@ Sequence< OUString > SAL_CALL SfxFrameLoader_Impl::getSupportedServiceNames() th
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_office_FrameLoader_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SfxFrameLoader_Impl(context));
+    return cppu::acquire(new SfxFrameLoader_Impl(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index 2f09bf5..6c8dbb5 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -1353,9 +1353,9 @@ void SAL_CALL NestedRegistryImpl::mergeKey( const OUString& aKeyName, const OUSt
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_stoc_NestedRegistry_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new NestedRegistryImpl);
+    return cppu::acquire(new NestedRegistryImpl);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 8218c2e..738f25a 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -1819,9 +1819,9 @@ Reference< XSimpleRegistry > ImplementationRegistration::createTemporarySimpleRe
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_stoc_ImplementationRegistration_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new ImplementationRegistration(context));
+    return cppu::acquire(new ImplementationRegistration(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx
index e52519c..9c1283b 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -168,9 +168,9 @@ sal_Bool SAL_CALL DllComponentLoader::writeRegistryInfo(
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_stoc_DLLComponentLoader_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new DllComponentLoader(context));
+    return cppu::acquire(new DllComponentLoader(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index 3fbf8f5..abc959c 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -982,9 +982,9 @@ Sequence< OUString > AccessController::getSupportedServiceNames()
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_security_comp_stoc_AccessController_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new AccessController(context));
+    return cppu::acquire(new AccessController(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx
index 2864b6d..9d646a7 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -543,9 +543,9 @@ Sequence< OUString > FilePolicy::getSupportedServiceNames()
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_security_comp_stoc_FilePolicy_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new FilePolicy(context));
+    return cppu::acquire(new FilePolicy(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 00763d5..0abf06d 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -1674,25 +1674,25 @@ Any ORegistryServiceManager::getPropertyValue(const OUString& PropertyName)
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_stoc_OServiceManager_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new OServiceManager(context));
+    return cppu::acquire(new OServiceManager(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_stoc_ORegistryServiceManager_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new ORegistryServiceManager(context));
+    return cppu::acquire(new ORegistryServiceManager(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_stoc_OServiceManagerWrapper_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new OServiceManagerWrapper(context));
+    return cppu::acquire(new OServiceManagerWrapper(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index 4927efe..3f5c8d8 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -1126,9 +1126,9 @@ void SimpleRegistry::mergeKey(
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_stoc_SimpleRegistry_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SimpleRegistry);
+    return cppu::acquire(new SimpleRegistry);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx
index 431d84c..706ad18 100644
--- a/svtools/source/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.cxx
@@ -302,9 +302,9 @@ void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComp
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_svtools_SvFilterOptionsDialog_get_implementation(
     css::uno::XComponentContext * context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SvFilterOptionsDialog(context));
+    return cppu::acquire(new SvFilterOptionsDialog(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/graphic/graphicunofactory.cxx b/svtools/source/graphic/graphicunofactory.cxx
index 6b526f9..139ccb3 100644
--- a/svtools/source/graphic/graphicunofactory.cxx
+++ b/svtools/source/graphic/graphicunofactory.cxx
@@ -39,9 +39,7 @@ class GObjectImpl : public GObjectAccess_BASE
      ::osl::Mutex m_aMutex;
      std::auto_ptr< GraphicObject > mpGObject;
 public:
-    GObjectImpl() throw (uno::RuntimeException);
-
-    void SAL_CALL constructorInit( const uno::Sequence< uno::Any >& aArguments ) throw (uno::Exception, uno::RuntimeException);
+    GObjectImpl(uno::Sequence< uno::Any > const & args) throw (uno::RuntimeException);
 
      // XGraphicObject
     virtual uno::Reference< graphic::XGraphic > SAL_CALL getGraphic() throw (uno::RuntimeException);
@@ -70,11 +68,7 @@ public:
     }
 };
 
-GObjectImpl::GObjectImpl() throw (uno::RuntimeException)
-{
-}
-
-void GObjectImpl::constructorInit( const uno::Sequence< uno::Any >& args ) throw (uno::Exception, uno::RuntimeException)
+GObjectImpl::GObjectImpl(const uno::Sequence< uno::Any >& args) throw (uno::RuntimeException)
 {
     if ( args.getLength() == 1 )
     {
@@ -119,12 +113,9 @@ OUString SAL_CALL GObjectImpl::getUniqueID() throw (uno::RuntimeException)
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_graphic_GraphicObject_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &init_func)
+    css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    // 2nd phase initialization needed
-    init_func = static_cast<cppu::constructor_InitializationFunc>(&GObjectImpl::constructorInit);
-
-    return static_cast<cppu::OWeakObject *>(new GObjectImpl);
+    return cppu::acquire(new GObjectImpl(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index ac29035..554a555 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -859,9 +859,9 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_graphic_GraphicProvider_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new GraphicProvider);
+    return cppu::acquire(new GraphicProvider);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index 8e8c38b..1577ba7 100644
--- a/svtools/source/graphic/renderer.cxx
+++ b/svtools/source/graphic/renderer.cxx
@@ -295,9 +295,9 @@ void SAL_CALL GraphicRendererVCL::render( const uno::Reference< graphic::XGraphi
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new GraphicRendererVCL);
+    return cppu::acquire(new GraphicRendererVCL);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx
index b92ab49..b4ffcc9 100644
--- a/svtools/source/hatchwindow/documentcloser.cxx
+++ b/svtools/source/hatchwindow/documentcloser.cxx
@@ -54,12 +54,9 @@ class ODocumentCloser : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::
     sal_Bool m_bDisposed;
 
 public:
-    ODocumentCloser();
+    ODocumentCloser(const css::uno::Sequence< css::uno::Any >& aArguments);
     ~ODocumentCloser();
 
-    /// 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);
-
 // XComponent
     virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
@@ -148,14 +145,10 @@ IMPL_STATIC_LINK( MainThreadFrameCloserRequest, worker, MainThreadFrameCloserReq
     return 0;
 }
 
-ODocumentCloser::ODocumentCloser()
+ODocumentCloser::ODocumentCloser(const css::uno::Sequence< css::uno::Any >& aArguments)
 : m_pListenersContainer( NULL )
 , m_bDisposed( sal_False )
 {
-}
-
-void ODocumentCloser::constructorInit(const css::uno::Sequence< css::uno::Any >& aArguments) throw (css::uno::Exception, css::uno::RuntimeException)
-{
     ::osl::MutexGuard aGuard( m_aMutex );
     if ( !m_refCount )
         throw uno::RuntimeException(); // the object must be refcounted already!
@@ -256,13 +249,10 @@ uno::Sequence< OUString > SAL_CALL ODocumentCloser::getSupportedServiceNames()
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_embed_DocumentCloser_get_implementation(
-        SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
-        cppu::constructor_InitializationFunc &init_func)
+    SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+    css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    // 2nd phase initialization needed
-    init_func = static_cast<cppu::constructor_InitializationFunc>(&ODocumentCloser::constructorInit);
-
-    return static_cast<cppu::OWeakObject *>(new ODocumentCloser());
+    return cppu::acquire(new ODocumentCloser(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index 7f19919..27b27e2 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -87,9 +87,9 @@ uno::Sequence< OUString > SAL_CALL OHatchWindowFactory::getSupportedServiceNames
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_embed_HatchWindowFactory_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new OHatchWindowFactory);
+    return cppu::acquire(new OHatchWindowFactory);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx
index 32219a1..85706cf 100644
--- a/svtools/source/uno/addrtempuno.cxx
+++ b/svtools/source/uno/addrtempuno.cxx
@@ -225,10 +225,10 @@ namespace {
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_svtools_OAddressBookSourceDialogUno_get_implementation(
-        css::uno::XComponentContext * context,
-        cppu::constructor_InitializationFunc &)
+    css::uno::XComponentContext * context,
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new OAddressBookSourceDialogUno(context));
+    return cppu::acquire(new OAddressBookSourceDialogUno(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx
index f8f440a..ae2d96b 100644
--- a/svtools/source/uno/wizard/unowizard.cxx
+++ b/svtools/source/uno/wizard/unowizard.cxx
@@ -499,10 +499,10 @@ namespace {
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_svtools_uno_Wizard_get_implementation(
-        css::uno::XComponentContext *context,
-        cppu::constructor_InitializationFunc &)
+    css::uno::XComponentContext *context,
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new Wizard(context));
+    return cppu::acquire(new Wizard(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 6d8e62a..e1ceb95 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -492,9 +492,9 @@ Sequence< Reference< drawing::XCustomShapeHandle > > SAL_CALL EnhancedCustomShap
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new EnhancedCustomShapeEngine);
+    return cppu::acquire(new EnhancedCustomShapeEngine);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/primitive2d/primitivefactory2d.cxx b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
index a5dede5..06bafe8 100644
--- a/svx/source/sdr/primitive2d/primitivefactory2d.cxx
+++ b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
@@ -91,9 +91,9 @@ Primitive2DSequence SAL_CALL PrimitiveFactory2D::createPrimitivesFromXDrawPage(
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new PrimitiveFactory2D);
+    return cppu::acquire(new PrimitiveFactory2D);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index d8839db..982f470 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -207,7 +207,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new PanelFactory);
+    return cppu::acquire(new PanelFactory);
 }
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index 418fab4..4733043 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -442,9 +442,9 @@ void FontHeightToolBoxControl::dispatchCommand(
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_svx_FontHeightToolBoxController_get_implementation(
     css::uno::XComponentContext *rxContext,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new FontHeightToolBoxControl(rxContext));
+    return cppu::acquire(new FontHeightToolBoxControl(rxContext));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 19c0adb..8cedb04 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -1053,57 +1053,57 @@ void SAL_CALL FindbarDispatcher::removeStatusListener( const css::uno::Reference
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_svx_FindTextToolboxController_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new FindTextToolbarController(context));
+    return cppu::acquire(new FindTextToolbarController(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_svx_ExitFindbarToolboxController_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new ExitSearchToolboxController(context));
+    return cppu::acquire(new ExitSearchToolboxController(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_svx_UpSearchToolboxController_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::UP));
+    return cppu::acquire(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::UP));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_svx_DownSearchToolboxController_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::DOWN));
+    return cppu::acquire(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::DOWN));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_svx_MatchCaseToolboxController_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new MatchCaseToolboxController(context));
+    return cppu::acquire(new MatchCaseToolboxController(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_svx_FindAllToolboxController_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new FindAllToolboxController(context));
+    return cppu::acquire(new FindAllToolboxController(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new FindbarDispatcher);
+    return cppu::acquire(new FindbarDispatcher);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 6d4c7d3..5734450 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -1283,9 +1283,9 @@ Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector )
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_Draw_GraphicExporter_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new GraphicExporter);
+    return cppu::acquire(new GraphicExporter);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 19142a4..65033f6 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -423,9 +423,9 @@ void RecoveryUI::impl_showAllRecoveredDocs()
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_svx_RecoveryUI_get_implementation(
     css::uno::XComponentContext *context,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new RecoveryUI(context));
+    return cppu::acquire(new RecoveryUI(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 6205d0c..3a3b917 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -188,9 +188,9 @@ sal_Bool SAL_CALL SvxUnoColorTable::hasElements()
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_drawing_SvxUnoColorTable_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SvxUnoColorTable);
+    return cppu::acquire(new SvxUnoColorTable);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index 76f48ad..925a881 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -272,9 +272,9 @@ uno::Sequence< OUString > SAL_CALL SvxShapeCollection::getSupportedServiceNames(
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_drawing_SvxShapeCollection_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SvxShapeCollection);
+    return cppu::acquire(new SvxShapeCollection);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index 0961198..a942246 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -234,9 +234,9 @@ void SAL_CALL GalleryThemeProvider::removeByName( const OUString& rName )
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_gallery_GalleryThemeProvider_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new GalleryThemeProvider);
+    return cppu::acquire(new GalleryThemeProvider);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index d6c8d26..41e94a9 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -1053,9 +1053,9 @@ Sequence< OUString > SAL_CALL SvXMLGraphicImportExportHelper::getSupportedServic
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_Svx_GraphicImportHelper_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ));
+    return cppu::acquire(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ));
 }
 
 /** Create this with createInstanceWithArguments. service name
@@ -1073,9 +1073,9 @@ com_sun_star_comp_Svx_GraphicImportHelper_get_implementation(
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_Svx_GraphicExportHelper_get_implementation(
     css::uno::XComponentContext *,
-    cppu::constructor_InitializationFunc &)
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE));
+    return cppu::acquire(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list