fdo#54938: Convert io to use cppu::supportsService

Change-Id: Id53289a68352558b039e0993b687d0447cea8036
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Marcos Paulo de Souza
2013-12-05 12:53:35 -02:00
committed by Stephan Bergmann
parent 2f50ce6cfa
commit 66b602e231
3 changed files with 7 additions and 46 deletions

View File

@@ -32,6 +32,7 @@
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <cppuhelper/weak.hxx> #include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase5.hxx> #include <cppuhelper/implbase5.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
@@ -429,14 +430,7 @@ OUString OMarkableOutputStream::getImplementationName() throw ()
// XServiceInfo // XServiceInfo
sal_Bool OMarkableOutputStream::supportsService(const OUString& ServiceName) throw () sal_Bool OMarkableOutputStream::supportsService(const OUString& ServiceName) throw ()
{ {
Sequence< OUString > aSNL = getSupportedServiceNames(); return cppu::supportsService(this, ServiceName);
const OUString * pArray = aSNL.getConstArray();
for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
if( pArray[i] == ServiceName )
return sal_True;
return sal_False;
} }
// XServiceInfo // XServiceInfo
@@ -445,9 +439,6 @@ Sequence< OUString > OMarkableOutputStream::getSupportedServiceNames(void) throw
return OMarkableOutputStream_getSupportedServiceNames(); return OMarkableOutputStream_getSupportedServiceNames();
} }
/*------------------------ /*------------------------
* *
* external binding * external binding
@@ -946,8 +937,6 @@ void OMarkableInputStream::checkMarksAndFlush()
} }
} }
// XServiceInfo // XServiceInfo
OUString OMarkableInputStream::getImplementationName() throw () OUString OMarkableInputStream::getImplementationName() throw ()
{ {
@@ -957,14 +946,7 @@ OUString OMarkableInputStream::getImplementationName() throw ()
// XServiceInfo // XServiceInfo
sal_Bool OMarkableInputStream::supportsService(const OUString& ServiceName) throw () sal_Bool OMarkableInputStream::supportsService(const OUString& ServiceName) throw ()
{ {
Sequence< OUString > aSNL = getSupportedServiceNames(); return cppu::supportsService(this, ServiceName);
const OUString * pArray = aSNL.getConstArray();
for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
if( pArray[i] == ServiceName )
return sal_True;
return sal_False;
} }
// XServiceInfo // XServiceInfo
@@ -973,7 +955,6 @@ Sequence< OUString > OMarkableInputStream::getSupportedServiceNames(void) throw
return OMarkableInputStream_getSupportedServiceNames(); return OMarkableInputStream_getSupportedServiceNames();
} }
/*------------------------ /*------------------------
* *
* external binding * external binding

View File

@@ -27,8 +27,8 @@
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase3.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/conditn.hxx> #include <osl/conditn.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
@@ -415,14 +415,7 @@ OUString OPipeImpl::getImplementationName() throw( )
// XServiceInfo // XServiceInfo
sal_Bool OPipeImpl::supportsService(const OUString& ServiceName) throw( ) sal_Bool OPipeImpl::supportsService(const OUString& ServiceName) throw( )
{ {
Sequence< OUString > aSNL = getSupportedServiceNames(); return cppu::supportsService(this, ServiceName);
const OUString * pArray = aSNL.getConstArray();
for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
if( pArray[i] == ServiceName )
return sal_True;
return sal_False;
} }
// XServiceInfo // XServiceInfo
@@ -431,10 +424,6 @@ Sequence< OUString > OPipeImpl::getSupportedServiceNames(void) throw( )
return OPipeImpl_getSupportedServiceNames(); return OPipeImpl_getSupportedServiceNames();
} }
/* implementation functions /* implementation functions
* *
* *

View File

@@ -36,6 +36,7 @@
#include <cppuhelper/implbase5.hxx> #include <cppuhelper/implbase5.hxx>
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <cppuhelper/interfacecontainer.hxx> #include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <osl/thread.h> #include <osl/thread.h>
@@ -430,15 +431,12 @@ void Pump::setOutputStream( const Reference< XOutputStream >& xOut ) throw()
// data transfer starts in XActiveDataControl::start // data transfer starts in XActiveDataControl::start
} }
// ------------------------------------------------------------
Reference< XOutputStream > Pump::getOutputStream() throw() Reference< XOutputStream > Pump::getOutputStream() throw()
{ {
Guard< Mutex > aGuard( m_aMutex ); Guard< Mutex > aGuard( m_aMutex );
return m_xOutput; return m_xOutput;
} }
// XServiceInfo // XServiceInfo
OUString Pump::getImplementationName() throw( ) OUString Pump::getImplementationName() throw( )
{ {
@@ -448,14 +446,7 @@ OUString Pump::getImplementationName() throw( )
// XServiceInfo // XServiceInfo
sal_Bool Pump::supportsService(const OUString& ServiceName) throw( ) sal_Bool Pump::supportsService(const OUString& ServiceName) throw( )
{ {
Sequence< OUString > aSNL = getSupportedServiceNames(); return cppu::supportsService(this, ServiceName);
const OUString * pArray = aSNL.getConstArray();
for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
if( pArray[i] == ServiceName )
return sal_True;
return sal_False;
} }
// XServiceInfo // XServiceInfo