From 306efefe22e02248eff14f8be2cef68d75d26e55 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Thu, 16 Jan 2014 16:26:55 +0100 Subject: [PATCH] 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 --- codemaker/source/cppumaker/cpputype.cxx | 4 +-- cppuhelper/source/servicemanager.cxx | 11 +++---- include/sfx2/app.hxx | 6 ++-- sax/source/expatwrap/sax_expat.cxx | 4 +-- sax/source/expatwrap/saxwriter.cxx | 4 +-- sax/source/fastparser/fastparser.cxx | 4 +-- sfx2/source/appl/appbas.cxx | 10 +++---- sfx2/source/appl/appbaslib.cxx | 10 ++----- sfx2/source/appl/appdispatchprovider.cxx | 4 +-- sfx2/source/appl/macroloader.cxx | 4 +-- 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 | 4 +-- sfx2/source/doc/ownsubfilterservice.cxx | 4 +-- sfx2/source/doc/plugin.cxx | 4 +-- sfx2/source/inc/appbaslib.hxx | 2 +- sfx2/source/view/frmload.cxx | 4 +-- .../defaultregistry/defaultregistry.cxx | 4 +-- .../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 +-- .../source/filter/SvFilterOptionsDialog.cxx | 4 +-- svtools/source/graphic/graphicunofactory.cxx | 4 +-- svtools/source/graphic/provider.cxx | 4 +-- svtools/source/graphic/renderer.cxx | 4 +-- svtools/source/hatchwindow/documentcloser.cxx | 4 +-- .../source/hatchwindow/hatchwindowfactory.cxx | 4 +-- svtools/source/uno/addrtempuno.cxx | 4 +-- svtools/source/uno/wizard/unowizard.cxx | 4 +-- .../EnhancedCustomShapeEngine.cxx | 4 +-- .../sdr/primitive2d/primitivefactory2d.cxx | 4 +-- svx/source/sidebar/PanelFactory.cxx | 4 +-- svx/source/tbxctrls/tbunocontroller.cxx | 4 +-- .../tbxctrls/tbunosearchcontrollers.cxx | 30 +++++-------------- 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 | 10 ++----- 46 files changed, 66 insertions(+), 181 deletions(-) diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index d3898d993b1b..4dbfd3a2a344 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -3463,7 +3463,7 @@ void ServiceType::dumpHxxFile( "LO_URE_CTOR_FUN_") << name_.replaceAll(".", "_dot_") << (")(the_context.get(), ::css::uno::Sequence<" - " ::css::uno::Any >())), ::SAL_NO_ACQUIRE)," + " ::css::uno::Any >())))," " ::css::uno::UNO_QUERY);\n#else\n") << indent() << "the_instance = ::css::uno::Reference< " << scopedBaseName @@ -3606,7 +3606,7 @@ void ServiceType::dumpHxxFile( } else { 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 > " "init(the_instance, ::css::uno::UNO_QUERY);\n") << indent() << "if (init.is()) {\n" diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index 9bc31138447b..af964fe634a8 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -706,8 +706,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstance( if (constructor != 0) { return css::uno::Reference( (*constructor)( - context.get(), css::uno::Sequence()), - SAL_NO_ACQUIRE); + context.get(), css::uno::Sequence())); } if (factory1.is()) { return factory1->createInstanceWithContext(context); @@ -730,8 +729,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstance( if (constructor != 0) { singleton.set( (*constructor)( - context.get(), css::uno::Sequence()), - SAL_NO_ACQUIRE); + context.get(), css::uno::Sequence())); } else if (factory1.is()) { singleton = factory1->createInstanceWithContext(context); } else if (factory2.is()) { @@ -761,7 +759,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments( // should be removed again once XInitialization-based // implementations have become rare: css::uno::Reference inst( - (*constructor)(context.get(), arguments), SAL_NO_ACQUIRE); + (*constructor)(context.get(), arguments)); css::uno::Reference init( inst, css::uno::UNO_QUERY); if (init.is()) { @@ -793,8 +791,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments( } if (constructor != 0) { //HACK: see above - singleton.set( - (*constructor)(context.get(), arguments), SAL_NO_ACQUIRE); + singleton.set((*constructor)(context.get(), arguments)); css::uno::Reference init( singleton, css::uno::UNO_QUERY); if (init.is()) { diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index 5a5cf36a2741..d811b2731cdf 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -189,10 +189,8 @@ public: 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 ); } BasicManager* GetBasicManager(); - com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer > - GetDialogContainer(); - com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer > - GetBasicContainer(); + com::sun::star::script::XLibraryContainer * GetDialogContainer(); + com::sun::star::script::XLibraryContainer * GetBasicContainer(); StarBASIC* GetBasic(); sal_uInt16 SaveBasicAndDialogContainer() const; diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 12066dc92b91..7d5e36cabf80 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -1025,9 +1025,7 @@ com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new SaxExpatParser); - x->acquire(); - return static_cast(x.get()); + return static_cast(new SaxExpatParser); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index be86b61d18f4..73cb50ff74fe 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -1375,9 +1375,7 @@ com_sun_star_extensions_xml_sax_Writer_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new SAXWriter); - x->acquire(); - return static_cast(x.get()); + return static_cast(new SAXWriter); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 57bff21ed59f..152c22da376a 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -1431,9 +1431,7 @@ com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new FastSaxParser); - x->acquire(); - return static_cast(x.get()); + return static_cast(new FastSaxParser); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index 5010806635f6..3251a9271cf8 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -127,11 +127,10 @@ BasicManager* SfxApplication::GetBasicManager() //-------------------------------------------------------------------- -Reference< XLibraryContainer > SfxApplication::GetDialogContainer() +XLibraryContainer * SfxApplication::GetDialogContainer() { #ifdef DISABLE_SCRIPTING - Reference< XLibraryContainer > dummy; - return dummy; + return NULL; #else if ( !pAppData_Impl->pBasicManager->isValid() ) GetBasicManager(); @@ -141,11 +140,10 @@ Reference< XLibraryContainer > SfxApplication::GetDialogContainer() //-------------------------------------------------------------------- -Reference< XLibraryContainer > SfxApplication::GetBasicContainer() +XLibraryContainer * SfxApplication::GetBasicContainer() { #ifdef DISABLE_SCRIPTING - Reference< XLibraryContainer > dummy; - return dummy; + return NULL; #else if ( !pAppData_Impl->pBasicManager->isValid() ) GetBasicManager(); diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx index 4b96cc2e6c0e..df0c237c906d 100644 --- a/sfx2/source/appl/appbaslib.cxx +++ b/sfx2/source/appl/appbaslib.cxx @@ -121,7 +121,7 @@ void SfxBasicManagerHolder::storeLibrariesToStorage( const Reference< XStorage > #endif } -Reference< XLibraryContainer > SfxBasicManagerHolder::getLibraryContainer( ContainerType _eType ) +XLibraryContainer * SfxBasicManagerHolder::getLibraryContainer( ContainerType _eType ) { OSL_PRECOND( isValid(), "SfxBasicManagerHolder::getLibraryContainer: not initialized!" ); @@ -161,9 +161,7 @@ com_sun_star_comp_sfx2_ApplicationDialogLibraryContainer_get_implementation( css::uno::Sequence const &) { SFX_APP()->GetBasicManager(); - Reference< XInterface > xRet( SFX_APP()->GetDialogContainer(), UNO_QUERY ); - xRet->acquire(); - return xRet.get(); + return SFX_APP()->GetDialogContainer(); } //============================================================================ @@ -175,9 +173,7 @@ com_sun_star_comp_sfx2_ApplicationScriptLibraryContainer_get_implementation( css::uno::Sequence const &) { SFX_APP()->GetBasicManager(); - Reference< XInterface > xRet( SFX_APP()->GetBasicContainer(), UNO_QUERY ); - xRet->acquire(); - return xRet.get(); + return SFX_APP()->GetBasicContainer(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appdispatchprovider.cxx b/sfx2/source/appl/appdispatchprovider.cxx index 7774582e5d92..c2b88af54dd4 100644 --- a/sfx2/source/appl/appdispatchprovider.cxx +++ b/sfx2/source/appl/appdispatchprovider.cxx @@ -255,9 +255,7 @@ com_sun_star_comp_sfx2_AppDispatchProvider_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &arguments) { - rtl::Reference x(new SfxAppDispatchProvider(arguments)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 8d59b8478d90..ff5886148a27 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -341,9 +341,7 @@ com_sun_star_comp_sfx2_SfxMacroLoader_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &arguments) { - rtl::Reference x(new SfxMacroLoader(arguments)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 bef401945ac3..a7e2e1b67cd8 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -976,9 +976,7 @@ com_sun_star_comp_desktop_QuickstartWrapper_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new ShutdownIcon(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 5fcc44550d0f..6c654e77a7fe 100644 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx @@ -178,9 +178,7 @@ com_sun_star_comp_embed_PackageStructureCreator_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new OPackageStructureCreator()); - x->acquire(); - return static_cast(x.get()); + return static_cast(new OPackageStructureCreator()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 6052c96a1ba0..fa5cfa81a94e 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -813,9 +813,7 @@ com_sun_star_comp_sfx2_BackingComp_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new BackingComp(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 9e1d2f12ede5..90bb305a80d3 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -2319,9 +2319,7 @@ CompatWriterDocPropsImpl_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new CompatWriterDocPropsImpl(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new CompatWriterDocPropsImpl(context)); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL @@ -2329,9 +2327,7 @@ SfxDocumentMetaData_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new SfxDocumentMetaData(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 11461cdeb643..54d2bf95409f 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -2900,9 +2900,7 @@ com_sun_star_comp_sfx2_DocumentTemplates_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new SfxDocTplService(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 d4d5d5cdcf82..504b2891c795 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -432,9 +432,7 @@ com_sun_star_comp_sfx2_IFrameObject_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &arguments) { - rtl::Reference x(new IFrameObject(context, arguments)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 bb817db1e67a..139f7dac587d 100644 --- a/sfx2/source/doc/ownsubfilterservice.cxx +++ b/sfx2/source/doc/ownsubfilterservice.cxx @@ -126,9 +126,7 @@ com_sun_star_comp_document_OwnSubFilter_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &arguments) { - rtl::Reference x(new OwnSubFilterService(arguments)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 86d4945251ff..b79219624646 100644 --- a/sfx2/source/doc/plugin.cxx +++ b/sfx2/source/doc/plugin.cxx @@ -311,9 +311,7 @@ com_sun_star_comp_sfx2_PluginObject_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new PluginObject()); - x->acquire(); - return static_cast(x.get()); + return static_cast(new PluginObject()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/appbaslib.hxx b/sfx2/source/inc/appbaslib.hxx index 8f804200d20d..2763b75c5a1e 100644 --- a/sfx2/source/inc/appbaslib.hxx +++ b/sfx2/source/inc/appbaslib.hxx @@ -59,7 +59,7 @@ public: */ void reset( BasicManager* _pBasicManager ); - ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer > + ::com::sun::star::script::XLibraryContainer * getLibraryContainer( ContainerType _eType ); /** calls the storeLibraries at both our script and basic library container diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index c565c3d6c9a8..daab66b976e2 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -778,9 +778,7 @@ com_sun_star_comp_office_FrameLoader_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new SfxFrameLoader_Impl(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 c1c07e17079e..a5446f2d30f0 100644 --- a/stoc/source/defaultregistry/defaultregistry.cxx +++ b/stoc/source/defaultregistry/defaultregistry.cxx @@ -1355,9 +1355,7 @@ com_sun_star_comp_stoc_NestedRegistry_get_implementation( SAL_UNUSED_PARAMETER css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new NestedRegistryImpl); - x->acquire(); - return static_cast(x.get()); + return static_cast(new NestedRegistryImpl); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index e5daf98392f8..e594dbda1a06 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -1821,9 +1821,7 @@ com_sun_star_comp_stoc_ImplementationRegistration_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new ImplementationRegistration(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 14fc172cd4a6..4b90cdc133f0 100644 --- a/stoc/source/loader/dllcomponentloader.cxx +++ b/stoc/source/loader/dllcomponentloader.cxx @@ -170,9 +170,7 @@ com_sun_star_comp_stoc_DLLComponentLoader_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new DllComponentLoader(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 2e6c84bac924..90d46f7727c8 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -984,9 +984,7 @@ com_sun_star_security_comp_stoc_AccessController_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new AccessController(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 4cd5e8c000ab..6766aff2f8f2 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -545,9 +545,7 @@ com_sun_star_security_comp_stoc_FilePolicy_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new FilePolicy(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 1dd406ec89e0..9d206c44a9d2 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -1676,9 +1676,7 @@ com_sun_star_comp_stoc_OServiceManager_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new OServiceManager(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new OServiceManager(context)); } 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::Sequence const &) { - rtl::Reference x(new ORegistryServiceManager(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new ORegistryServiceManager(context)); } 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::Sequence const &) { - rtl::Reference x(new OServiceManagerWrapper(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 96230e17ab97..bddc67be127d 100644 --- a/stoc/source/simpleregistry/simpleregistry.cxx +++ b/stoc/source/simpleregistry/simpleregistry.cxx @@ -1128,9 +1128,7 @@ com_sun_star_comp_stoc_SimpleRegistry_get_implementation( SAL_UNUSED_PARAMETER css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new SimpleRegistry); - x->acquire(); - return static_cast(x.get()); + return static_cast(new SimpleRegistry); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx index 3d02a9f641d1..8311d83d53cb 100644 --- a/svtools/source/filter/SvFilterOptionsDialog.cxx +++ b/svtools/source/filter/SvFilterOptionsDialog.cxx @@ -304,9 +304,7 @@ com_sun_star_svtools_SvFilterOptionsDialog_get_implementation( css::uno::XComponentContext * context, css::uno::Sequence const &) { - rtl::Reference x(new SvFilterOptionsDialog(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 40c456760465..5ba8db405b0a 100644 --- a/svtools/source/graphic/graphicunofactory.cxx +++ b/svtools/source/graphic/graphicunofactory.cxx @@ -115,9 +115,7 @@ com_sun_star_graphic_GraphicObject_get_implementation( SAL_UNUSED_PARAMETER css::uno::XComponentContext *, css::uno::Sequence const &arguments) { - rtl::Reference x(new GObjectImpl(arguments)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 b2ea034b8fd6..9f99ce47f584 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -861,9 +861,7 @@ com_sun_star_comp_graphic_GraphicProvider_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new GraphicProvider); - x->acquire(); - return static_cast(x.get()); + return static_cast(new GraphicProvider); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx index 0621e570a467..40280d8b6ba7 100644 --- a/svtools/source/graphic/renderer.cxx +++ b/svtools/source/graphic/renderer.cxx @@ -297,9 +297,7 @@ com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new GraphicRendererVCL); - x->acquire(); - return static_cast(x.get()); + return static_cast(new GraphicRendererVCL); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx index 94058f25d8f7..86a64ff7b24c 100644 --- a/svtools/source/hatchwindow/documentcloser.cxx +++ b/svtools/source/hatchwindow/documentcloser.cxx @@ -252,9 +252,7 @@ com_sun_star_comp_embed_DocumentCloser_get_implementation( SAL_UNUSED_PARAMETER css::uno::XComponentContext *, css::uno::Sequence const &arguments) { - rtl::Reference x(new ODocumentCloser(arguments)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 afa3f3322533..2a581d07ced3 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -89,9 +89,7 @@ com_sun_star_comp_embed_HatchWindowFactory_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new OHatchWindowFactory); - x->acquire(); - return static_cast(x.get()); + return static_cast(new OHatchWindowFactory); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx index 73b2c18ec010..c90b4c07d8c2 100644 --- a/svtools/source/uno/addrtempuno.cxx +++ b/svtools/source/uno/addrtempuno.cxx @@ -228,9 +228,7 @@ com_sun_star_comp_svtools_OAddressBookSourceDialogUno_get_implementation( css::uno::XComponentContext * context, css::uno::Sequence const &) { - rtl::Reference x(new OAddressBookSourceDialogUno(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 7fbd2d4b6cd8..870315357eb1 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -502,9 +502,7 @@ com_sun_star_comp_svtools_uno_Wizard_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new Wizard(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 2c3cd3e3f978..dfe1711c4883 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -494,9 +494,7 @@ com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new EnhancedCustomShapeEngine); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 ded21f9db57b..eb5ad2dd6b39 100644 --- a/svx/source/sdr/primitive2d/primitivefactory2d.cxx +++ b/svx/source/sdr/primitive2d/primitivefactory2d.cxx @@ -93,9 +93,7 @@ com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new PrimitiveFactory2D); - x->acquire(); - return static_cast(x.get()); + return static_cast(new PrimitiveFactory2D); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index 26352c004ae1..fb5be3012f37 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -209,7 +209,5 @@ org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new PanelFactory); - x->acquire(); - return static_cast(x.get()); + return static_cast(new PanelFactory); } diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index d93065ea531a..9ab903cf851f 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -444,9 +444,7 @@ com_sun_star_svx_FontHeightToolBoxController_get_implementation( css::uno::XComponentContext *rxContext, css::uno::Sequence const &) { - rtl::Reference x(new FontHeightToolBoxControl(rxContext)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 05c6bfe80d8c..120769188b80 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -1055,9 +1055,7 @@ com_sun_star_svx_FindTextToolboxController_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new FindTextToolbarController(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new FindTextToolbarController(context)); } 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::Sequence const &) { - rtl::Reference x(new ExitSearchToolboxController(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new ExitSearchToolboxController(context)); } 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::Sequence const &) { - rtl::Reference x(new UpDownSearchToolboxController( - context, UpDownSearchToolboxController::UP)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::UP)); } 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::Sequence const &) { - rtl::Reference x(new UpDownSearchToolboxController( - context, UpDownSearchToolboxController::DOWN)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::DOWN)); } 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::Sequence const &) { - rtl::Reference x(new MatchCaseToolboxController(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new MatchCaseToolboxController(context)); } 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::Sequence const &) { - rtl::Reference x(new FindAllToolboxController(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new FindAllToolboxController(context)); } 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 *, css::uno::Sequence const &) { - rtl::Reference x(new FindbarDispatcher); - x->acquire(); - return static_cast(x.get()); + return static_cast(new FindbarDispatcher); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 7a611be3cf3b..ace45e8466f0 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -1285,9 +1285,7 @@ com_sun_star_comp_Draw_GraphicExporter_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new GraphicExporter); - x->acquire(); - return static_cast(x.get()); + return static_cast(new GraphicExporter); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index 5fdb5f228eaa..ea34f6c1cb10 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -425,9 +425,7 @@ com_sun_star_comp_svx_RecoveryUI_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - rtl::Reference x(new RecoveryUI(context)); - x->acquire(); - return static_cast(x.get()); + return static_cast(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 b707904edd52..ec8fcc848d18 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -190,9 +190,7 @@ com_sun_star_drawing_SvxUnoColorTable_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new SvxUnoColorTable); - x->acquire(); - return static_cast(x.get()); + return static_cast(new SvxUnoColorTable); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index 8b873acf6ed1..a3d187a2b15d 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -274,9 +274,7 @@ com_sun_star_drawing_SvxShapeCollection_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new SvxShapeCollection); - x->acquire(); - return static_cast(x.get()); + return static_cast(new SvxShapeCollection); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx index 2fcaec8ff295..ece74206b9de 100644 --- a/svx/source/unogallery/unogalthemeprovider.cxx +++ b/svx/source/unogallery/unogalthemeprovider.cxx @@ -236,9 +236,7 @@ com_sun_star_comp_gallery_GalleryThemeProvider_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x(new GalleryThemeProvider); - x->acquire(); - return static_cast(x.get()); + return static_cast(new GalleryThemeProvider); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index f9bad053927c..c285806682b8 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -1055,10 +1055,7 @@ com_sun_star_comp_Svx_GraphicImportHelper_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x( - new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ)); } /** Create this with createInstanceWithArguments. service name @@ -1078,10 +1075,7 @@ com_sun_star_comp_Svx_GraphicExportHelper_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { - rtl::Reference x( - new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE)); - x->acquire(); - return static_cast(x.get()); + return static_cast(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */