From 66b602e2315f91faf4c28ea9b72bfe188e0eec9c Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Thu, 5 Dec 2013 12:53:35 -0200 Subject: fdo#54938: Convert io to use cppu::supportsService Change-Id: Id53289a68352558b039e0993b687d0447cea8036 Signed-off-by: Stephan Bergmann --- io/source/stm/omark.cxx | 25 +++---------------------- io/source/stm/opipe.cxx | 15 ++------------- io/source/stm/opump.cxx | 13 ++----------- 3 files changed, 7 insertions(+), 46 deletions(-) (limited to 'io') diff --git a/io/source/stm/omark.cxx b/io/source/stm/omark.cxx index 44baddc36d9b..7f0261e40b41 100644 --- a/io/source/stm/omark.cxx +++ b/io/source/stm/omark.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -429,14 +430,7 @@ OUString OMarkableOutputStream::getImplementationName() throw () // XServiceInfo sal_Bool OMarkableOutputStream::supportsService(const OUString& ServiceName) throw () { - 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); } // XServiceInfo @@ -445,9 +439,6 @@ Sequence< OUString > OMarkableOutputStream::getSupportedServiceNames(void) throw return OMarkableOutputStream_getSupportedServiceNames(); } - - - /*------------------------ * * external binding @@ -946,8 +937,6 @@ void OMarkableInputStream::checkMarksAndFlush() } } - - // XServiceInfo OUString OMarkableInputStream::getImplementationName() throw () { @@ -957,14 +946,7 @@ OUString OMarkableInputStream::getImplementationName() throw () // XServiceInfo sal_Bool OMarkableInputStream::supportsService(const OUString& ServiceName) throw () { - 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); } // XServiceInfo @@ -973,7 +955,6 @@ Sequence< OUString > OMarkableInputStream::getSupportedServiceNames(void) throw return OMarkableInputStream_getSupportedServiceNames(); } - /*------------------------ * * external binding diff --git a/io/source/stm/opipe.cxx b/io/source/stm/opipe.cxx index b59496722008..847a9a0bb351 100644 --- a/io/source/stm/opipe.cxx +++ b/io/source/stm/opipe.cxx @@ -27,8 +27,8 @@ #include #include - #include +#include #include #include @@ -415,14 +415,7 @@ OUString OPipeImpl::getImplementationName() throw( ) // XServiceInfo sal_Bool OPipeImpl::supportsService(const OUString& ServiceName) throw( ) { - 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); } // XServiceInfo @@ -431,10 +424,6 @@ Sequence< OUString > OPipeImpl::getSupportedServiceNames(void) throw( ) return OPipeImpl_getSupportedServiceNames(); } - - - - /* implementation functions * * diff --git a/io/source/stm/opump.cxx b/io/source/stm/opump.cxx index 72f1570f23cd..93b4f51e49ed 100644 --- a/io/source/stm/opump.cxx +++ b/io/source/stm/opump.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -430,15 +431,12 @@ void Pump::setOutputStream( const Reference< XOutputStream >& xOut ) throw() // data transfer starts in XActiveDataControl::start } -// ------------------------------------------------------------ - Reference< XOutputStream > Pump::getOutputStream() throw() { Guard< Mutex > aGuard( m_aMutex ); return m_xOutput; } - // XServiceInfo OUString Pump::getImplementationName() throw( ) { @@ -448,14 +446,7 @@ OUString Pump::getImplementationName() throw( ) // XServiceInfo sal_Bool Pump::supportsService(const OUString& ServiceName) throw( ) { - 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); } // XServiceInfo -- cgit