Kaydet (Commit) 74c876e6 authored tarafından Alexandre Vicenzi's avatar Alexandre Vicenzi Kaydeden (comit) Marcos Souza

fdo#54938 Convert chart2 to cppu::supportsService

Change-Id: I26e993a6b0dfc54637651b1a093d896faf5b42d3
Reviewed-on: https://gerrit.libreoffice.org/7644Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarMarcos Souza <marcos.souza.org@gmail.com>
Tested-by: 's avatarMarcos Souza <marcos.souza.org@gmail.com>
üst 5685b965
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "NameContainer.hxx" #include "NameContainer.hxx"
#include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Any.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
...@@ -66,14 +67,7 @@ OUString SAL_CALL NameContainer::getImplementationName() ...@@ -66,14 +67,7 @@ OUString SAL_CALL NameContainer::getImplementationName()
sal_Bool SAL_CALL NameContainer::supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL NameContainer::supportsService( const OUString& ServiceName )
throw( ::com::sun::star::uno::RuntimeException ) throw( ::com::sun::star::uno::RuntimeException )
{ {
Sequence< OUString > aSNL = getSupportedServiceNames(); return cppu::supportsService(this, ServiceName);
const OUString* pArray = aSNL.getArray();
for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
{
if( pArray[ i ] == ServiceName )
return sal_True;
}
return sal_False;
} }
Sequence< OUString > SAL_CALL NameContainer::getSupportedServiceNames() Sequence< OUString > SAL_CALL NameContainer::getSupportedServiceNames()
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <vcl/window.hxx> #include <vcl/window.hxx>
#include <tools/gen.hxx> #include <tools/gen.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <algorithm> #include <algorithm>
...@@ -184,14 +185,7 @@ uno::Sequence< OUString > DummyXShape::getSupportedServiceNames() ...@@ -184,14 +185,7 @@ uno::Sequence< OUString > DummyXShape::getSupportedServiceNames()
sal_Bool DummyXShape::supportsService( const OUString& rServiceName ) sal_Bool DummyXShape::supportsService( const OUString& rServiceName )
throw(uno::RuntimeException) throw(uno::RuntimeException)
{ {
uno::Sequence< OUString > aSupportedServices = listSupportedServices(); return cppu::supportsService(this, ServiceName);
for(sal_Int32 i = 0; i < aSupportedServices.getLength(); ++i)
{
if(aSupportedServices[i] == rServiceName)
return true;
}
return false;
} }
uno::Reference< uno::XInterface > DummyXShape::getParent() uno::Reference< uno::XInterface > DummyXShape::getParent()
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include "sampleaddin.hxx" #include "sampleaddin.hxx"
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
...@@ -633,16 +634,7 @@ OUString SAL_CALL SampleAddIn::getImplementationName() throw( uno::RuntimeExcept ...@@ -633,16 +634,7 @@ OUString SAL_CALL SampleAddIn::getImplementationName() throw( uno::RuntimeExcept
sal_Bool SAL_CALL SampleAddIn::supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL SampleAddIn::supportsService( const OUString& ServiceName )
throw( uno::RuntimeException ) throw( uno::RuntimeException )
{ {
uno::Sequence< OUString > aServiceSeq = getSupportedServiceNames_Static(); return cppu::supportsService(this, ServiceName);
sal_Int32 nLength = aServiceSeq.getLength();
for( sal_Int32 i=0; i < nLength; i++ )
{
if( ServiceName.equals( aServiceSeq[ i ] ))
return sal_True;
}
return sal_False;
} }
uno::Sequence< OUString > SAL_CALL SampleAddIn::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SampleAddIn::getSupportedServiceNames()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment