diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-01-21 15:45:43 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-01-21 21:25:22 +0100 |
commit | f278397787f7b79cee8536e806e8b7113800f2ef (patch) | |
tree | 1760bce432d466cf9f3ca444c89ec8f44306ab04 /sfx2/source/doc/iframe.cxx | |
parent | 3780738154b8c3b3f9d85c64cccf621d97574886 (diff) |
Change _get_implementation()'s not to do initialization directly.
Many of the initalizations (in eg. framework) have to be done on an
acquire()'d object, so instead of doing the initialization directly, return
the initialization member function back to the createInstance() /
createInstanceWithContext() / ... and perform the initialization there.
As a sideeffect, I belive the calling initialize() from servicemanager is not
that much a hack any more - whoever converts the implementation to be
constructor-base has the choice to provide the callback, or still initialize
through XInitialization, where the callback is preferred by servicemanager
when it exists.
Change-Id: I8a87b75c54c1441ca0f184967d31ff4902fc4081
Diffstat (limited to 'sfx2/source/doc/iframe.cxx')
-rw-r--r-- | sfx2/source/doc/iframe.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 504b2891c795..23436518bab6 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -63,11 +63,14 @@ class IFrameObject : public ::cppu::WeakImplHelper6 < SfxFrameDescriptor maFrmDescr; public: - IFrameObject( const css::uno::Reference < css::uno::XComponentContext>& rxContext, - const css::uno::Sequence< css::uno::Any >& aArguments ) + IFrameObject( const css::uno::Reference < css::uno::XComponentContext>& rxContext) 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) { @@ -158,12 +161,15 @@ const SfxItemPropertyMapEntry* lcl_GetIFramePropertyMap_Impl() return aIFramePropertyMap_Impl; } -IFrameObject::IFrameObject( const uno::Reference < uno::XComponentContext >& rxContext, - const uno::Sequence< uno::Any >& aArguments ) +IFrameObject::IFrameObject( const uno::Reference < uno::XComponentContext >& rxContext ) 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; } @@ -430,9 +436,12 @@ 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, - css::uno::Sequence<css::uno::Any> const &arguments) + cppu::constructor_InitializationFunc &init_func) { - return static_cast<cppu::OWeakObject *>(new IFrameObject(context, arguments)); + // 2nd phase initialization needed + init_func = static_cast<cppu::constructor_InitializationFunc>(&IFrameObject::constructorInit); + + return static_cast<cppu::OWeakObject *>(new IFrameObject(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |