diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-02-16 12:20:44 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-02-16 12:32:24 +0100 |
commit | 15003612ae3a7fc5ca994548d9792349787c68d1 (patch) | |
tree | 90d9c7fd1ff14b5477487c939cf08a9b9e2232d0 /desktop | |
parent | 5f5504a0c132fcfafe83927452d8280858eef16b (diff) |
Clean up some supportsService implementations
Change-Id: Ib74400765a6e0ef203e751afa5433a01c8564fee
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 7 | ||||
-rw-r--r-- | desktop/source/deployment/registry/package/dp_package.cxx | 7 | ||||
-rw-r--r-- | desktop/source/migration/services/basicmigration.cxx | 12 | ||||
-rw-r--r-- | desktop/source/migration/services/jvmfwk.cxx | 13 | ||||
-rw-r--r-- | desktop/source/migration/services/oo3extensionmigration.cxx | 12 | ||||
-rw-r--r-- | desktop/source/migration/services/wordbookmigration.cxx | 12 | ||||
-rw-r--r-- | desktop/source/offacc/acceptor.cxx | 8 |
7 files changed, 28 insertions, 43 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 129e8842b4c4..d26cf08bda63 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -38,6 +38,7 @@ #include <rtl/bootstrap.hxx> #include <rtl/strbuf.hxx> #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <osl/file.hxx> #include <rtl/process.h> #include "tools/getprocessworkingdir.hxx" @@ -310,10 +311,10 @@ throw ( RuntimeException ) return OUString( "com.sun.star.comp.OfficeIPCThreadController" ); } -sal_Bool SAL_CALL OfficeIPCThreadController::supportsService( const OUString& ) -throw ( RuntimeException ) +sal_Bool OfficeIPCThreadController::supportsService( + OUString const & ServiceName) throw (css::uno::RuntimeException) { - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > SAL_CALL OfficeIPCThreadController::getSupportedServiceNames() diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index fde4eed4bfb0..3d5c2360f399 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -29,6 +29,7 @@ #include "rtl/uri.hxx" #include "cppuhelper/exc_hlp.hxx" #include "cppuhelper/implbase1.hxx" +#include "cppuhelper/supportsservice.hxx" #include "ucbhelper/content.hxx" #include "svl/inettype.hxx" #include "comphelper/anytostring.hxx" @@ -329,10 +330,10 @@ OUString BackendImpl::getImplementationName() throw (RuntimeException) return OUString("com.sun.star.comp.deployment.bundle.PackageRegistryBackend"); } -sal_Bool BackendImpl::supportsService( OUString const& name ) - throw (RuntimeException) +sal_Bool BackendImpl::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - return getSupportedServiceNames()[0].equals(name); + return cppu::supportsService(this, ServiceName); } Sequence<OUString> BackendImpl::getSupportedServiceNames() diff --git a/desktop/source/migration/services/basicmigration.cxx b/desktop/source/migration/services/basicmigration.cxx index f153b5fd941a..99bbe7687da0 100644 --- a/desktop/source/migration/services/basicmigration.cxx +++ b/desktop/source/migration/services/basicmigration.cxx @@ -18,6 +18,7 @@ */ #include "basicmigration.hxx" +#include <cppuhelper/supportsservice.hxx> #include <tools/urlobj.hxx> #include <unotools/bootstrap.hxx> @@ -168,15 +169,10 @@ namespace migration // ----------------------------------------------------------------------------- - sal_Bool BasicMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) + sal_Bool BasicMigration::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); - const ::rtl::OUString* pNames = aNames.getConstArray(); - const ::rtl::OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, ServiceName); } // ----------------------------------------------------------------------------- diff --git a/desktop/source/migration/services/jvmfwk.cxx b/desktop/source/migration/services/jvmfwk.cxx index db8762276456..9cb9460d88c0 100644 --- a/desktop/source/migration/services/jvmfwk.cxx +++ b/desktop/source/migration/services/jvmfwk.cxx @@ -20,6 +20,7 @@ #include "cppuhelper/implbase4.hxx" #include "cppuhelper/implementationentry.hxx" +#include "cppuhelper/supportsservice.hxx" #include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" @@ -233,18 +234,10 @@ OUString SAL_CALL JavaMigration::getImplementationName() return jvmfwk_getImplementationName(); } -sal_Bool SAL_CALL JavaMigration::supportsService( const OUString & rServiceName ) +sal_Bool JavaMigration::supportsService(OUString const & ServiceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > const & rSNL = getSupportedServiceNames(); - OUString const * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (rServiceName.equals( pArray[ nPos ] )) - return true; - } - return false; - + return cppu::supportsService(this, ServiceName); } css::uno::Sequence< OUString > SAL_CALL JavaMigration::getSupportedServiceNames() diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index a8f1f419cf20..6ca9cc22d25e 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -28,6 +28,7 @@ #include <unotools/textsearch.hxx> #include <comphelper/sequence.hxx> #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <ucbhelper/content.hxx> #include <com/sun/star/task/XInteractionApprove.hpp> @@ -350,15 +351,10 @@ bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir // ----------------------------------------------------------------------------- -sal_Bool OO3ExtensionMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) +sal_Bool OO3ExtensionMigration::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); - const ::rtl::OUString* pNames = aNames.getConstArray(); - const ::rtl::OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, ServiceName); } // ----------------------------------------------------------------------------- diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index e34c550b7fba..717d6ac257e6 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -18,6 +18,7 @@ */ #include "wordbookmigration.hxx" +#include <cppuhelper/supportsservice.hxx> #include <tools/urlobj.hxx> #include <unotools/bootstrap.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -234,15 +235,10 @@ bool IsUserWordbook( const ::rtl::OUString& rFile ) // ----------------------------------------------------------------------------- - sal_Bool WordbookMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) + sal_Bool WordbookMigration::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); - const ::rtl::OUString* pNames = aNames.getConstArray(); - const ::rtl::OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, ServiceName); } // ----------------------------------------------------------------------------- diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index 7cfa23452768..2402a889746a 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/uno/XNamingService.hpp> #include <comphelper/processfactory.hxx> #include <cppuhelper/factory.hxx> +#include <cppuhelper/supportsservice.hxx> namespace desktop { @@ -205,10 +206,11 @@ Sequence<OUString> SAL_CALL Acceptor::getSupportedServiceNames() { return Acceptor::impl_getSupportedServiceNames(); } -sal_Bool SAL_CALL Acceptor::supportsService( const OUString&) - throw (RuntimeException) + +sal_Bool Acceptor::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - return sal_False; + return cppu::supportsService(this, ServiceName); } // Factory |