Minimize the constructor functions to a bare minimum.

Most of the constructors are supposed to be only a call of

  new TheInstance(arguments)

or an equivalent; so let's just change the constructor caller accordingly, to
accept unacquired new instance.

If there are exceptions that need to do more heavy lifting, they do not have
to use the constructor feature, or there can be a wrapper for the real
implementation, doing the additional work in their (C++) constructor.

Change-Id: I035c378778aeda60d15af4e56ca3761c586d5ded
This commit is contained in:
Jan Holesovsky 2014-01-16 16:26:55 +01:00
parent ef602ba8ce
commit 306efefe22
46 changed files with 66 additions and 181 deletions

View File

@ -3463,7 +3463,7 @@ void ServiceType::dumpHxxFile(
"LO_URE_CTOR_FUN_") "LO_URE_CTOR_FUN_")
<< name_.replaceAll(".", "_dot_") << name_.replaceAll(".", "_dot_")
<< (")(the_context.get(), ::css::uno::Sequence<" << (")(the_context.get(), ::css::uno::Sequence<"
" ::css::uno::Any >())), ::SAL_NO_ACQUIRE)," " ::css::uno::Any >()))),"
" ::css::uno::UNO_QUERY);\n#else\n") " ::css::uno::UNO_QUERY);\n#else\n")
<< indent() << "the_instance = ::css::uno::Reference< " << indent() << "the_instance = ::css::uno::Reference< "
<< scopedBaseName << scopedBaseName
@ -3606,7 +3606,7 @@ void ServiceType::dumpHxxFile(
} else { } else {
o << "the_arguments"; o << "the_arguments";
} }
o << ")), ::SAL_NO_ACQUIRE), ::css::uno::UNO_QUERY);\n" << indent() o << "))), ::css::uno::UNO_QUERY);\n" << indent()
<< ("::css::uno::Reference< ::css::lang::XInitialization > " << ("::css::uno::Reference< ::css::lang::XInitialization > "
"init(the_instance, ::css::uno::UNO_QUERY);\n") "init(the_instance, ::css::uno::UNO_QUERY);\n")
<< indent() << "if (init.is()) {\n" << indent() << "if (init.is()) {\n"

View File

