From 2a32bf29b98403872235f880e91b1c08cd3d7f68 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 18 Sep 2012 12:47:55 +0200 Subject: Make getProcessComponentContext/ServiceFactory throw instead of returning null ...with the same rationale as recent 543158edba6678d3d76eee983a9d4edd2a422fee "Require XComponentContext.getServiceManager to throw instead of returning null" (this helps find problems like 065a758d0c2b66c6683d648347b7a6cdef4a80f7 "Enable experimental gtk3 plugin only via SAL_USE_VCLPLUGIN"). Removed comphelper::createProcessComponent[WithAguments] and replaced its few uses with direct calls to createInstance[WithArguments]. Change-Id: Ia44b8656f74de88ef6eab3eb6bd597729b08e1c8 --- comphelper/inc/comphelper/processfactory.hxx | 30 +++++++--------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'comphelper/inc') diff --git a/comphelper/inc/comphelper/processfactory.hxx b/comphelper/inc/comphelper/processfactory.hxx index dbcd647ee54e..e6833fc49327 100644 --- a/comphelper/inc/comphelper/processfactory.hxx +++ b/comphelper/inc/comphelper/processfactory.hxx @@ -39,34 +39,17 @@ namespace comphelper COMPHELPER_DLLPUBLIC void setProcessServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr); /** - * This function get the process service factory. If no service factory is set the function returns - * a null interface. + * This function gets the process service factory. + * + * If no service factory is set the function throws a RuntimeException. * * @author Juergen Schmidt */ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getProcessServiceFactory(); -/** creates a component, using the process factory if set - @see getProcessServiceFactory - @see setProcessServiceFactory -*/ -COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - createProcessComponent( - const ::rtl::OUString& _rServiceSpecifier - ) SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) ); - -/** creates a component with arguments, using the process factory if set +/** Obtains a component context from a service factory. - @see getProcessServiceFactory - @see setProcessServiceFactory -*/ -COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - createProcessComponentWithArguments( - const ::rtl::OUString& _rServiceSpecifier, - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArgs - ) SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) ); - -/** Tries to obtain a component context from a service factory. + Throws a RuntimeException if no component context can be obtained. @param factory may be null @return may be null @@ -79,7 +62,8 @@ getComponentContext( /** * This function gets the process service factory's default component context. - * If no service factory is set the function returns a null interface. + * + * Throws a RuntimeException if no component context can be obtained. */ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > -- cgit