diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-09-25 15:41:29 -0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-07 17:01:33 +0000 |
commit | 7235d23267e4591e5cf47762abd3f63421b06904 (patch) | |
tree | 6353239b1c586642e22c5df892a7c0560e632fa5 /unoxml | |
parent | 8e37c7ae282f10724d6322aa028a7dd6b698f071 (diff) |
fdo#54938: Adapt supportsService implementations to cppu::supportsService
Change-Id: I683c0d30c3286ed5d725d4eefe8b3977b82ee316
Reviewed-on: https://gerrit.libreoffice.org/6035
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unoxml')
-rw-r--r-- | unoxml/source/dom/documentbuilder.cxx | 8 | ||||
-rw-r--r-- | unoxml/source/dom/saxbuilder.cxx | 10 | ||||
-rw-r--r-- | unoxml/source/events/testlistener.cxx | 8 | ||||
-rw-r--r-- | unoxml/source/rdf/CBlankNode.cxx | 8 | ||||
-rw-r--r-- | unoxml/source/rdf/CLiteral.cxx | 8 | ||||
-rw-r--r-- | unoxml/source/rdf/CURI.cxx | 8 | ||||
-rw-r--r-- | unoxml/source/rdf/librdf_repository.cxx | 9 | ||||
-rw-r--r-- | unoxml/source/xpath/xpathapi.cxx | 10 |
8 files changed, 16 insertions, 53 deletions
diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index e3a7bac1d544..6cd4798a2608 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -33,6 +33,7 @@ #include <comphelper/processfactory.hxx> #include <cppuhelper/implbase1.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/xml/sax/SAXParseException.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> @@ -132,12 +133,7 @@ namespace DOM sal_Bool SAL_CALL CDocumentBuilder::supportsService(const OUString& aServiceName) throw (RuntimeException) { - Sequence< OUString > supported = CDocumentBuilder::_getSupportedServiceNames(); - for (sal_Int32 i=0; i<supported.getLength(); i++) - { - if (supported[i] == aServiceName) return sal_True; - } - return sal_False; + return cppu::supportsService(this, aServiceName); } Reference< XDOMImplementation > SAL_CALL CDocumentBuilder::getDOMImplementation() diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index 75edd9a6c450..8e1c69c2d22e 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -24,7 +24,7 @@ #include <com/sun/star/xml/dom/DocumentBuilder.hpp> #include <comphelper/processfactory.hxx> - +#include <cppuhelper/supportsservice.hxx> namespace DOM { @@ -73,15 +73,9 @@ namespace DOM sal_Bool SAL_CALL CSAXDocumentBuilder::supportsService(const OUString& aServiceName) throw (RuntimeException) { - Sequence< OUString > supported = CSAXDocumentBuilder::_getSupportedServiceNames(); - for (sal_Int32 i=0; i<supported.getLength(); i++) - { - if (supported[i] == aServiceName) return sal_True; - } - return sal_False; + return cppu::supportsService(this, aServiceName); } - SAXDocumentBuilderState SAL_CALL CSAXDocumentBuilder::getState() throw (RuntimeException) { diff --git a/unoxml/source/events/testlistener.cxx b/unoxml/source/events/testlistener.cxx index f99d53febf37..9c9dad01a75a 100644 --- a/unoxml/source/events/testlistener.cxx +++ b/unoxml/source/events/testlistener.cxx @@ -19,6 +19,7 @@ #include <stdio.h> #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <cppuhelper/supportsservice.hxx> #include "testlistener.hxx" @@ -74,12 +75,7 @@ namespace DOM { namespace events sal_Bool SAL_CALL CTestListener::supportsService(const OUString& aServiceName) throw (RuntimeException) { - Sequence< OUString > supported = CTestListener::_getSupportedServiceNames(); - for (sal_Int32 i=0; i<supported.getLength(); i++) - { - if (supported[i] == aServiceName) return sal_True; - } - return sal_False; + return cppu::supportsService(this, aServiceName); } // --- XInitialize diff --git a/unoxml/source/rdf/CBlankNode.cxx b/unoxml/source/rdf/CBlankNode.cxx index f4540cfd1d0f..8b469299765c 100644 --- a/unoxml/source/rdf/CBlankNode.cxx +++ b/unoxml/source/rdf/CBlankNode.cxx @@ -20,6 +20,7 @@ #include "CNodes.hxx" #include <cppuhelper/implbase3.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/rdf/XBlankNode.hpp> @@ -72,12 +73,7 @@ OUString SAL_CALL CBlankNode::getImplementationName() throw (css::uno::RuntimeEx ::sal_Bool SAL_CALL CBlankNode::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > serviceNames = comp_CBlankNode::_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) { - if (serviceNames[i] == serviceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, serviceName); } css::uno::Sequence< OUString > SAL_CALL CBlankNode::getSupportedServiceNames() throw (css::uno::RuntimeException) diff --git a/unoxml/source/rdf/CLiteral.cxx b/unoxml/source/rdf/CLiteral.cxx index 14c3fca88d95..e19d4cfaab42 100644 --- a/unoxml/source/rdf/CLiteral.cxx +++ b/unoxml/source/rdf/CLiteral.cxx @@ -20,6 +20,7 @@ #include "CNodes.hxx" #include <cppuhelper/implbase3.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/rdf/XLiteral.hpp> @@ -81,12 +82,7 @@ OUString SAL_CALL CLiteral::getImplementationName() throw (css::uno::RuntimeExce ::sal_Bool SAL_CALL CLiteral::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > serviceNames = comp_CLiteral::_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) { - if (serviceNames[i] == serviceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, serviceName); } css::uno::Sequence< OUString > SAL_CALL CLiteral::getSupportedServiceNames() throw (css::uno::RuntimeException) diff --git a/unoxml/source/rdf/CURI.cxx b/unoxml/source/rdf/CURI.cxx index 63ff77ed0c7a..474135e77d47 100644 --- a/unoxml/source/rdf/CURI.cxx +++ b/unoxml/source/rdf/CURI.cxx @@ -20,6 +20,7 @@ #include "CNodes.hxx" #include <cppuhelper/implbase3.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/rdf/XURI.hpp> @@ -81,12 +82,7 @@ OUString SAL_CALL CURI::getImplementationName() throw (css::uno::RuntimeExceptio ::sal_Bool SAL_CALL CURI::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > serviceNames = comp_CURI::_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) { - if (serviceNames[i] == serviceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, serviceName); } css::uno::Sequence< OUString > SAL_CALL CURI::getSupportedServiceNames() throw (css::uno::RuntimeException) diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 120c0cad26a3..e25514f3ca05 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -54,6 +54,7 @@ #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/basemutex.hxx> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/stlunosequence.hxx> #include <comphelper/sequenceasvector.hxx> @@ -820,13 +821,7 @@ throw (uno::RuntimeException) ::sal_Bool SAL_CALL librdf_Repository::supportsService( OUString const & serviceName) throw (uno::RuntimeException) { - uno::Sequence< OUString > serviceNames - = comp_librdf_Repository::_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) { - if (serviceNames[i] == serviceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, serviceName); } uno::Sequence< OUString > SAL_CALL diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index 690dcfc32ff5..69960a048452 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -35,6 +35,7 @@ #include "../dom/node.hxx" #include "../dom/document.hxx" +#include <cppuhelper/supportsservice.hxx> using ::com::sun::star::lang::XMultiServiceFactory; @@ -89,16 +90,9 @@ namespace XPath sal_Bool SAL_CALL CXPathAPI::supportsService(const OUString& aServiceName) throw (RuntimeException) { - Sequence< OUString > supported = CXPathAPI::_getSupportedServiceNames(); - for (sal_Int32 i=0; i<supported.getLength(); i++) - { - if (supported[i] == aServiceName) return sal_True; - } - return sal_False; + return cppu::supportsService(this, aServiceName); } - // ------------------------------------------------------------------- - void SAL_CALL CXPathAPI::registerNS( const OUString& aPrefix, const OUString& aURI) |