From ee5661ecd3bbeae38b04cd3f582a320a231d11bd Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Mon, 21 Oct 2013 19:04:05 -0200 Subject: fdo#54938: Adapt supportsService implementations.. to cppu::supportsService Change-Id: I0b03d3910f094f2183bf9859db9d5bcaf35d1f14 Reviewed-on: https://gerrit.libreoffice.org/6370 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- io/source/TextInputStream/TextInputStream.cxx | 10 ++---- io/source/TextOutputStream/TextOutputStream.cxx | 10 ++---- io/source/acceptor/acceptor.cxx | 10 ++---- io/source/connector/connector.cxx | 10 ++---- io/source/stm/odata.cxx | 43 +++---------------------- 5 files changed, 13 insertions(+), 70 deletions(-) (limited to 'io/source') diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx index a5b6de3bff41..bf712317aa67 100644 --- a/io/source/TextInputStream/TextInputStream.cxx +++ b/io/source/TextInputStream/TextInputStream.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -452,14 +453,7 @@ OUString OTextInputStream::getImplementationName() throw() sal_Bool OTextInputStream::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); } Sequence< OUString > OTextInputStream::getSupportedServiceNames(void) throw() diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx index 53487ddb278c..f7d309c1d162 100644 --- a/io/source/TextOutputStream/TextOutputStream.cxx +++ b/io/source/TextOutputStream/TextOutputStream.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -251,14 +252,7 @@ OUString OTextOutputStream::getImplementationName() throw() sal_Bool OTextOutputStream::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); } Sequence< OUString > OTextOutputStream::getSupportedServiceNames(void) throw() diff --git a/io/source/acceptor/acceptor.cxx b/io/source/acceptor/acceptor.cxx index 8f94584f921b..61059e6894f0 100644 --- a/io/source/acceptor/acceptor.cxx +++ b/io/source/acceptor/acceptor.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include "cppuhelper/unourl.hxx" #include "rtl/malformeduriexception.hxx" @@ -291,14 +292,7 @@ namespace io_acceptor sal_Bool OAcceptor::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); } Sequence< OUString > OAcceptor::getSupportedServiceNames(void) throw() diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx index 22bee639e9fd..966a2b6f5f60 100644 --- a/io/source/connector/connector.cxx +++ b/io/source/connector/connector.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include "cppuhelper/unourl.hxx" #include "rtl/malformeduriexception.hxx" @@ -192,14 +193,7 @@ namespace stoc_connector sal_Bool OConnector::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); } Sequence< OUString > OConnector::getSupportedServiceNames(void) throw() diff --git a/io/source/stm/odata.cxx b/io/source/stm/odata.cxx index 18f07cbe1e9f..dcc471673d99 100644 --- a/io/source/stm/odata.cxx +++ b/io/source/stm/odata.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -461,14 +462,7 @@ OUString ODataInputStream::getImplementationName() throw () // XServiceInfo sal_Bool ODataInputStream::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 @@ -869,14 +863,7 @@ OUString ODataOutputStream::getImplementationName() throw () // XServiceInfo sal_Bool ODataOutputStream::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 @@ -885,9 +872,6 @@ Sequence< OUString > ODataOutputStream::getSupportedServiceNames(void) throw () return ODataOutputStream_getSupportedServiceNames(); } - - - Reference< XInterface > SAL_CALL ODataOutputStream_CreateInstance( SAL_UNUSED_PARAMETER const Reference < XComponentContext > & ) throw(Exception) @@ -1195,14 +1179,7 @@ OUString OObjectOutputStream::getImplementationName() throw () // XServiceInfo sal_Bool OObjectOutputStream::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 @@ -1470,14 +1447,7 @@ OUString OObjectInputStream::getImplementationName() throw () // XServiceInfo sal_Bool OObjectInputStream::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 @@ -1486,9 +1456,6 @@ Sequence< OUString > OObjectInputStream::getSupportedServiceNames(void) throw () return OObjectInputStream_getSupportedServiceNames(); } - - - Reference< XInterface > SAL_CALL OObjectInputStream_CreateInstance( const Reference < XComponentContext > & rCtx ) throw(Exception) { OObjectInputStream *p = new OObjectInputStream( rCtx ); -- cgit