diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-21 19:04:05 -0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-22 10:28:10 +0000 |
commit | ee5661ecd3bbeae38b04cd3f582a320a231d11bd (patch) | |
tree | 381d9afa0c831145551ade40b6d68f22919baaf6 /scripting/source/dlgprov | |
parent | c82a36f9c7d89fa434d3dff896c290964326f5bf (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 'scripting/source/dlgprov')
-rw-r--r-- | scripting/source/dlgprov/DialogModelProvider.cxx | 8 | ||||
-rw-r--r-- | scripting/source/dlgprov/dlgprov.cxx | 13 |
2 files changed, 4 insertions, 17 deletions
diff --git a/scripting/source/dlgprov/DialogModelProvider.cxx b/scripting/source/dlgprov/DialogModelProvider.cxx index aee0a9a16ec5..2c1268bdf910 100644 --- a/scripting/source/dlgprov/DialogModelProvider.cxx +++ b/scripting/source/dlgprov/DialogModelProvider.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/resource/XStringResourceManager.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> +#include <cppuhelper/supportsservice.hxx> // component helper namespace namespace comp_DialogModelProvider { @@ -165,12 +166,7 @@ OUString SAL_CALL DialogModelProvider::getImplementationName() throw (css::uno:: ::sal_Bool SAL_CALL DialogModelProvider::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > serviceNames = comp_DialogModelProvider::_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) { - if (serviceNames[i] == serviceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, serviceName); } css::uno::Sequence< OUString > SAL_CALL DialogModelProvider::getSupportedServiceNames() throw (css::uno::RuntimeException) diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index e7954d8c2b41..281eb24d8523 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -44,6 +44,7 @@ #include <cppuhelper/implementationentry.hxx> #include <cppuhelper/exc_hlp.hxx> +#include <cppuhelper/supportsservice.hxx> #include <sfx2/app.hxx> #include <sfx2/objsh.hxx> #include <xmlscript/xmldlg_imexp.hxx> @@ -592,21 +593,11 @@ static OUString aResourceResolverPropName("ResourceResolver"); return getImplementationName_DialogProviderImpl(); } - // ----------------------------------------------------------------------------- - sal_Bool DialogProviderImpl::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } - // ----------------------------------------------------------------------------- - Sequence< OUString > DialogProviderImpl::getSupportedServiceNames( ) throw (RuntimeException) { return getSupportedServiceNames_DialogProviderImpl(); |