diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-24 14:55:08 -0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-25 08:07:04 +0000 |
commit | da5449da0c056a3a0da239eff2e2b8b66cfd6224 (patch) | |
tree | 6f6698e676726bd8a07f281a9707e448a711d983 /sax | |
parent | 01a13519e2a12e1e9b61bab1437d340e389e44bf (diff) |
fdo#54938: More uses of cppu::supportsService
Change-Id: Id6bed78d92eba52283a17ab3ca66e751c225e48d
Reviewed-on: https://gerrit.libreoffice.org/6423
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 'sax')
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 10 | ||||
-rw-r--r-- | sax/source/expatwrap/saxwriter.cxx | 13 | ||||
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 10 |
3 files changed, 6 insertions, 27 deletions
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 47812e80f06f..d61ac44d872d 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -33,6 +33,7 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/weak.hxx> #include <cppuhelper/implbase3.hxx> +#include <cppuhelper/supportsservice.hxx> #include <expat.h> @@ -629,14 +630,7 @@ OUString SaxExpatParser::getImplementationName() throw () // XServiceInfo sal_Bool SaxExpatParser::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 diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 567b2380b40d..34338731aa41 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -34,6 +34,7 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/weak.hxx> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <rtl/strbuf.hxx> #include <rtl/byteseq.hxx> @@ -1014,7 +1015,6 @@ static inline sal_Bool isFirstCharWhitespace( const sal_Unicode *p ) throw() return *p == ' '; } - // XServiceInfo OUString SAXWriter::getImplementationName() throw() { @@ -1024,14 +1024,7 @@ OUString SAXWriter::getImplementationName() throw() // XServiceInfo sal_Bool SAXWriter::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 @@ -1042,8 +1035,6 @@ Sequence< OUString > SAXWriter::getSupportedServiceNames(void) throw () return seq; } - - void SAXWriter::startDocument() throw(SAXException, RuntimeException ) { if( m_bDocStarted || ! m_out.is() || !mp_SaxWriterHelper ) { diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 7ddfcff29e33..ddade744ddaf 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/xml/sax/SAXParseException.hpp> #include <com/sun/star/xml/sax/FastToken.hpp> +#include <cppuhelper/supportsservice.hxx> #include "fastparser.hxx" @@ -706,14 +707,7 @@ OUString FastSaxParser::getImplementationName() throw (RuntimeException) // XServiceInfo sal_Bool FastSaxParser::supportsService(const OUString& ServiceName) throw (RuntimeException) { - 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 |