@ -706,8 +706,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstance(
if (constructor != 0) { if (constructor != 0) {
return css::uno::Reference<css::uno::XInterface>( return css::uno::Reference<css::uno::XInterface>(
(*constructor)( (*constructor)(
context.get(), css::uno::Sequence<css::uno::Any>()), context.get(), css::uno::Sequence<css::uno::Any>()));
SAL_NO_ACQUIRE);
} }
if (factory1.is()) { if (factory1.is()) {
return factory1->createInstanceWithContext(context); return factory1->createInstanceWithContext(context);
@ -730,8 +729,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstance(
if (constructor != 0) { if (constructor != 0) {
singleton.set( singleton.set(
(*constructor)( (*constructor)(
context.get(), css::uno::Sequence<css::uno::Any>()), context.get(), css::uno::Sequence<css::uno::Any>()));
SAL_NO_ACQUIRE);
} else if (factory1.is()) { } else if (factory1.is()) {
singleton = factory1->createInstanceWithContext(context); singleton = factory1->createInstanceWithContext(context);
} else if (factory2.is()) { } else if (factory2.is()) {
@ -761,7 +759,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
// should be removed again once XInitialization-based // should be removed again once XInitialization-based
// implementations have become rare: // implementations have become rare:
css::uno::Reference<css::uno::XInterface> inst( css::uno::Reference<css::uno::XInterface> inst(
(*constructor)(context.get(), arguments), SAL_NO_ACQUIRE); (*constructor)(context.get(), arguments));
css::uno::Reference<css::lang::XInitialization> init( css::uno::Reference<css::lang::XInitialization> init(
inst, css::uno::UNO_QUERY); inst, css::uno::UNO_QUERY);
if (init.is()) { if (init.is()) {
@ -793,8 +791,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
} }
if (constructor != 0) { if (constructor != 0) {
//HACK: see above //HACK: see above
singleton.set( singleton.set((*constructor)(context.get(), arguments));
(*constructor)(context.get(), arguments), SAL_NO_ACQUIRE);
css::uno::Reference<css::lang::XInitialization> init( css::uno::Reference<css::lang::XInitialization> init(
singleton, css::uno::UNO_QUERY); singleton, css::uno::UNO_QUERY);
if (init.is()) { if (init.is()) {

View File

@ -189,10 +189,8 @@ public:
static ErrCode CallAppBasic( const OUString& i_macroName, SbxArray* i_args = NULL, SbxValue* i_ret = NULL ) static ErrCode CallAppBasic( const OUString& i_macroName, SbxArray* i_args = NULL, SbxValue* i_ret = NULL )
{ return CallBasic( i_macroName, SfxApplication::GetOrCreate()->GetBasicManager(), i_args, i_ret ); } { return CallBasic( i_macroName, SfxApplication::GetOrCreate()->GetBasicManager(), i_args, i_ret ); }
BasicManager* GetBasicManager(); BasicManager* GetBasicManager();
com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer > com::sun::star::script::XLibraryContainer * GetDialogContainer();
GetDialogContainer(); com::sun::star::script::XLibraryContainer * GetBasicContainer();
com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >
GetBasicContainer();
StarBASIC* GetBasic(); StarBASIC* GetBasic();
sal_uInt16 SaveBasicAndDialogContainer() const; sal_uInt16 SaveBasicAndDialogContainer() const;

View File

@ -1025,9 +1025,7 @@ com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SaxExpatParser> x(new SaxExpatParser); return static_cast<cppu::OWeakObject *>(new SaxExpatParser);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1375,9 +1375,7 @@ com_sun_star_extensions_xml_sax_Writer_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SAXWriter> x(new SAXWriter); return static_cast<cppu::OWeakObject *>(new SAXWriter);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1431,9 +1431,7 @@ com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<FastSaxParser> x(new FastSaxParser); return static_cast<cppu::OWeakObject *>(new FastSaxParser);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -127,11 +127,10 @@ BasicManager* SfxApplication::GetBasicManager()
//-------------------------------------------------------------------- //--------------------------------------------------------------------
Reference< XLibraryContainer > SfxApplication::GetDialogContainer() XLibraryContainer * SfxApplication::GetDialogContainer()
{ {
#ifdef DISABLE_SCRIPTING #ifdef DISABLE_SCRIPTING
Reference< XLibraryContainer > dummy; return NULL;
return dummy;
#else #else
if ( !pAppData_Impl->pBasicManager->isValid() ) if ( !pAppData_Impl->pBasicManager->isValid() )
GetBasicManager(); GetBasicManager();
@ -141,11 +140,10 @@ Reference< XLibraryContainer > SfxApplication::GetDialogContainer()
//-------------------------------------------------------------------- //--------------------------------------------------------------------
Reference< XLibraryContainer > SfxApplication::GetBasicContainer() XLibraryContainer * SfxApplication::GetBasicContainer()
{ {
#ifdef DISABLE_SCRIPTING #ifdef DISABLE_SCRIPTING
Reference< XLibraryContainer > dummy; return NULL;
return dummy;
#else #else
if ( !pAppData_Impl->pBasicManager->isValid() ) if ( !pAppData_Impl->pBasicManager->isValid() )
GetBasicManager(); GetBasicManager();

View File

@ -121,7 +121,7 @@ void SfxBasicManagerHolder::storeLibrariesToStorage( const Reference< XStorage >
#endif #endif
} }
Reference< XLibraryContainer > SfxBasicManagerHolder::getLibraryContainer( ContainerType _eType ) XLibraryContainer * SfxBasicManagerHolder::getLibraryContainer( ContainerType _eType )
{ {
OSL_PRECOND( isValid(), "SfxBasicManagerHolder::getLibraryContainer: not initialized!" ); OSL_PRECOND( isValid(), "SfxBasicManagerHolder::getLibraryContainer: not initialized!" );
@ -161,9 +161,7 @@ com_sun_star_comp_sfx2_ApplicationDialogLibraryContainer_get_implementation(
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
SFX_APP()->GetBasicManager(); SFX_APP()->GetBasicManager();
Reference< XInterface > xRet( SFX_APP()->GetDialogContainer(), UNO_QUERY ); return SFX_APP()->GetDialogContainer();
xRet->acquire();
return xRet.get();
} }
//============================================================================ //============================================================================
@ -175,9 +173,7 @@ com_sun_star_comp_sfx2_ApplicationScriptLibraryContainer_get_implementation(
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
SFX_APP()->GetBasicManager(); SFX_APP()->GetBasicManager();
Reference< XInterface > xRet( SFX_APP()->GetBasicContainer(), UNO_QUERY ); return SFX_APP()->GetBasicContainer();
xRet->acquire();
return xRet.get();
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -255,9 +255,7 @@ com_sun_star_comp_sfx2_AppDispatchProvider_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &arguments) css::uno::Sequence<css::uno::Any> const &arguments)
{ {
rtl::Reference<SfxAppDispatchProvider> x(new SfxAppDispatchProvider(arguments)); return static_cast<cppu::OWeakObject *>(new SfxAppDispatchProvider(arguments));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -341,9 +341,7 @@ com_sun_star_comp_sfx2_SfxMacroLoader_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &arguments) css::uno::Sequence<css::uno::Any> const &arguments)
{ {
rtl::Reference<SfxMacroLoader> x(new SfxMacroLoader(arguments)); return static_cast<cppu::OWeakObject *>(new SfxMacroLoader(arguments));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -976,9 +976,7 @@ com_sun_star_comp_desktop_QuickstartWrapper_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<ShutdownIcon> x(new ShutdownIcon(context)); return static_cast<cppu::OWeakObject *>(new ShutdownIcon(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -178,9 +178,7 @@ com_sun_star_comp_embed_PackageStructureCreator_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<OPackageStructureCreator> x(new OPackageStructureCreator()); return static_cast<cppu::OWeakObject *>(new OPackageStructureCreator());
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -813,9 +813,7 @@ com_sun_star_comp_sfx2_BackingComp_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<BackingComp> x(new BackingComp(context)); return static_cast<cppu::OWeakObject *>(new BackingComp(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -2319,9 +2319,7 @@ CompatWriterDocPropsImpl_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<CompatWriterDocPropsImpl> x(new CompatWriterDocPropsImpl(context)); return static_cast<cppu::OWeakObject *>(new CompatWriterDocPropsImpl(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@ -2329,9 +2327,7 @@ SfxDocumentMetaData_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SfxDocumentMetaData> x(new SfxDocumentMetaData(context)); return static_cast<cppu::OWeakObject *>(new SfxDocumentMetaData(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -2900,9 +2900,7 @@ com_sun_star_comp_sfx2_DocumentTemplates_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SfxDocTplService> x(new SfxDocTplService(context)); return static_cast<cppu::OWeakObject *>(new SfxDocTplService(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -432,9 +432,7 @@ com_sun_star_comp_sfx2_IFrameObject_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &arguments) css::uno::Sequence<css::uno::Any> const &arguments)
{ {
rtl::Reference<IFrameObject> x(new IFrameObject(context, arguments)); return static_cast<cppu::OWeakObject *>(new IFrameObject(context, arguments));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -126,9 +126,7 @@ com_sun_star_comp_document_OwnSubFilter_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &arguments) css::uno::Sequence<css::uno::Any> const &arguments)
{ {
rtl::Reference<OwnSubFilterService> x(new OwnSubFilterService(arguments)); return static_cast<cppu::OWeakObject *>(new OwnSubFilterService(arguments));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -311,9 +311,7 @@ com_sun_star_comp_sfx2_PluginObject_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<PluginObject> x(new PluginObject()); return static_cast<cppu::OWeakObject *>(new PluginObject());
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -59,7 +59,7 @@ public:
*/ */
void reset( BasicManager* _pBasicManager ); void reset( BasicManager* _pBasicManager );
::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer > ::com::sun::star::script::XLibraryContainer *
getLibraryContainer( ContainerType _eType ); getLibraryContainer( ContainerType _eType );
/** calls the storeLibraries at both our script and basic library container /** calls the storeLibraries at both our script and basic library container

View File

@ -778,9 +778,7 @@ com_sun_star_comp_office_FrameLoader_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SfxFrameLoader_Impl> x(new SfxFrameLoader_Impl(context)); return static_cast<cppu::OWeakObject *>(new SfxFrameLoader_Impl(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1355,9 +1355,7 @@ com_sun_star_comp_stoc_NestedRegistry_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *, SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<NestedRegistryImpl> x(new NestedRegistryImpl); return static_cast<cppu::OWeakObject *>(new NestedRegistryImpl);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1821,9 +1821,7 @@ com_sun_star_comp_stoc_ImplementationRegistration_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<ImplementationRegistration> x(new ImplementationRegistration(context)); return static_cast<cppu::OWeakObject *>(new ImplementationRegistration(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -170,9 +170,7 @@ com_sun_star_comp_stoc_DLLComponentLoader_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<DllComponentLoader> x(new DllComponentLoader(context)); return static_cast<cppu::OWeakObject *>(new DllComponentLoader(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -984,9 +984,7 @@ com_sun_star_security_comp_stoc_AccessController_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<AccessController> x(new AccessController(context)); return static_cast<cppu::OWeakObject *>(new AccessController(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -545,9 +545,7 @@ com_sun_star_security_comp_stoc_FilePolicy_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<FilePolicy> x(new FilePolicy(context)); return static_cast<cppu::OWeakObject *>(new FilePolicy(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1676,9 +1676,7 @@ com_sun_star_comp_stoc_OServiceManager_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<OServiceManager> x(new OServiceManager(context)); return static_cast<cppu::OWeakObject *>(new OServiceManager(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@ -1686,9 +1684,7 @@ com_sun_star_comp_stoc_ORegistryServiceManager_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<ORegistryServiceManager> x(new ORegistryServiceManager(context)); return static_cast<cppu::OWeakObject *>(new ORegistryServiceManager(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@ -1696,9 +1692,7 @@ com_sun_star_comp_stoc_OServiceManagerWrapper_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<OServiceManagerWrapper> x(new OServiceManagerWrapper(context)); return static_cast<cppu::OWeakObject *>(new OServiceManagerWrapper(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1128,9 +1128,7 @@ com_sun_star_comp_stoc_SimpleRegistry_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *, SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SimpleRegistry> x(new SimpleRegistry); return static_cast<cppu::OWeakObject *>(new SimpleRegistry);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -304,9 +304,7 @@ com_sun_star_svtools_SvFilterOptionsDialog_get_implementation(
css::uno::XComponentContext * context, css::uno::XComponentContext * context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SvFilterOptionsDialog> x(new SvFilterOptionsDialog(context)); return static_cast<cppu::OWeakObject *>(new SvFilterOptionsDialog(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -115,9 +115,7 @@ com_sun_star_graphic_GraphicObject_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *, SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &arguments) css::uno::Sequence<css::uno::Any> const &arguments)
{ {
rtl::Reference<GObjectImpl> x(new GObjectImpl(arguments)); return static_cast<cppu::OWeakObject *>(new GObjectImpl(arguments));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -861,9 +861,7 @@ com_sun_star_comp_graphic_GraphicProvider_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<GraphicProvider> x(new GraphicProvider); return static_cast<cppu::OWeakObject *>(new GraphicProvider);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -297,9 +297,7 @@ com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<GraphicRendererVCL> x(new GraphicRendererVCL); return static_cast<cppu::OWeakObject *>(new GraphicRendererVCL);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -252,9 +252,7 @@ com_sun_star_comp_embed_DocumentCloser_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *, SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &arguments) css::uno::Sequence<css::uno::Any> const &arguments)
{ {
rtl::Reference<ODocumentCloser> x(new ODocumentCloser(arguments)); return static_cast<cppu::OWeakObject *>(new ODocumentCloser(arguments));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -89,9 +89,7 @@ com_sun_star_comp_embed_HatchWindowFactory_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<OHatchWindowFactory> x(new OHatchWindowFactory); return static_cast<cppu::OWeakObject *>(new OHatchWindowFactory);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -228,9 +228,7 @@ com_sun_star_comp_svtools_OAddressBookSourceDialogUno_get_implementation(
css::uno::XComponentContext * context, css::uno::XComponentContext * context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<OAddressBookSourceDialogUno> x(new OAddressBookSourceDialogUno(context)); return static_cast<cppu::OWeakObject *>(new OAddressBookSourceDialogUno(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -502,9 +502,7 @@ com_sun_star_comp_svtools_uno_Wizard_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<Wizard> x(new Wizard(context)); return static_cast<cppu::OWeakObject *>(new Wizard(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -494,9 +494,7 @@ com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<EnhancedCustomShapeEngine> x(new EnhancedCustomShapeEngine); return static_cast<cppu::OWeakObject *>(new EnhancedCustomShapeEngine);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -93,9 +93,7 @@ com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<PrimitiveFactory2D> x(new PrimitiveFactory2D); return static_cast<cppu::OWeakObject *>(new PrimitiveFactory2D);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -209,7 +209,5 @@ org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<PanelFactory> x(new PanelFactory); return static_cast<cppu::OWeakObject *>(new PanelFactory);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }

View File

@ -444,9 +444,7 @@ com_sun_star_svx_FontHeightToolBoxController_get_implementation(
css::uno::XComponentContext *rxContext, css::uno::XComponentContext *rxContext,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<FontHeightToolBoxControl> x(new FontHeightToolBoxControl(rxContext)); return static_cast<cppu::OWeakObject *>(new FontHeightToolBoxControl(rxContext));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1055,9 +1055,7 @@ com_sun_star_svx_FindTextToolboxController_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<FindTextToolbarController> x(new FindTextToolbarController(context)); return static_cast<cppu::OWeakObject *>(new FindTextToolbarController(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@ -1065,9 +1063,7 @@ com_sun_star_svx_ExitFindbarToolboxController_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<ExitSearchToolboxController> x(new ExitSearchToolboxController(context)); return static_cast<cppu::OWeakObject *>(new ExitSearchToolboxController(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@ -1075,10 +1071,7 @@ com_sun_star_svx_UpSearchToolboxController_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<UpDownSearchToolboxController> x(new UpDownSearchToolboxController( return static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::UP));
context, UpDownSearchToolboxController::UP));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@ -1086,10 +1079,7 @@ com_sun_star_svx_DownSearchToolboxController_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<UpDownSearchToolboxController> x(new UpDownSearchToolboxController( return static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::DOWN));
context, UpDownSearchToolboxController::DOWN));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@ -1097,9 +1087,7 @@ com_sun_star_svx_MatchCaseToolboxController_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<MatchCaseToolboxController> x(new MatchCaseToolboxController(context)); return static_cast<cppu::OWeakObject *>(new MatchCaseToolboxController(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@ -1107,9 +1095,7 @@ com_sun_star_svx_FindAllToolboxController_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<FindAllToolboxController> x(new FindAllToolboxController(context)); return static_cast<cppu::OWeakObject *>(new FindAllToolboxController(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@ -1117,9 +1103,7 @@ com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *, SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<FindbarDispatcher> x(new FindbarDispatcher); return static_cast<cppu::OWeakObject *>(new FindbarDispatcher);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1285,9 +1285,7 @@ com_sun_star_comp_Draw_GraphicExporter_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<GraphicExporter> x(new GraphicExporter); return static_cast<cppu::OWeakObject *>(new GraphicExporter);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -425,9 +425,7 @@ com_sun_star_comp_svx_RecoveryUI_get_implementation(
css::uno::XComponentContext *context, css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<RecoveryUI> x(new RecoveryUI(context)); return static_cast<cppu::OWeakObject *>(new RecoveryUI(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -190,9 +190,7 @@ com_sun_star_drawing_SvxUnoColorTable_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SvxUnoColorTable> x(new SvxUnoColorTable); return static_cast<cppu::OWeakObject *>(new SvxUnoColorTable);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -274,9 +274,7 @@ com_sun_star_drawing_SvxShapeCollection_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SvxShapeCollection> x(new SvxShapeCollection); return static_cast<cppu::OWeakObject *>(new SvxShapeCollection);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -236,9 +236,7 @@ com_sun_star_comp_gallery_GalleryThemeProvider_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<GalleryThemeProvider> x(new GalleryThemeProvider); return static_cast<cppu::OWeakObject *>(new GalleryThemeProvider);
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1055,10 +1055,7 @@ com_sun_star_comp_Svx_GraphicImportHelper_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SvXMLGraphicImportExportHelper> x( return static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ));
new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/** Create this with createInstanceWithArguments. service name /** Create this with createInstanceWithArguments. service name
@ -1078,10 +1075,7 @@ com_sun_star_comp_Svx_GraphicExportHelper_get_implementation(
css::uno::XComponentContext *, css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &) css::uno::Sequence<css::uno::Any> const &)
{ {
rtl::Reference<SvXMLGraphicImportExportHelper> x( return static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE));
new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */