From 7235d23267e4591e5cf47762abd3f63421b06904 Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Wed, 25 Sep 2013 15:41:29 -0300 Subject: fdo#54938: Adapt supportsService implementations to cppu::supportsService Change-Id: I683c0d30c3286ed5d725d4eefe8b3977b82ee316 Reviewed-on: https://gerrit.libreoffice.org/6035 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- unoxml/source/dom/documentbuilder.cxx | 8 ++------ unoxml/source/dom/saxbuilder.cxx | 10 ++-------- unoxml/source/events/testlistener.cxx | 8 ++------ unoxml/source/rdf/CBlankNode.cxx | 8 ++------ unoxml/source/rdf/CLiteral.cxx | 8 ++------ unoxml/source/rdf/CURI.cxx | 8 ++------ unoxml/source/rdf/librdf_repository.cxx | 9 ++------- unoxml/source/xpath/xpathapi.cxx | 10 ++-------- 8 files changed, 16 insertions(+), 53 deletions(-) (limited to 'unoxml') 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 #include +#include #include #include @@ -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 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 #include - +#include 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 #include +#include #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 +#include #include #include #include @@ -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 +#include #include #include #include @@ -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 +#include #include #include #include @@ -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 #include #include +#include #include #include @@ -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 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