diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-21 19:04:05 -0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-22 10:28:10 +0000 |
commit | ee5661ecd3bbeae38b04cd3f582a320a231d11bd (patch) | |
tree | 381d9afa0c831145551ade40b6d68f22919baaf6 /io/source | |
parent | c82a36f9c7d89fa434d3dff896c290964326f5bf (diff) |
fdo#54938: Adapt supportsService implementations..
to cppu::supportsService
Change-Id: I0b03d3910f094f2183bf9859db9d5bcaf35d1f14
Reviewed-on: https://gerrit.libreoffice.org/6370
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'io/source')
-rw-r--r-- | io/source/TextInputStream/TextInputStream.cxx | 10 | ||||
-rw-r--r-- | io/source/TextOutputStream/TextOutputStream.cxx | 10 | ||||
-rw-r--r-- | io/source/acceptor/acceptor.cxx | 10 | ||||
-rw-r--r-- | io/source/connector/connector.cxx | 10 | ||||
-rw-r--r-- | io/source/stm/odata.cxx | 43 |
5 files changed, 13 insertions, 70 deletions
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 <cppuhelper/factory.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <rtl/textenc.h> #include <rtl/tencinfo.h> @@ -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 <cppuhelper/factory.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <rtl/textenc.h> #include <rtl/tencinfo.h> @@ -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 <cppuhelper/factory.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #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 <cppuhelper/factory.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #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 <cppuhelper/factory.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase4.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/io/XObjectInputStream.hpp> #include <com/sun/star/io/XObjectOutputStream.hpp> @@ -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 ); |