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 --- xmlscript/source/xmlflat_imexp/xmlbas_export.cxx | 10 ++-------- xmlscript/source/xmlflat_imexp/xmlbas_import.cxx | 11 ++--------- 2 files changed, 4 insertions(+), 17 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx index f033beb12e5b..a5f4b436ba33 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx @@ -26,6 +26,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::lang; @@ -111,16 +112,9 @@ namespace xmlscript } // XServiceInfo - sal_Bool XMLBasicExporterBase::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } // XInitialization diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx index 08a2d54d42f8..85ad94498c6e 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx @@ -25,6 +25,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::lang; @@ -569,20 +570,12 @@ void BasicImport::setDocumentLocator( const Reference< xml::sax::XLocator >& /*x } // XServiceInfo - sal_Bool XMLBasicImporterBase::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } // XImporter - void XMLBasicImporterBase::setTargetDocument( const Reference< XComponent >& rxDoc ) throw (IllegalArgumentException, RuntimeException) { -- cgit