summaryrefslogtreecommitdiff
path: root/remotebridges
diff options
context:
space:
mode:
authorAlexandre Vicenzi <vicenzi.alexandre@gmail.com>2014-01-31 06:10:13 -0200
committerStephan Bergmann <sbergman@redhat.com>2014-02-04 10:16:33 +0000
commit6ad41af76fc5a101e553472dd070b065a3e8b28c (patch)
treeeef1b35947da8369309ee3347b817bd17e615d43 /remotebridges
parenta4835f66dd8335c9565af9d68630beadcba9a607 (diff)
fdo#54938 Convert dtrans, remoteb., reportd., ucbhelper to cppu::supportsSer..
Change-Id: I42cf7dc139b79b715f3c330f9bca7d333de8bafc Reviewed-on: https://gerrit.libreoffice.org/7762 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'remotebridges')
-rw-r--r--remotebridges/source/unourl_resolver/unourl_resolver.cxx44
1 files changed, 15 insertions, 29 deletions
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 <osl/diagnose.h>
-#include <osl/mutex.hxx>
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include "cppuhelper/unourl.hxx"
#include "rtl/malformeduriexception.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/connection/XConnector.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/bridge/BridgeFactory.hpp>
#include <com/sun/star/bridge/XBridgeFactory.hpp>
#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
+#include <com/sun/star/connection/XConnector.hpp>
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <cppuhelper/factory.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
+#include "cppuhelper/unourl.hxx"
+#include <osl/diagnose.h>
+#include <osl/mutex.hxx>
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;