From 6ad41af76fc5a101e553472dd070b065a3e8b28c Mon Sep 17 00:00:00 2001 From: Alexandre Vicenzi Date: Fri, 31 Jan 2014 06:10:13 -0200 Subject: fdo#54938 Convert dtrans, remoteb., reportd., ucbhelper to cppu::supportsSer.. Change-Id: I42cf7dc139b79b715f3c330f9bca7d333de8bafc Reviewed-on: https://gerrit.libreoffice.org/7762 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- .../source/unourl_resolver/unourl_resolver.cxx | 44 ++++++++-------------- 1 file changed, 15 insertions(+), 29 deletions(-) (limited to 'remotebridges') diff --git a/remotebridges/source/unourl_resolver/unourl_resolver.cxx b/remotebridges/source/unourl_resolver/unourl_resolver.cxx index 3114b3ee3eef..c926ea16c8d9 100644 --- a/remotebridges/source/unourl_resolver/unourl_resolver.cxx +++ b/remotebridges/source/unourl_resolver/unourl_resolver.cxx @@ -17,21 +17,22 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include -#include "cppuhelper/unourl.hxx" #include "rtl/malformeduriexception.hxx" -#include #include -#include -#include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include "cppuhelper/unourl.hxx" +#include +#include using namespace cppu; using namespace osl; @@ -47,7 +48,7 @@ using namespace com::sun::star::registry; namespace unourl_resolver { -//-------------------------------------------------------------------------------------------------- + Sequence< OUString > resolver_getSupportedServiceNames() { Sequence< OUString > seqNames(1); @@ -60,7 +61,6 @@ OUString resolver_getImplementationName() return OUString(IMPLNAME); } -//================================================================================================== class ResolverImpl : public WeakImplHelper2< XServiceInfo, XUnoUrlResolver > { Reference< XMultiComponentFactory > _xSMgr; @@ -80,37 +80,26 @@ public: throw (NoConnectException, ConnectionSetupException, RuntimeException); }; -//################################################################################################## - -//__________________________________________________________________________________________________ ResolverImpl::ResolverImpl( const Reference< XComponentContext > & xCtx ) : _xSMgr( xCtx->getServiceManager() ) , _xCtx( xCtx ) {} -//__________________________________________________________________________________________________ + ResolverImpl::~ResolverImpl() {} // XServiceInfo -//__________________________________________________________________________________________________ OUString ResolverImpl::getImplementationName() throw(::com::sun::star::uno::RuntimeException) { return resolver_getImplementationName(); } -//__________________________________________________________________________________________________ + sal_Bool ResolverImpl::supportsService( const OUString & rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } -//__________________________________________________________________________________________________ + Sequence< OUString > ResolverImpl::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) { @@ -118,7 +107,6 @@ Sequence< OUString > ResolverImpl::getSupportedServiceNames() } // XUnoUrlResolver -//__________________________________________________________________________________________________ Reference< XInterface > ResolverImpl::resolve( const OUString & rUnoUrl ) throw (NoConnectException, ConnectionSetupException, RuntimeException) { @@ -161,13 +149,11 @@ Reference< XInterface > ResolverImpl::resolve( const OUString & rUnoUrl ) return xRet; } -//================================================================================================== static Reference< XInterface > SAL_CALL ResolverImpl_create( const Reference< XComponentContext > & xCtx ) { return Reference< XInterface >( *new ResolverImpl( xCtx ) ); } - } using namespace unourl_resolver; -- cgit