summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-23 14:35:10 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-25 08:19:58 +0000
commit704f95e5255ff72bfb548d50d66d4da61dc483ef (patch)
tree3b0799aa8ce5185f4775966f733e1acb2df6285c /avmedia
parenta95ecd8b65ea2275a66f6694f0c09e3faaef4407 (diff)
fdo#54938: More uses of cppu::supportsService
Change-Id: I90a7a07a43559b8d7e1d4b886b2624255200d46b Reviewed-on: https://gerrit.libreoffice.org/6406 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/framework/soundhandler.cxx41
1 files changed, 6 insertions, 35 deletions
diff --git a/avmedia/source/framework/soundhandler.cxx b/avmedia/source/framework/soundhandler.cxx
index bf70b6e2261d..b9e76a2c052f 100644
--- a/avmedia/source/framework/soundhandler.cxx
+++ b/avmedia/source/framework/soundhandler.cxx
@@ -29,6 +29,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
namespace avmedia{
@@ -134,47 +135,19 @@ OUString SAL_CALL SoundHandler::getImplementationName() throw( css::uno::Runtime
return impl_getStaticImplementationName();
}
-/*===========================================================================================================*/
-/* XServiceInfo */
-/*===========================================================================================================*/
+// XServiceInfo
sal_Bool SAL_CALL SoundHandler::supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException )
{
- /* Set default return value. */
- bool bReturn = sal_False ;
- /* Get names of all supported servicenames. */
- css::uno::Sequence < OUString > seqServiceNames = getSupportedServiceNames();
- const OUString* pArray = seqServiceNames.getConstArray();
- sal_Int32 nCounter = 0;
- sal_Int32 nLength = seqServiceNames.getLength();
- /* Search for right name in list. */
- while (
- ( nCounter < nLength ) &&
- ( bReturn == sal_False )
- )
- {
- /* Is name was found, say "YES, SERVICE IS SUPPORTED." and break loop. */
- if ( pArray[nCounter] == sServiceName )
- {
- bReturn = sal_True ;
- }
- /* Else step to next element in list. */
- ++nCounter;
- }
- /* Return state of search. */
- return bReturn;
+ return cppu::supportsService(this, sServiceName);
}
-/*===========================================================================================================*/
-/* XServiceInfo */
-/*===========================================================================================================*/
+// XServiceInfo
css::uno::Sequence< OUString > SAL_CALL SoundHandler::getSupportedServiceNames() throw( css::uno::RuntimeException )
{
return impl_getStaticSupportedServiceNames();
}
-/*===========================================================================================================*/
-/* Helper for XServiceInfo */
-/*===========================================================================================================*/
+// Helper for XServiceInfo
css::uno::Sequence< OUString > SoundHandler::impl_getStaticSupportedServiceNames()
{
css::uno::Sequence< OUString > seqServiceNames( 1 );
@@ -182,9 +155,7 @@ css::uno::Sequence< OUString > SoundHandler::impl_getStaticSupportedServiceNames
return seqServiceNames;
}
-/*===========================================================================================================*/
-/* Helper for XServiceInfo */
-/*===========================================================================================================*/
+// Helper for XServiceInfo
OUString SoundHandler::impl_getStaticImplementationName()
{
return IMPLEMENTATIONNAME_SOUNDHANDLER;