summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-21 19:04:05 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-22 10:28:10 +0000
commitee5661ecd3bbeae38b04cd3f582a320a231d11bd (patch)
tree381d9afa0c831145551ade40b6d68f22919baaf6 /ucb
parentc82a36f9c7d89fa434d3dff896c290964326f5bf (diff)
fdo#54938: Adapt supportsService implementations..
to cppu::supportsService Change-Id: I0b03d3910f094f2183bf9859db9d5bcaf35d1f14 Reviewed-on: https://gerrit.libreoffice.org/6370 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/core/cmdenv.cxx10
-rw-r--r--ucb/source/ucp/expand/ucpexpand.cxx16
-rw-r--r--ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx12
3 files changed, 7 insertions, 31 deletions
diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx
index ce3b9d6d346c..0752b59b53e8 100644
--- a/ucb/source/core/cmdenv.cxx
+++ b/ucb/source/core/cmdenv.cxx
@@ -19,6 +19,7 @@
#include "cppuhelper/factory.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include "com/sun/star/lang/IllegalArgumentException.hpp"
#include "cmdenv.hxx"
@@ -88,14 +89,7 @@ sal_Bool SAL_CALL
UcbCommandEnvironment::supportsService( const OUString& ServiceName )
throw ( uno::RuntimeException )
{
- uno::Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString * pArray = aSNL.getConstArray();
- for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- {
- if ( pArray[ i ] == ServiceName )
- return sal_True;
- }
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
//=========================================================================
diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx
index 5648f8bb7942..384133e3945e 100644
--- a/ucb/source/ucp/expand/ucpexpand.cxx
+++ b/ucb/source/ucp/expand/ucpexpand.cxx
@@ -23,6 +23,7 @@
#include "cppuhelper/compbase2.hxx"
#include "cppuhelper/factory.hxx"
#include "cppuhelper/implementationentry.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include "ucbhelper/content.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/lang/DisposedException.hpp"
@@ -155,23 +156,12 @@ uno::Sequence< OUString > ExpandContentProviderImpl::getSupportedServiceNames()
return supportedServices();
}
-//______________________________________________________________________________
-sal_Bool ExpandContentProviderImpl::supportsService(
- OUString const & serviceName )
+sal_Bool ExpandContentProviderImpl::supportsService(OUString const & serviceName )
throw (uno::RuntimeException)
{
-// check();
- uno::Sequence< OUString > supported_services( getSupportedServiceNames() );
- OUString const * ar = supported_services.getConstArray();
- for ( sal_Int32 pos = supported_services.getLength(); pos--; )
- {
- if (ar[ pos ].equals( serviceName ))
- return true;
- }
- return false;
+ return cppu::supportsService(this, serviceName);
}
-//______________________________________________________________________________
OUString ExpandContentProviderImpl::expandUri(
uno::Reference< ucb::XContentIdentifier > const & xIdentifier ) const
{
diff --git a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
index cc64ec27a27e..8611380b006f 100644
--- a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
@@ -25,6 +25,7 @@
*************************************************************************/
#include "cppuhelper/factory.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include "tdoc_documentcontentfactory.hxx"
@@ -64,23 +65,14 @@ OUString SAL_CALL DocumentContentFactory::getImplementationName()
return getImplementationName_Static();
}
-//=========================================================================
// virtual
sal_Bool SAL_CALL
DocumentContentFactory::supportsService( const OUString& ServiceName )
throw ( uno::RuntimeException )
{
- uno::Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString * pArray = aSNL.getConstArray();
- for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- {
- if ( pArray[ i ] == ServiceName )
- return sal_True;
- }
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-//=========================================================================
// virtual
uno::Sequence< OUString > SAL_CALL
DocumentContentFactory::getSupportedServiceNames()