[Libreoffice-commits] core.git: eventattacher/source filter/source fpicker/source io/source lotuswordpro/source scripting/source sfx2/source stoc/source stoc/test testtools/source toolkit/source ucb/source vcl/source vcl/unx xmlhelp/source xmlscript/source

Marcos Paulo de Souza marcos.souza.org at gmail.com
Tue Oct 22 03:28:57 PDT 2013


 eventattacher/source/eventattacher.cxx                  |   10 ---
 filter/source/config/cache/basecontainer.cxx            |   17 ------
 filter/source/msfilter/msvbahelper.cxx                  |    6 --
 fpicker/source/aqua/SalAquaFilePicker.mm                |   18 ------
 fpicker/source/aqua/SalAquaFolderPicker.mm              |   16 -----
 io/source/TextInputStream/TextInputStream.cxx           |   10 ---
 io/source/TextOutputStream/TextOutputStream.cxx         |   10 ---
 io/source/acceptor/acceptor.cxx                         |   10 ---
 io/source/connector/connector.cxx                       |   10 ---
 io/source/stm/odata.cxx                                 |   43 +---------------
 lotuswordpro/source/filter/lwpfilter.cxx                |   12 +---
 scripting/source/basprov/basprov.cxx                    |   16 -----
 scripting/source/dlgprov/DialogModelProvider.cxx        |    8 --
 scripting/source/dlgprov/dlgprov.cxx                    |   13 ----
 scripting/source/protocolhandler/scripthandler.cxx      |   16 +----
 scripting/source/provider/BrowseNodeFactoryImpl.cxx     |   18 +-----
 scripting/source/provider/MasterScriptProvider.cxx      |   13 ----
 scripting/source/stringresource/stringresource.cxx      |   33 +-----------
 sfx2/source/appl/appinit.cxx                            |   13 ----
 sfx2/source/appl/appuno.cxx                             |   13 +---
 sfx2/source/appl/xpackcreator.cxx                       |   13 ----
 sfx2/source/doc/SfxDocumentMetaData.cxx                 |   16 -----
 sfx2/source/doc/ownsubfilterservice.cxx                 |   14 -----
 sfx2/source/doc/sfxmodelfactory.cxx                     |   14 -----
 sfx2/source/view/frmload.cxx                            |   12 ----
 stoc/source/corereflection/crefl.cxx                    |   10 ---
 stoc/source/defaultregistry/defaultregistry.cxx         |   11 ----
 stoc/source/implementationregistration/implreg.cxx      |    8 --
 stoc/source/inspect/introspection.cxx                   |    8 --
 stoc/source/invocation/invocation.cxx                   |    8 --
 stoc/source/invocation_adapterfactory/iafactory.cxx     |   10 ---
 stoc/source/javaloader/javaloader.cxx                   |   10 ---
 stoc/source/javavm/javavm.cxx                           |    7 --
 stoc/source/loader/dllcomponentloader.cxx               |   10 ---
 stoc/source/namingservice/namingservice.cxx             |   10 ---
 stoc/source/proxy_factory/proxyfac.cxx                  |   12 ----
 stoc/source/security/access_controller.cxx              |   12 ----
 stoc/source/security/file_policy.cxx                    |   12 ----
 stoc/source/servicemanager/servicemanager.cxx           |   10 ---
 stoc/source/typeconv/convert.cxx                        |    8 --
 stoc/test/testsmgr_cpnt.cxx                             |   10 ---
 testtools/source/bridgetest/bridgetest.cxx              |   10 ---
 testtools/source/bridgetest/cppobj.cxx                  |   10 ---
 testtools/source/performance/ubobject.cxx               |   10 ---
 testtools/source/performance/ubtest.cxx                 |    9 ---
 toolkit/source/awt/asynccallback.cxx                    |    8 --
 toolkit/source/awt/vclxaccessiblecomponent.cxx          |    9 ---
 toolkit/source/awt/vclxmenu.cxx                         |   13 +---
 toolkit/source/awt/vclxtoolkit.cxx                      |   12 ----
 toolkit/source/controls/grid/defaultgridcolumnmodel.cxx |    9 ---
 toolkit/source/controls/grid/defaultgriddatamodel.cxx   |    5 -
 toolkit/source/controls/grid/gridcolumn.cxx             |    9 ---
 toolkit/source/controls/grid/sortablegriddatamodel.cxx  |    9 ---
 toolkit/source/controls/unocontrol.cxx                  |   12 ----
 toolkit/source/controls/unocontrolmodel.cxx             |   10 ---
 ucb/source/core/cmdenv.cxx                              |   10 ---
 ucb/source/ucp/expand/ucpexpand.cxx                     |   16 +----
 ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx     |   12 ----
 vcl/source/components/dtranscomp.cxx                    |   12 ----
 vcl/source/components/fontident.cxx                     |   10 ---
 vcl/unx/generic/dtrans/X11_clipboard.cxx                |   13 ----
 vcl/unx/generic/dtrans/X11_droptarget.cxx               |   24 +-------
 vcl/unx/generic/dtrans/X11_selection.cxx                |   17 +-----
 vcl/unx/kde/UnxFilePicker.cxx                           |   11 ----
 vcl/unx/kde4/KDE4FilePicker.cxx                         |   11 ----
 xmlhelp/source/cxxhelp/provider/provider.cxx            |   11 ----
 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx        |   10 ---
 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx        |   11 ----
 68 files changed, 148 insertions(+), 685 deletions(-)

New commits:
commit ee5661ecd3bbeae38b04cd3f582a320a231d11bd
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Mon Oct 21 19:04:05 2013 -0200

    fdo#54938: Adapt supportsService implementations..
    
    to cppu::supportsService
    
    Change-Id: I0b03d3910f094f2183bf9859db9d5bcaf35d1f14
    Reviewed-on: https://gerrit.libreoffice.org/6370
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index 09275b0..4830336 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -38,6 +38,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase1.hxx>
 #include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace com::sun::star::uno;
 using namespace com::sun::star::registry;
@@ -314,19 +315,12 @@ OUString SAL_CALL EventAttacherImpl::getImplementationName(  )
     return OUString(  IMPLNAME  );
 }
 
-//*************************************************************************
 sal_Bool SAL_CALL EventAttacherImpl::supportsService( const OUString& ServiceName )
     throw(RuntimeException)
 {
-    Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString * pArray = aSNL.getArray();
-    for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
-        if( pArray[i] == ServiceName )
-            return sal_True;
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
-//*************************************************************************
 Sequence<OUString> SAL_CALL EventAttacherImpl::getSupportedServiceNames(  )
     throw(RuntimeException)
 {
diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx
index fc93f4f..de888aa 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -25,10 +25,10 @@
 #include <com/sun/star/document/FilterConfigRefresh.hpp>
 #include <com/sun/star/uno/Type.h>
 #include <comphelper/enumhelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/diagnose.h>
 #include <rtl/instance.hxx>
 
-
 #define LOAD_IMPLICIT
 
 namespace filter{
@@ -166,22 +166,9 @@ OUString SAL_CALL BaseContainer::getImplementationName()
 sal_Bool SAL_CALL BaseContainer::supportsService(const OUString& sServiceName)
     throw (css::uno::RuntimeException)
 {
-    // SAFE ->
-    ::osl::ResettableMutexGuard aLock(m_aLock);
-
-          sal_Int32        c      = m_lServiceNames.getLength();
-    const OUString* pNames = m_lServiceNames.getConstArray();
-    for (sal_Int32 i=0; i<c; ++i)
-    {
-        if (pNames[i].equals(sServiceName))
-            return sal_True;
-    }
-    return sal_False;
-    // <- SAFE
+    return cppu::supportsService(this, sServiceName);
 }
 
-
-
 css::uno::Sequence< OUString > SAL_CALL BaseContainer::getSupportedServiceNames()
     throw (css::uno::RuntimeException)
 {
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index 4a5576f..e5c72e5 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/script/vba/XVBACompatibility.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <com/sun/star/script/ModuleType.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include <tools/urlobj.hxx>
 #include <osl/file.hxx>
 #include <unotools/pathoptions.hxx>
@@ -543,10 +544,7 @@ OUString SAL_CALL VBAMacroResolver::getImplementationName() throw (uno::RuntimeE
 
 sal_Bool SAL_CALL VBAMacroResolver::supportsService( const OUString& rService ) throw (uno::RuntimeException)
 {
-    uno::Sequence< OUString > aServices = VBAMacroResolver_getSupportedServiceNames();
-    const OUString* pArray = aServices.getConstArray();
-    const OUString* pArrayEnd = pArray + aServices.getLength();
-    return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd;
+    return cppu::supportsService(this, rService);
 }
 
 uno::Sequence< OUString > SAL_CALL VBAMacroResolver::getSupportedServiceNames() throw (uno::RuntimeException)
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index fbae6e4..50d251c 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -27,6 +27,7 @@
 #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
 #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/diagnose.h>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
 #include <com/sun/star/ui/dialogs/ControlActions.hpp>
@@ -658,22 +659,7 @@ throw( uno::RuntimeException )
 sal_Bool SAL_CALL SalAquaFilePicker::supportsService( const rtl::OUString& sServiceName )
 throw( uno::RuntimeException )
 {
-    DBG_PRINT_ENTRY(CLASS_NAME, __func__, "service name", sServiceName);
-
-    sal_Bool retVal = sal_False;
-
-    uno::Sequence <rtl::OUString> supportedServicesNames = FilePicker_getSupportedServiceNames();
-
-    for( sal_Int32 n = supportedServicesNames.getLength(); n--; ) {
-        if( supportedServicesNames[n] == sServiceName ) {
-            retVal = sal_True;
-            break;
-        }
-    }
-
-    DBG_PRINT_EXIT(CLASS_NAME, __func__);
-
-    return retVal;
+    return cppu:supportsService(this, sServiceName);
 }
 
 uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getSupportedServiceNames()
diff --git a/fpicker/source/aqua/SalAquaFolderPicker.mm b/fpicker/source/aqua/SalAquaFolderPicker.mm
index e7de5b7..3eb590b 100644
--- a/fpicker/source/aqua/SalAquaFolderPicker.mm
+++ b/fpicker/source/aqua/SalAquaFolderPicker.mm
@@ -24,6 +24,7 @@
 #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
 #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/diagnose.h>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
 #include <com/sun/star/uno/Any.hxx>
@@ -220,20 +221,7 @@ rtl::OUString SAL_CALL SalAquaFolderPicker::getImplementationName()
 sal_Bool SAL_CALL SalAquaFolderPicker::supportsService( const rtl::OUString& sServiceName )
     throw( uno::RuntimeException )
 {
-    DBG_PRINT_ENTRY(CLASS_NAME, __func__, "serviceName", sServiceName);
-
-    sal_Bool retVal = sal_False;
-    uno::Sequence <rtl::OUString> supportedServicesNames = FolderPicker_getSupportedServiceNames();
-
-    for( sal_Int32 n = supportedServicesNames.getLength(); n--; ) {
-        if( supportedServicesNames[n] == sServiceName ) {
-            retVal = sal_True;
-            break;
-        }
-    }
-
-    DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal);
-    return retVal;
+    return cppu::supportsService(this, sServiceName);
 }
 
 uno::Sequence<rtl::OUString> SAL_CALL SalAquaFolderPicker::getSupportedServiceNames()
diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx
index a5b6de3..bf71231 100644
--- a/io/source/TextInputStream/TextInputStream.cxx
+++ b/io/source/TextInputStream/TextInputStream.cxx
@@ -25,6 +25,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <rtl/textenc.h>
 #include <rtl/tencinfo.h>
@@ -452,14 +453,7 @@ OUString OTextInputStream::getImplementationName() throw()
 
 sal_Bool OTextInputStream::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);
 }
 
 Sequence< OUString > OTextInputStream::getSupportedServiceNames(void) throw()
diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx
index 53487dd..f7d309c 100644
--- a/io/source/TextOutputStream/TextOutputStream.cxx
+++ b/io/source/TextOutputStream/TextOutputStream.cxx
@@ -25,6 +25,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <rtl/textenc.h>
 #include <rtl/tencinfo.h>
@@ -251,14 +252,7 @@ OUString OTextOutputStream::getImplementationName() throw()
 
 sal_Bool OTextOutputStream::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);
 }
 
 Sequence< OUString > OTextOutputStream::getSupportedServiceNames(void) throw()
diff --git a/io/source/acceptor/acceptor.cxx b/io/source/acceptor/acceptor.cxx
index 8f94584..61059e6 100644
--- a/io/source/acceptor/acceptor.cxx
+++ b/io/source/acceptor/acceptor.cxx
@@ -24,6 +24,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include "cppuhelper/unourl.hxx"
 #include "rtl/malformeduriexception.hxx"
 
@@ -291,14 +292,7 @@ namespace io_acceptor
 
         sal_Bool OAcceptor::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);
     }
 
         Sequence< OUString > OAcceptor::getSupportedServiceNames(void) throw()
diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx
index 22bee63..966a2b6 100644
--- a/io/source/connector/connector.cxx
+++ b/io/source/connector/connector.cxx
@@ -24,6 +24,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include "cppuhelper/unourl.hxx"
 #include "rtl/malformeduriexception.hxx"
 
@@ -192,14 +193,7 @@ namespace stoc_connector
 
         sal_Bool OConnector::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);
     }
 
         Sequence< OUString > OConnector::getSupportedServiceNames(void) throw()
diff --git a/io/source/stm/odata.cxx b/io/source/stm/odata.cxx
index 18f07cb..dcc4716 100644
--- a/io/source/stm/odata.cxx
+++ b/io/source/stm/odata.cxx
@@ -25,6 +25,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/io/XObjectInputStream.hpp>
 #include <com/sun/star/io/XObjectOutputStream.hpp>
@@ -461,14 +462,7 @@ OUString ODataInputStream::getImplementationName() throw ()
 // XServiceInfo
 sal_Bool ODataInputStream::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
@@ -869,14 +863,7 @@ OUString ODataOutputStream::getImplementationName() throw ()
 // XServiceInfo
 sal_Bool ODataOutputStream::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
@@ -885,9 +872,6 @@ Sequence< OUString > ODataOutputStream::getSupportedServiceNames(void) throw ()
     return ODataOutputStream_getSupportedServiceNames();
 }
 
-
-
-
 Reference< XInterface > SAL_CALL ODataOutputStream_CreateInstance(
     SAL_UNUSED_PARAMETER const Reference < XComponentContext > & )
     throw(Exception)
@@ -1195,14 +1179,7 @@ OUString OObjectOutputStream::getImplementationName() throw ()
 // XServiceInfo
 sal_Bool OObjectOutputStream::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
@@ -1470,14 +1447,7 @@ OUString OObjectInputStream::getImplementationName() throw ()
 // XServiceInfo
 sal_Bool OObjectInputStream::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
@@ -1486,9 +1456,6 @@ Sequence< OUString > OObjectInputStream::getSupportedServiceNames(void) throw ()
     return OObjectInputStream_getSupportedServiceNames();
 }
 
-
-
-
 Reference< XInterface > SAL_CALL OObjectInputStream_CreateInstance( const Reference < XComponentContext > & rCtx ) throw(Exception)
 {
     OObjectInputStream *p = new OObjectInputStream( rCtx );
diff --git a/lotuswordpro/source/filter/lwpfilter.cxx b/lotuswordpro/source/filter/lwpfilter.cxx
index f1b082a..a627faa 100644
--- a/lotuswordpro/source/filter/lwpfilter.cxx
+++ b/lotuswordpro/source/filter/lwpfilter.cxx
@@ -78,6 +78,8 @@
 #include <com/sun/star/text/XTextDocument.hpp>
 #include <com/sun/star/text/XText.hpp>
 
+#include <cppuhelper/supportsservice.hxx>
+
 #include <tools/stream.hxx>
 #include <sfx2/docfile.hxx>
 
@@ -186,15 +188,7 @@ OUString LWPFilterImportFilter::getImplementationName() throw()
 
 sal_Bool LWPFilterImportFilter::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);
 }
 
 Sequence< OUString> LWPFilterImportFilter::getSupportedServiceNames( void ) throw()
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index 04e279f..cc0f4f9 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/uri/UriReferenceFactory.hpp>
 
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <rtl/uri.hxx>
 #include <osl/process.h>
 #include <osl/file.hxx>
@@ -180,30 +181,17 @@ namespace basprov
         return bIsShared;
     }
 
-    // -----------------------------------------------------------------------------
     // XServiceInfo
-    // -----------------------------------------------------------------------------
-
     OUString BasicProviderImpl::getImplementationName(  ) throw (RuntimeException)
     {
         return getImplementationName_BasicProviderImpl();
     }
 
-    // -----------------------------------------------------------------------------
-
     sal_Bool BasicProviderImpl::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);
     }
 
-    // -----------------------------------------------------------------------------
-
     Sequence< OUString > BasicProviderImpl::getSupportedServiceNames(  ) throw (RuntimeException)
     {
         return getSupportedServiceNames_BasicProviderImpl();
diff --git a/scripting/source/dlgprov/DialogModelProvider.cxx b/scripting/source/dlgprov/DialogModelProvider.cxx
index aee0a9a..2c1268b 100644
--- a/scripting/source/dlgprov/DialogModelProvider.cxx
+++ b/scripting/source/dlgprov/DialogModelProvider.cxx
@@ -22,6 +22,7 @@
 #include <com/sun/star/resource/XStringResourceManager.hpp>
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
 
+#include <cppuhelper/supportsservice.hxx>
 
 // component helper namespace
 namespace comp_DialogModelProvider {
@@ -165,12 +166,7 @@ OUString SAL_CALL DialogModelProvider::getImplementationName() throw (css::uno::
 
 ::sal_Bool SAL_CALL DialogModelProvider::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException)
 {
-    css::uno::Sequence< OUString > serviceNames = comp_DialogModelProvider::_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 DialogModelProvider::getSupportedServiceNames() throw (css::uno::RuntimeException)
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index e7954d8..281eb24 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -44,6 +44,7 @@
 
 #include <cppuhelper/implementationentry.hxx>
 #include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <sfx2/app.hxx>
 #include <sfx2/objsh.hxx>
 #include <xmlscript/xmldlg_imexp.hxx>
@@ -592,21 +593,11 @@ static OUString aResourceResolverPropName("ResourceResolver");
         return getImplementationName_DialogProviderImpl();
     }
 
-    // -----------------------------------------------------------------------------
-
     sal_Bool DialogProviderImpl::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);
     }
 
-    // -----------------------------------------------------------------------------
-
     Sequence< OUString > DialogProviderImpl::getSupportedServiceNames(  ) throw (RuntimeException)
     {
         return getSupportedServiceNames_DialogProviderImpl();
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 1fa6eb6..391a97b 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -44,6 +44,7 @@
 #include <comphelper/processfactory.hxx>
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <framework/documentundoguard.hxx>
 
 #include "com/sun/star/uno/XComponentContext.hpp"
@@ -414,21 +415,10 @@ throw( RuntimeException )
 }
 
 /* XServiceInfo */
-sal_Bool SAL_CALL ScriptProtocolHandler::supportsService(
-const OUString& sServiceName )
+sal_Bool SAL_CALL ScriptProtocolHandler::supportsService(const OUString& sServiceName )
 throw( RuntimeException )
 {
-    Sequence< OUString > seqServiceNames = getSupportedServiceNames();
-    const OUString* pArray = seqServiceNames.getConstArray();
-    for ( sal_Int32 nCounter = 0; nCounter < seqServiceNames.getLength(); nCounter++ )
-    {
-        if ( pArray[ nCounter ] == sServiceName )
-        {
-            return sal_True ;
-        }
-    }
-
-    return sal_False ;
+    return cppu::supportsService(this, sServiceName);
 }
 
 /* XServiceInfo */
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index a57c9f7..569c5bd 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -23,6 +23,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/exc_hlp.hxx>
 #include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <comphelper/mediadescriptor.hxx>
 
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
@@ -755,23 +756,10 @@ BrowseNodeFactoryImpl::getSupportedServiceNames()
     return bnf_getSupportedServiceNames();
 }
 
-sal_Bool BrowseNodeFactoryImpl::supportsService(
-    OUString const & serviceName )
+sal_Bool BrowseNodeFactoryImpl::supportsService(OUString const & serviceName )
     throw (RuntimeException)
 {
-//     check();
-
-    Sequence< OUString > supported_services(
-        getSupportedServiceNames() );
-
-    OUString const * ar = supported_services.getConstArray();
-
-    for ( sal_Int32 pos = supported_services.getLength(); pos--; )
-    {
-        if (ar[ pos ].equals( serviceName ))
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 } // namespace browsenodefactory
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index cb3783f..19e1134 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -23,6 +23,7 @@
 #include <cppuhelper/implementationentry.hxx>
 #include <cppuhelper/exc_hlp.hxx>
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <tools/diagnose_ex.h>
 
 #include <com/sun/star/frame/XModel.hpp>
@@ -807,20 +808,10 @@ throw( RuntimeException )
     return OUString( "com.sun.star.script.provider.MasterScriptProvider"  );
 }
 
-//*************************************************************************
 sal_Bool SAL_CALL MasterScriptProvider::supportsService( const OUString& serviceName )
 throw( RuntimeException )
 {
-    Sequence< OUString > serviceNames( getSupportedServiceNames() );
-    OUString const * pNames = serviceNames.getConstArray();
-    for ( sal_Int32 nPos = serviceNames.getLength(); nPos--; )
-    {
-        if ( serviceName.equals( pNames[ nPos ] ) )
-        {
-            return sal_True;
-        }
-    }
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 //*************************************************************************
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 33a2e30..196998a 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/embed/ElementModes.hpp>
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
@@ -139,13 +140,7 @@ OUString StringResourceImpl::getImplementationName(  ) throw (RuntimeException)
 
 sal_Bool StringResourceImpl::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);
 }
 
 Sequence< OUString > StringResourceImpl::getSupportedServiceNames(  ) throw (RuntimeException)
@@ -2315,21 +2310,11 @@ OUString StringResourceWithStorageImpl::getImplementationName(  ) throw (Runtime
     return getImplementationName_StringResourceWithStorageImpl();
 }
 
-// -----------------------------------------------------------------------------
-
 sal_Bool StringResourceWithStorageImpl::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);
 }
 
-// -----------------------------------------------------------------------------
-
 Sequence< OUString > StringResourceWithStorageImpl::getSupportedServiceNames(  ) throw (RuntimeException)
 {
     return getSupportedServiceNames_StringResourceWithStorageImpl();
@@ -2652,21 +2637,11 @@ OUString StringResourceWithLocationImpl::getImplementationName(  ) throw (Runtim
     return getImplementationName_StringResourceWithLocationImpl();
 }
 
-// -----------------------------------------------------------------------------
-
 sal_Bool StringResourceWithLocationImpl::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);
 }
 
-// -----------------------------------------------------------------------------
-
 Sequence< OUString > StringResourceWithLocationImpl::getSupportedServiceNames(  ) throw (RuntimeException)
 {
     return getSupportedServiceNames_StringResourceWithLocationImpl();
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 51f2b23..e0f40c9 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -42,6 +42,7 @@
 #include <unotools/historyoptions.hxx>
 #include <unotools/moduleoptions.hxx>
 #include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <vcl/edit.hxx>
 
@@ -128,17 +129,7 @@ OUString SAL_CALL SfxTerminateListener_Impl::getImplementationName() throw (Runt
 
 ::sal_Bool SAL_CALL SfxTerminateListener_Impl::supportsService( const OUString& sServiceName ) throw (RuntimeException)
 {
-    Sequence< OUString > lNames  = getSupportedServiceNames();
-    ::sal_Int32                 c       = lNames.getLength();
-    ::sal_Int32                 i       = 0;
-
-    for (i=0; i<c; ++i)
-    {
-        if (lNames[i].equals(sServiceName))
-            return sal_True;
-    }
-
-    return sal_False;
+    return cppu::supportsService(this, sServiceName);
 }
 
 Sequence< OUString > SAL_CALL SfxTerminateListener_Impl::getSupportedServiceNames() throw (RuntimeException)
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index f8fa84a..7b466ca 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -111,6 +111,8 @@
 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
 #include <com/sun/star/ucb/XContent.hpp>
 
+#include <cppuhelper/supportsservice.hxx>
+
 #include <boost/scoped_ptr.hpp>
 
 #define PROTOCOLHANDLER_SERVICENAME     "com.sun.star.frame.ProtocolHandler"
@@ -1992,16 +1994,7 @@ OUString SAL_CALL SfxAppDispatchProvider::getImplementationName() throw( css::un
 /* XServiceInfo */
 sal_Bool SAL_CALL SfxAppDispatchProvider::supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException )
 {
-    css::uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames();
-    const OUString*         pArray          = seqServiceNames.getConstArray();
-    for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ )
-    {
-        if ( pArray[nCounter] == sServiceName )
-        {
-            return sal_True;
-        }
-    }
-    return sal_False;
+    return cppu::supportsService(this, sServiceName);
 }
 
 /* XServiceInfo */
diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx
index c7fef6e..0b7c70c 100644
--- a/sfx2/source/appl/xpackcreator.cxx
+++ b/sfx2/source/appl/xpackcreator.cxx
@@ -19,7 +19,7 @@
 
 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
 #include <com/sun/star/io/XOutputStream.hpp>
-
+#include <cppuhelper/supportsservice.hxx>
 
 #include "xpackcreator.hxx"
 
@@ -164,27 +164,18 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde
         throw io::IOException(); // TODO/LATER: can't proceed with creation
 }
 
-//-------------------------------------------------------------------------
 OUString SAL_CALL OPackageStructureCreator::getImplementationName()
     throw ( uno::RuntimeException )
 {
     return impl_getStaticImplementationName();
 }
 
-//-------------------------------------------------------------------------
 sal_Bool SAL_CALL OPackageStructureCreator::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_getStaticSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
-//-------------------------------------------------------------------------
 uno::Sequence< OUString > SAL_CALL OPackageStructureCreator::getSupportedServiceNames()
     throw ( uno::RuntimeException )
 {
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 5bdcc7e..0c31186 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -80,6 +80,7 @@
 
 
 #include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/document/XCompatWriterDocProperties.hpp>
 #include <com/sun/star/beans/PropertyBag.hpp>
 
@@ -382,20 +383,7 @@ public:
 
     virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException)
     {
-        css::uno::Sequence< OUString > sServiceNames= getSupportedServiceNames();
-        sal_Int32 nLen = sServiceNames.getLength();
-        OUString* pIt = sServiceNames.getArray();
-        OUString* pEnd = ( pIt + nLen );
-        sal_Bool bRes = sal_False;
-        for ( ; pIt != pEnd; ++pIt )
-        {
-            if ( pIt->equals( ServiceName ) )
-            {
-                bRes = sal_True;
-                break;
-            }
-        }
-        return bRes;
+        return cppu::supportsService(this, ServiceName);
     }
 
     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException)
diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx
index 4a03b1a..26926ce 100644
--- a/sfx2/source/doc/ownsubfilterservice.cxx
+++ b/sfx2/source/doc/ownsubfilterservice.cxx
@@ -19,6 +19,7 @@
 
 #include <com/sun/star/frame/DoubleInitializationException.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <ownsubfilterservice.hxx>
 #include <sfx2/objsh.hxx>
@@ -121,30 +122,19 @@ void SAL_CALL OwnSubFilterService::initialize( const uno::Sequence< uno::Any >&
         throw lang::IllegalArgumentException();
 }
 
-
 // XServiceInfo
-
-//-------------------------------------------------------------------------
 OUString SAL_CALL OwnSubFilterService::getImplementationName()
     throw ( uno::RuntimeException )
 {
     return impl_getStaticImplementationName();
 }
 
-//-------------------------------------------------------------------------
 sal_Bool SAL_CALL OwnSubFilterService::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_getStaticSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
-//-------------------------------------------------------------------------
 uno::Sequence< OUString > SAL_CALL OwnSubFilterService::getSupportedServiceNames()
     throw ( uno::RuntimeException )
 {
diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx
index bb6b1d6..c5ff5c1 100644
--- a/sfx2/source/doc/sfxmodelfactory.cxx
+++ b/sfx2/source/doc/sfxmodelfactory.cxx
@@ -25,6 +25,7 @@
 
 #include <comphelper/namedvaluecollection.hxx>
 #include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <algorithm>
 #include <functional>
@@ -188,38 +189,27 @@ namespace sfx2
         return xInstance;
     }
 
-    //--------------------------------------------------------------------
     OUString SAL_CALL SfxModelFactory::getImplementationName(  ) throw (RuntimeException)
     {
         return m_sImplementationName;
     }
 
-    //--------------------------------------------------------------------
     ::sal_Bool SAL_CALL SfxModelFactory::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
     {
-        return ::std::find(
-            m_aServiceNames.getConstArray(),
-            m_aServiceNames.getConstArray() + m_aServiceNames.getLength(),
-            _rServiceName
-        )  != m_aServiceNames.getConstArray() + m_aServiceNames.getLength();
+        return cppu::supportsService(this, _rServiceName);
     }
 
-    //--------------------------------------------------------------------
     Sequence< OUString > SAL_CALL SfxModelFactory::getSupportedServiceNames(  ) throw (RuntimeException)
     {
         return m_aServiceNames;
     }
 
-    //--------------------------------------------------------------------
     Reference< XSingleServiceFactory > createSfxModelFactory( const Reference< XMultiServiceFactory >& _rxServiceFactory,
             const OUString& _rImplementationName, const SfxModelFactoryFunc _pComponentFactoryFunc,
             const Sequence< OUString >& _rServiceNames )
     {
         return new SfxModelFactory( _rxServiceFactory, _rImplementationName, _pComponentFactoryFunc, _rServiceNames );
     }
-
-//........................................................................
 } // namespace sfx2
-//........................................................................
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index fc47a78..b7dfc24 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -51,6 +51,7 @@
 #include <comphelper/sequenceashashmap.hxx>
 #include <comphelper/processfactory.hxx>
 #include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <framework/interaction.hxx>
 #include <rtl/ustring.h>
 #include <sot/storinfo.hxx>
@@ -658,16 +659,7 @@ OUString SAL_CALL SfxFrameLoader_Impl::getImplementationName() throw( RuntimeExc
 /* XServiceInfo */
 sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const OUString& sServiceName ) throw( RuntimeException )
 {
-    Sequence< OUString > seqServiceNames = getSupportedServiceNames();
-    const OUString*         pArray          = seqServiceNames.getConstArray();
-    for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ )
-    {
-        if ( pArray[nCounter] == sServiceName )
-        {
-            return sal_True ;
-        }
-    }
-    return sal_False ;
+    return cppu::supportsService(this, sServiceName);
 }
 
 /* XServiceInfo */
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx
index a5eb2d3..f5919ca 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -19,6 +19,7 @@
 
 #include <cppuhelper/queryinterface.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/reflection/XConstantTypeDescription.hpp>
@@ -161,14 +162,7 @@ OUString IdlReflectionServiceImpl::getImplementationName()
 sal_Bool IdlReflectionServiceImpl::supportsService( const OUString & rServiceName )
     throw(::com::sun::star::uno::RuntimeException)
 {
-    const Sequence< OUString > & rSNL = getSupportedServiceNames();
-    const OUString * pArray = rSNL.getConstArray();
-    for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
-    {
-        if (pArray[nPos] == rServiceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 //__________________________________________________________________________________________________
 Sequence< OUString > IdlReflectionServiceImpl::getSupportedServiceNames()
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index f66a879..d6e5dbe 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -26,6 +26,7 @@
 #include <cppuhelper/implbase4.hxx>
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <registry/registry.hxx>
 
 #include <com/sun/star/registry/XSimpleRegistry.hpp>
@@ -1213,20 +1214,12 @@ OUString SAL_CALL NestedRegistryImpl::getImplementationName(  )
     return stoc_bootstrap::defreg_getImplementationName();
 }
 
-//*************************************************************************
 sal_Bool SAL_CALL NestedRegistryImpl::supportsService( const OUString& ServiceName )
     throw(RuntimeException)
 {
-    Guard< Mutex > aGuard( m_mutex );
-    Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString * pArray = aSNL.getArray();
-    for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
-        if( pArray[i] == ServiceName )
-            return sal_True;
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
-//*************************************************************************
 Sequence<OUString> SAL_CALL NestedRegistryImpl::getSupportedServiceNames(  )
     throw(RuntimeException)
 {
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 929c4d7..b7ee549 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -26,6 +26,7 @@
 #include <cppuhelper/weak.hxx>
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <uno/mapping.hxx>
 #include <osl/thread.h>
@@ -1334,12 +1335,7 @@ OUString ImplementationRegistration::getImplementationName() throw(RuntimeExcept
 // XServiceInfo
 sal_Bool ImplementationRegistration::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
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index b3a708f..7738a13 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -29,6 +29,7 @@
 #include <cppuhelper/component.hxx>
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <salhelper/simplereferenceobject.hxx>
 
@@ -1780,12 +1781,7 @@ OUString ImplIntrospection::getImplementationName() throw()
 // XServiceInfo
 sal_Bool ImplIntrospection::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/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx
index b9084ab..80a71e4 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -22,6 +22,7 @@
 #include <cppuhelper/weak.hxx>
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <cppuhelper/implbase2.hxx>
 
@@ -1127,12 +1128,7 @@ OUString InvocationService::getImplementationName() throw( RuntimeException )
 // XServiceInfo
 sal_Bool InvocationService::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
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx
index 2d0c862..9f49476 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -33,6 +33,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/uno/XAggregation.hpp>
 #include <com/sun/star/script/XTypeConverter.hpp>
@@ -906,14 +907,7 @@ OUString FactoryImpl::getImplementationName()
 sal_Bool FactoryImpl::supportsService( const OUString & rServiceName )
     throw (RuntimeException)
 {
-    const Sequence< OUString > & rSNL = getSupportedServiceNames();
-    const OUString * pArray = rSNL.getConstArray();
-    for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
-    {
-        if (pArray[nPos].equals( rServiceName ))
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 //______________________________________________________________________________
 Sequence< OUString > FactoryImpl::getSupportedServiceNames()
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 02c6eb1..8b80ea7 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -43,6 +43,7 @@
 #include <cppuhelper/implementationentry.hxx>
 
 #include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/loader/XImplementationLoader.hpp>
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -322,14 +323,7 @@ OUString SAL_CALL JavaComponentLoader::getImplementationName()
 sal_Bool SAL_CALL JavaComponentLoader::supportsService(const OUString & ServiceName)
     throw(::com::sun::star::uno::RuntimeException)
 {
-    sal_Bool bSupport = sal_False;
-
-    Sequence<OUString> aSNL = getSupportedServiceNames();
-    const OUString * pArray = aSNL.getArray();
-    for(sal_Int32 i = 0; i < aSNL.getLength() && !bSupport; ++ i)
-        bSupport = pArray[i] == ServiceName;
-
-    return bSupport;
+    return cppu::supportsService(this, ServiceName);
 }
 
 Sequence<OUString> SAL_CALL JavaComponentLoader::getSupportedServiceNames()
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 352ce8b..3f8139a 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -54,6 +54,7 @@
 #include "cppuhelper/factory.hxx"
 #include "cppuhelper/implbase1.hxx"
 #include "cppuhelper/implementationentry.hxx"
+#include <cppuhelper/supportsservice.hxx>
 #include "jvmaccess/classpath.hxx"
 #include "jvmaccess/unovirtualmachine.hxx"
 #include "jvmaccess/virtualmachine.hxx"
@@ -650,11 +651,7 @@ sal_Bool SAL_CALL
 JavaVirtualMachine::supportsService(OUString const & rServiceName)
     throw (css::uno::RuntimeException)
 {
-    css::uno::Sequence< OUString > aNames(getSupportedServiceNames());
-    for (sal_Int32 i = 0; i < aNames.getLength(); ++i)
-        if (aNames[i] == rServiceName)
-            return true;
-    return false;
+    return cppu::supportsService(this, rServiceName);
 }
 
 css::uno::Sequence< OUString > SAL_CALL
diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx
index 9720ac0..f7570d3 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -33,6 +33,7 @@
 #include <cppuhelper/shlib.hxx>
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/bootstrap.hxx>
 
 #include <com/sun/star/loader/XImplementationLoader.hpp>
@@ -114,19 +115,12 @@ OUString SAL_CALL DllComponentLoader::getImplementationName(  )
     return stoc_bootstrap::loader_getImplementationName();
 }
 
-//*************************************************************************
 sal_Bool SAL_CALL DllComponentLoader::supportsService( const OUString& ServiceName )
     throw(::com::sun::star::uno::RuntimeException)
 {
-    Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString * pArray = aSNL.getArray();
-    for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
-        if( pArray[i] == ServiceName )
-            return sal_True;
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
-//*************************************************************************
 Sequence<OUString> SAL_CALL DllComponentLoader::getSupportedServiceNames(  )
     throw(::com::sun::star::uno::RuntimeException)
 {
diff --git a/stoc/source/namingservice/namingservice.cxx b/stoc/source/namingservice/namingservice.cxx
index 139de3c..31639fb 100644
--- a/stoc/source/namingservice/namingservice.cxx
+++ b/stoc/source/namingservice/namingservice.cxx
@@ -29,6 +29,7 @@
 #include <cppuhelper/component.hxx>
 #include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/uno/XNamingService.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -132,14 +133,7 @@ OUString NamingService_Impl::getImplementationName()
 sal_Bool NamingService_Impl::supportsService( const OUString & rServiceName )
     throw(::com::sun::star::uno::RuntimeException)
 {
-    const Sequence< OUString > & rSNL = getSupportedServiceNames();
-    const OUString * pArray = rSNL.getConstArray();
-    for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
-    {
-        if (pArray[nPos] == rServiceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 
 // XServiceInfo
diff --git a/stoc/source/proxy_factory/proxyfac.cxx b/stoc/source/proxy_factory/proxyfac.cxx
index f06f5a1..5ac0864 100644
--- a/stoc/source/proxy_factory/proxyfac.cxx
+++ b/stoc/source/proxy_factory/proxyfac.cxx
@@ -32,6 +32,7 @@
 #include "cppuhelper/implbase2.hxx"
 #include "cppuhelper/implementationentry.hxx"
 #include "cppuhelper/factory.hxx"
+#include <cppuhelper/supportsservice.hxx>
 #include "com/sun/star/lang/XServiceInfo.hpp"
 #include "com/sun/star/registry/XRegistryKey.hpp"
 #include "com/sun/star/reflection/XProxyFactory.hpp"
@@ -440,21 +441,12 @@ OUString FactoryImpl::getImplementationName()
     return proxyfac_getImplementationName();
 }
 
-//______________________________________________________________________________
 sal_Bool FactoryImpl::supportsService( const OUString & rServiceName )
     throw (RuntimeException)
 {
-    Sequence< OUString > const & rSNL = getSupportedServiceNames();
-    OUString const * pArray = rSNL.getConstArray();
-    for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
-    {
-        if (rServiceName.equals( pArray[ nPos ] ))
-            return true;
-    }
-    return false;
+    return cppu::supportsService(this, rServiceName);
 }
 
-//______________________________________________________________________________
 Sequence< OUString > FactoryImpl::getSupportedServiceNames()
     throw(::com::sun::star::uno::RuntimeException)
 {
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index 49fea7f..ce78ed8 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -35,6 +35,7 @@
 #include <cppuhelper/compbase3.hxx>
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/uno/XCurrentContext.hpp>
 #include <com/sun/star/uno/DeploymentException.hpp>
@@ -968,16 +969,7 @@ OUString AccessController::getImplementationName()
 sal_Bool AccessController::supportsService( OUString const & serviceName )
     throw (RuntimeException)
 {
-    Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString * pNames = aSNL.getConstArray();
-    for ( sal_Int32 nPos = aSNL.getLength(); --nPos; )
-    {
-        if (serviceName.equals( pNames[ nPos ] ))
-        {
-            return sal_True;
-        }
-    }
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 //__________________________________________________________________________________________________
 Sequence< OUString > AccessController::getSupportedServiceNames()
diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx
index 70cc325..46ba89f 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -29,6 +29,7 @@
 #include <cppuhelper/access_control.hxx>
 #include <cppuhelper/compbase2.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/security/XAccessController.hpp>
@@ -531,16 +532,7 @@ OUString FilePolicy::getImplementationName()
 sal_Bool FilePolicy::supportsService( OUString const & serviceName )
     throw (RuntimeException)
 {
-    Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString * pNames = aSNL.getConstArray();
-    for ( sal_Int32 nPos = aSNL.getLength(); --nPos; )
-    {
-        if (serviceName.equals( pNames[ nPos ] ))
-        {
-            return sal_True;
-        }
-    }
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 //__________________________________________________________________________________________________
 Sequence< OUString > FilePolicy::getSupportedServiceNames()
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index b150066..4b262f3 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -35,7 +35,7 @@
 #include <cppuhelper/bootstrap.hxx>
 #include <cppuhelper/compbase6.hxx>
 #include <cppuhelper/compbase7.hxx>
-
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
@@ -1116,13 +1116,7 @@ OUString OServiceManager::getImplementationName()
 sal_Bool OServiceManager::supportsService(const OUString& ServiceName)
     throw(::com::sun::star::uno::RuntimeException)
 {
-    check_undisposed();
-    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/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 584b7e7..57bdff8 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -22,6 +22,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implementationentry.hxx>
 #include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <typelib/typedescription.hxx>
 #include <uno/data.h>
@@ -292,12 +293,7 @@ OUString TypeConverter_Impl::getImplementationName() throw( RuntimeException )
 // XServiceInfo
 sal_Bool TypeConverter_Impl::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
diff --git a/stoc/test/testsmgr_cpnt.cxx b/stoc/test/testsmgr_cpnt.cxx
index e2d073f..6e65b0c 100644
--- a/stoc/test/testsmgr_cpnt.cxx
+++ b/stoc/test/testsmgr_cpnt.cxx
@@ -22,6 +22,7 @@
 #include <osl/thread.h>
 #include <osl/mutex.hxx>
 #include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/weak.hxx>
 #include <uno/mapping.hxx>
 
@@ -134,17 +135,10 @@ OUString Test_Manager_Impl::getImplementationName() throw()
     return OUString(IMPLEMENTATION_NAME);
 }
 
-//*************************************************************************
 // Test_Manager_Impl::supportsService
-//
 sal_Bool Test_Manager_Impl::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);
 }
 
 //*************************************************************************
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index 3c2bcda..ef5ee55 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -33,6 +33,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
@@ -1244,14 +1245,7 @@ OUString TestBridgeImpl::getImplementationName()
 sal_Bool TestBridgeImpl::supportsService( const OUString & rServiceName )
     throw (RuntimeException)
 {
-    const Sequence< OUString > & rSNL = getSupportedServiceNames();
-    const OUString * pArray = rSNL.getConstArray();
-    for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
-    {
-        if (pArray[nPos] == rServiceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 //__________________________________________________________________________________________________
 Sequence< OUString > TestBridgeImpl::getSupportedServiceNames()
diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx
index e9133b2..370c2b7 100644
--- a/testtools/source/bridgetest/cppobj.cxx
+++ b/testtools/source/bridgetest/cppobj.cxx
@@ -30,6 +30,7 @@
 #include <cppuhelper/factory.hxx>
 #include "cppuhelper/exc_hlp.hxx"
 #include "cppuhelper/compbase_ex.hxx"
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include "com/sun/star/uno/Any.hxx"
@@ -1154,14 +1155,7 @@ OUString Test_Impl::getImplementationName()
 sal_Bool Test_Impl::supportsService( const OUString & rServiceName )
     throw (RuntimeException)
 {
-    const Sequence< OUString > & rSNL = getSupportedServiceNames();
-    const OUString * pArray = rSNL.getConstArray();
-    for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
-    {
-        if (pArray[nPos] == rServiceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 //__________________________________________________________________________________________________
 Sequence< OUString > Test_Impl::getSupportedServiceNames()
diff --git a/testtools/source/performance/ubobject.cxx b/testtools/source/performance/ubobject.cxx
index 6e904cc..9098eb7 100644
--- a/testtools/source/performance/ubobject.cxx
+++ b/testtools/source/performance/ubobject.cxx
@@ -22,6 +22,7 @@
 #include <osl/interlck.h>
 
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
@@ -210,14 +211,7 @@ OUString ServiceImpl::getImplementationName()
 sal_Bool ServiceImpl::supportsService( const OUString & rServiceName )
     throw (RuntimeException)
 {
-    const Sequence< OUString > & rSNL = getSupportedServiceNames();
-    const OUString * pArray = rSNL.getConstArray();
-    for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
-    {
-        if (pArray[nPos] == rServiceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 //__________________________________________________________________________________________________
 Sequence< OUString > ServiceImpl::getSupportedServiceNames()
diff --git a/testtools/source/performance/ubtest.cxx b/testtools/source/performance/ubtest.cxx
index 1b48a73..4c0ea18 100644
--- a/testtools/source/performance/ubtest.cxx
+++ b/testtools/source/performance/ubtest.cxx
@@ -449,14 +449,7 @@ OUString TestImpl::getImplementationName()
 sal_Bool TestImpl::supportsService( const OUString & rServiceName )
     throw (RuntimeException)
 {
-    const Sequence< OUString > & rSNL = getSupportedServiceNames();
-    const OUString * pArray = rSNL.getConstArray();
-    for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
-    {
-        if (pArray[nPos] == rServiceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 //__________________________________________________________________________________________________
 Sequence< OUString > TestImpl::getSupportedServiceNames()
diff --git a/toolkit/source/awt/asynccallback.cxx b/toolkit/source/awt/asynccallback.cxx
index 1f30e8f..8d04164 100644
--- a/toolkit/source/awt/asynccallback.cxx
+++ b/toolkit/source/awt/asynccallback.cxx
@@ -24,6 +24,7 @@
 #include "cppuhelper/factory.hxx"
 #include "cppuhelper/implementationentry.hxx"
 #include "cppuhelper/implbase2.hxx"
+#include <cppuhelper/supportsservice.hxx>
 #include "com/sun/star/lang/XServiceInfo.hpp"
 #include "com/sun/star/awt/XRequestCallback.hpp"
 
@@ -92,12 +93,7 @@ OUString SAL_CALL AsyncCallback::getImplementationName() throw (css::uno::Runtim
 
 ::sal_Bool SAL_CALL AsyncCallback::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException)
 {
-    const css::uno::Sequence< OUString > serviceNames = comp_AsyncCallback::_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 AsyncCallback::getSupportedServiceNames() throw (css::uno::RuntimeException)
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 347ee5d..43bbd2e 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -22,6 +22,7 @@
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
 #include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
 #include <com/sun/star/accessibility/AccessibleRelationType.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include <toolkit/awt/vclxaccessiblecomponent.hxx>
 #include <toolkit/helper/externallock.hxx>
 #include <toolkit/awt/vclxwindow.hxx>
@@ -96,13 +97,7 @@ OUString VCLXAccessibleComponent::getImplementationName() throw (uno::RuntimeExc
 
 sal_Bool VCLXAccessibleComponent::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException)
 {
-    uno::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);
 }
 
 uno::Sequence< OUString > VCLXAccessibleComponent::getSupportedServiceNames() throw (uno::RuntimeException)
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 74e5a27..75a99a5 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -23,6 +23,7 @@
 #include <toolkit/helper/servicenames.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <rtl/uuid.h>
 #include <osl/mutex.hxx>
@@ -204,20 +205,12 @@ throw (css::uno::RuntimeException)
     return aNames;
 }
 
-
-::sal_Bool SAL_CALL VCLXMenu::supportsService(
-    const OUString& rServiceName )
+::sal_Bool SAL_CALL VCLXMenu::supportsService(const OUString& rServiceName )
 throw (css::uno::RuntimeException)
 {
-    css::uno::Sequence< OUString > aServiceNames( getSupportedServiceNames() );
-
-    if ( aServiceNames[ 0 ] == rServiceName )
-        return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 
-
 css::uno::Any VCLXMenu::queryInterface(
     const css::uno::Type & rType )
 throw(css::uno::RuntimeException)
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index e80f1bc..707700f 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -43,6 +43,7 @@
 #include <com/sun/star/uno/XInterface.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <osl/conditn.hxx>
 #include <rtl/uuid.h>
@@ -1381,16 +1382,7 @@ OUString VCLXToolkit::getImplementationName() throw(::com::sun::star::uno::Runti
 
 sal_Bool VCLXToolkit::supportsService( const OUString& rServiceName ) throw(::com::sun::star::uno::RuntimeException)
 {
-    ::osl::MutexGuard aGuard( GetMutex() );
-
-    ::com::sun::star::uno::Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString* pArray = aSNL.getConstArray();
-    const OUString* pArrayEnd = aSNL.getConstArray();
-    for (; pArray != pArrayEnd; ++pArray )
-        if( *pArray == rServiceName )
-            break;
-
-    return pArray != pArrayEnd;
+    return cppu::supportsService(this, rServiceName);
 }
 
 ::com::sun::star::uno::Sequence< OUString > VCLXToolkit::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
index 26ef3b6..558907f 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
@@ -26,6 +26,7 @@
 #include <comphelper/sequence.hxx>
 #include <comphelper/componentguard.hxx>
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <toolkit/helper/servicenames.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <tools/diagnose_ex.h>
@@ -301,17 +302,11 @@ namespace toolkit
         return OUString( "org.openoffice.comp.toolkit.DefaultGridColumnModel" );
     }
 
-    //------------------------------------------------------------------------------------------------------------------
     sal_Bool SAL_CALL DefaultGridColumnModel::supportsService( const OUString& i_serviceName ) throw (RuntimeException)
     {
-        const Sequence< OUString > aServiceNames( getSupportedServiceNames() );
-        for ( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
-            if ( aServiceNames[i] == i_serviceName )
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, i_serviceName);
     }
 
-    //------------------------------------------------------------------------------------------------------------------
     Sequence< OUString > SAL_CALL DefaultGridColumnModel::getSupportedServiceNames(  ) throw (RuntimeException)
     {
         const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridColumnModel ) );
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
index e59078e..853eabb 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
@@ -22,6 +22,7 @@
 
 #include <comphelper/stlunosequence.hxx>
 #include <comphelper/componentguard.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <toolkit/helper/servicenames.hxx>
 #include <tools/diagnose_ex.h>
 #include <rtl/ref.hxx>
@@ -427,13 +428,11 @@ namespace toolkit
         return aImplName;
     }
 
-    //------------------------------------------------------------------------------------------------------------------
     sal_Bool SAL_CALL DefaultGridDataModel::supportsService( const OUString& ServiceName ) throw (RuntimeException)
     {
-        return ServiceName.equalsAscii( szServiceName_DefaultGridDataModel );
+        return cppu::supportsService(this, ServiceName);
     }
 
-    //------------------------------------------------------------------------------------------------------------------
     Sequence< OUString > SAL_CALL DefaultGridDataModel::getSupportedServiceNames(  ) throw (RuntimeException)
     {
         static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridDataModel ) );
diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx
index 10c796b..f08b89b 100644
--- a/toolkit/source/controls/grid/gridcolumn.cxx
+++ b/toolkit/source/controls/grid/gridcolumn.cxx
@@ -20,6 +20,7 @@
 #include "gridcolumn.hxx"
 
 #include <comphelper/sequence.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <toolkit/helper/servicenames.hxx>
 
@@ -264,17 +265,11 @@ namespace toolkit
         return OUString( "org.openoffice.comp.toolkit.GridColumn" );
     }
 
-    //------------------------------------------------------------------------------------------------------------------
     sal_Bool SAL_CALL GridColumn::supportsService( const OUString& i_serviceName ) throw (RuntimeException)
     {
-        const Sequence< OUString > aServiceNames( getSupportedServiceNames() );
-        for ( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
-            if ( aServiceNames[i] == i_serviceName )
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, i_serviceName);
     }
 
-    //------------------------------------------------------------------------------------------------------------------
     ::com::sun::star::uno::Sequence< OUString > SAL_CALL GridColumn::getSupportedServiceNames(  ) throw (RuntimeException)
     {
         const OUString aServiceName( OUString::createFromAscii( szServiceName_GridColumn ) );
diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx
index d4a218c..252e692 100644
--- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx
+++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx
@@ -27,6 +27,7 @@
 
 #include <comphelper/anycompare.hxx>
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <tools/diagnose_ex.h>
 #include <tools/debug.hxx>
@@ -833,17 +834,11 @@ namespace toolkit
         return OUString( "org.openoffice.comp.toolkit.SortableGridDataModel" );
     }
 
-    //------------------------------------------------------------------------------------------------------------------
     ::sal_Bool SAL_CALL SortableGridDataModel::supportsService( const OUString& i_serviceName ) throw (RuntimeException)
     {
-        Sequence< OUString > const aServiceNames( getSupportedServiceNames() );
-        for ( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
-            if ( aServiceNames[i] == i_serviceName )
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, i_serviceName);
     }
 
-    //------------------------------------------------------------------------------------------------------------------
     Sequence< OUString > SAL_CALL SortableGridDataModel::getSupportedServiceNames(  ) throw (RuntimeException)
     {
         Sequence< OUString > aServiceNames(1);
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index 5d6700e..3830c242 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -25,6 +25,7 @@
 #include <com/sun/star/resource/XStringResourceResolver.hpp>
 #include <toolkit/controls/unocontrol.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <rtl/uuid.h>
 #include <osl/mutex.hxx>
@@ -1433,16 +1434,7 @@ OUString UnoControl::getImplementationName(  ) throw(RuntimeException)
 
 sal_Bool UnoControl::supportsService( const OUString& rServiceName ) throw(RuntimeException)
 {
-    ::osl::MutexGuard aGuard( GetMutex() );
-
-    Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString* pArray = aSNL.getConstArray();
-    const OUString* pArrayEnd = aSNL.getConstArray() + aSNL.getLength();
-    for (; pArray != pArrayEnd; ++pArray )
-        if( *pArray == rServiceName )
-            break;
-
-    return pArray != pArrayEnd;
+    return cppu::supportsService(this, rServiceName);
 }
 
 Sequence< OUString > UnoControl::getSupportedServiceNames(  ) throw(RuntimeException)
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 782922b..79db937 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -30,6 +30,7 @@
 #include <com/sun/star/io/XMarkableStream.hpp>
 #include <toolkit/controls/unocontrolmodel.hxx>
 #include <toolkit/helper/macros.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <rtl/uuid.h>
 #include <tools/diagnose_ex.h>
@@ -1030,14 +1031,7 @@ OUString UnoControlModel::getImplementationName(  ) throw(::com::sun::star::uno:
 
 sal_Bool UnoControlModel::supportsService( const OUString& rServiceName ) throw(::com::sun::star::uno::RuntimeException)
 {
-    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
-    ::com::sun::star::uno::Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString * pArray = aSNL.getConstArray();
-    for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
-        if( pArray[i] == rServiceName )
-            return sal_True;
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 
 ::com::sun::star::uno::Sequence< OUString > UnoControlModel::getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException)
diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx
index ce3b9d6..0752b59 100644
--- a/ucb/source/core/cmdenv.cxx
+++ b/ucb/source/core/cmdenv.cxx
@@ -19,6 +19,7 @@
 
 
 #include "cppuhelper/factory.hxx"
+#include <cppuhelper/supportsservice.hxx>
 #include "com/sun/star/lang/IllegalArgumentException.hpp"
 
 #include "cmdenv.hxx"
@@ -88,14 +89,7 @@ sal_Bool SAL_CALL
 UcbCommandEnvironment::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::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);
 }
 
 //=========================================================================
diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx
index 5648f8b..384133e 100644
--- a/ucb/source/ucp/expand/ucpexpand.cxx
+++ b/ucb/source/ucp/expand/ucpexpand.cxx
@@ -23,6 +23,7 @@
 #include "cppuhelper/compbase2.hxx"
 #include "cppuhelper/factory.hxx"
 #include "cppuhelper/implementationentry.hxx"
+#include <cppuhelper/supportsservice.hxx>
 #include "ucbhelper/content.hxx"
 #include "com/sun/star/uno/XComponentContext.hpp"
 #include "com/sun/star/lang/DisposedException.hpp"
@@ -155,23 +156,12 @@ uno::Sequence< OUString > ExpandContentProviderImpl::getSupportedServiceNames()
     return supportedServices();
 }
 
-//______________________________________________________________________________
-sal_Bool ExpandContentProviderImpl::supportsService(
-    OUString const & serviceName )
+sal_Bool ExpandContentProviderImpl::supportsService(OUString const & serviceName )
     throw (uno::RuntimeException)
 {
-//     check();
-    uno::Sequence< OUString > supported_services( getSupportedServiceNames() );
-    OUString const * ar = supported_services.getConstArray();
-    for ( sal_Int32 pos = supported_services.getLength(); pos--; )
-    {
-        if (ar[ pos ].equals( serviceName ))
-            return true;
-    }
-    return false;
+    return cppu::supportsService(this, serviceName);
 }
 
-//______________________________________________________________________________
 OUString ExpandContentProviderImpl::expandUri(
     uno::Reference< ucb::XContentIdentifier > const & xIdentifier ) const
 {
diff --git a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
index cc64ec2..8611380 100644
--- a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
@@ -25,6 +25,7 @@
  *************************************************************************/
 
 #include "cppuhelper/factory.hxx"
+#include <cppuhelper/supportsservice.hxx>
 
 #include "tdoc_documentcontentfactory.hxx"
 
@@ -64,23 +65,14 @@ OUString SAL_CALL DocumentContentFactory::getImplementationName()
     return getImplementationName_Static();
 }
 
-//=========================================================================
 // virtual
 sal_Bool SAL_CALL
 DocumentContentFactory::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::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);
 }
 
-//=========================================================================
 // virtual
 uno::Sequence< OUString > SAL_CALL
 DocumentContentFactory::getSupportedServiceNames()
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx
index 650fce0..cb4b6b2 100644
--- a/vcl/source/components/dtranscomp.cxx
+++ b/vcl/source/components/dtranscomp.cxx
@@ -42,13 +42,12 @@
 #include "cppuhelper/compbase1.hxx"
 #include "cppuhelper/compbase2.hxx"
 #include "cppuhelper/implbase1.hxx"
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace com::sun::star;
 using namespace com::sun::star::uno;
 using namespace com::sun::star::lang;
 
-// -----------------------------------------------------------------------
-
 namespace vcl
 {
 // generic implementation to satisfy SalInstance
@@ -148,14 +147,7 @@ Sequence< OUString > GenericClipboard::getSupportedServiceNames() throw( Runtime
 
 sal_Bool GenericClipboard::supportsService( const OUString& ServiceName ) throw( RuntimeException )
 {
-    Sequence< OUString > aServices( getSupportedServiceNames() );
-    sal_Int32 nServices = aServices.getLength();
-    for( sal_Int32 i = 0; i < nServices; i++ )
-    {
-        if( aServices[i] == ServiceName )
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 Reference< ::com::sun::star::datatransfer::XTransferable > GenericClipboard::getContents() throw( RuntimeException )
diff --git a/vcl/source/components/fontident.cxx b/vcl/source/components/fontident.cxx
index 87be8e0..9e5a138 100644
--- a/vcl/source/components/fontident.cxx
+++ b/vcl/source/components/fontident.cxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/lang/DisposedException.hpp>
 
 #include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
@@ -172,7 +173,6 @@ Reference< XInterface > SAL_CALL FontIdentificator_createInstance( const Referen
     return static_cast< ::cppu::OWeakObject * >( new FontIdentificator );
 }
 
-
 // XServiceInfo
 OUString SAL_CALL FontIdentificator::getImplementationName() throw (RuntimeException)
 {
@@ -181,13 +181,7 @@ OUString SAL_CALL FontIdentificator::getImplementationName() throw (RuntimeExcep
 
 sal_Bool SAL_CALL FontIdentificator::supportsService( const OUString& i_rServiceName ) throw (RuntimeException)
 {
-    Sequence< OUString > aSN( FontIdentificator_getSupportedServiceNames() );
-    for( sal_Int32 nService = 0; nService < aSN.getLength(); nService++ )
-    {
-        if( aSN[nService] == i_rServiceName )
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, i_rServiceName);
 }
 
 Sequence< OUString > SAL_CALL FontIdentificator::getSupportedServiceNames() throw (RuntimeException)
diff --git a/vcl/unx/generic/dtrans/X11_clipboard.cxx b/vcl/unx/generic/dtrans/X11_clipboard.cxx
index 0af14a4..e7f3ece 100644
--- a/vcl/unx/generic/dtrans/X11_clipboard.cxx
+++ b/vcl/unx/generic/dtrans/X11_clipboard.cxx
@@ -29,6 +29,7 @@
 #include <uno/dispatcher.h> // declaration of generic uno interface
 #include <uno/mapping.hxx> // mapping stuff
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <rtl/tencinfo.h>
 
 #if OSL_DEBUG_LEVEL > 1
@@ -251,22 +252,12 @@ OUString SAL_CALL X11Clipboard::getImplementationName(  )
     return OUString(X11_CLIPBOARD_IMPLEMENTATION_NAME);
 }
 
-// ------------------------------------------------------------------------
-
 sal_Bool SAL_CALL X11Clipboard::supportsService( const OUString& ServiceName )
     throw(RuntimeException)
 {
-    Sequence < OUString > SupportedServicesNames = X11Clipboard_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-        if (SupportedServicesNames[n] == ServiceName)
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
-// ------------------------------------------------------------------------
-
 Sequence< OUString > SAL_CALL X11Clipboard::getSupportedServiceNames(    )
     throw(RuntimeException)
 {
diff --git a/vcl/unx/generic/dtrans/X11_droptarget.cxx b/vcl/unx/generic/dtrans/X11_droptarget.cxx
index b2e76aa..f8463ab 100644
--- a/vcl/unx/generic/dtrans/X11_droptarget.cxx
+++ b/vcl/unx/generic/dtrans/X11_droptarget.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
+#include <cppuhelper/supportsservice.hxx>
 #include <X11_selection.hxx>
 
 using namespace x11;
@@ -182,38 +182,20 @@ void DropTarget::dragOver( const DropTargetDragEvent& dtde ) throw()
     }
 }
 
-// --------------------------------------------------------------------------
-
-/*
- *  XServiceInfo
- */
-
-// ------------------------------------------------------------------------
-
+// XServiceInfo
 OUString DropTarget::getImplementationName() throw()
 {
     return OUString(XDND_DROPTARGET_IMPLEMENTATION_NAME);
 }
 
-// ------------------------------------------------------------------------
-
 sal_Bool DropTarget::supportsService( const OUString& ServiceName ) throw()
 {
-    Sequence < OUString > SupportedServicesNames = Xdnd_dropTarget_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-        if (SupportedServicesNames[n] == ServiceName)
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
-// ------------------------------------------------------------------------
-
 Sequence< OUString > DropTarget::getSupportedServiceNames() throw()
 {
     return Xdnd_dropTarget_getSupportedServiceNames();
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index e14baa4..8a90cd9 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -66,6 +66,8 @@
 #include <comphelper/processfactory.hxx>
 #include <comphelper/solarmutex.hxx>
 
+#include <cppuhelper/supportsservice.hxx>
+
 #define DRAG_EVENT_MASK ButtonPressMask         |\
                               ButtonReleaseMask     |\
                               PointerMotionMask     |\
@@ -4153,27 +4155,14 @@ OUString SelectionManagerHolder::getImplementationName() throw()
     return OUString(XDND_IMPLEMENTATION_NAME);
 }
 
-// ------------------------------------------------------------------------
-
 sal_Bool SelectionManagerHolder::supportsService( const OUString& ServiceName ) throw()
 {
-    Sequence < OUString > SupportedServicesNames = Xdnd_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-        if (SupportedServicesNames[n] == ServiceName)
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
-// ------------------------------------------------------------------------
-
 Sequence< OUString > SelectionManagerHolder::getSupportedServiceNames() throw()
 {
     return Xdnd_getSupportedServiceNames();
 }
 
-
-// ------------------------------------------------------------------------
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde/UnxFilePicker.cxx b/vcl/unx/kde/UnxFilePicker.cxx
index b5f34a1..08d8fdb 100644
--- a/vcl/unx/kde/UnxFilePicker.cxx
+++ b/vcl/unx/kde/UnxFilePicker.cxx
@@ -27,6 +27,7 @@
 #include <FPServiceInfo.hxx>
 
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/diagnose.h>
 #include <osl/file.hxx>
 #include <rtl/ustring.hxx>
@@ -652,15 +653,7 @@ OUString SAL_CALL UnxFilePicker::getImplementationName()
 sal_Bool SAL_CALL UnxFilePicker::supportsService( const OUString& ServiceName )
     throw( uno::RuntimeException )
 {
-    uno::Sequence< OUString > SupportedServicesNames = FilePicker_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-    {
-        if ( SupportedServicesNames[n] == ServiceName )
-            return sal_True;
-    }
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL UnxFilePicker::getSupportedServiceNames()
diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index aa5d4d0..6d44754 100644
--- a/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -20,6 +20,7 @@
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
 #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
 #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
@@ -703,15 +704,7 @@ OUString SAL_CALL KDE4FilePicker::getImplementationName()
 sal_Bool SAL_CALL KDE4FilePicker::supportsService( const OUString& ServiceName )
     throw( uno::RuntimeException )
 {
-    uno::Sequence< OUString > SupportedServicesNames = FilePicker_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-    {
-        if ( SupportedServicesNames[n] == ServiceName )
-            return sal_True;
-    }
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL KDE4FilePicker::getSupportedServiceNames()
diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx
index 3c2235e..72e4efd 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/container/XNameReplace.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <unotools/configmgr.hxx>
 #include <unotools/pathoptions.hxx>
 #include <rtl/bootstrap.hxx>
@@ -96,15 +97,7 @@ sal_Bool SAL_CALL
 ContentProvider::supportsService(const OUString& ServiceName )
     throw( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString* pArray = aSNL.getArray();
-    for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
-    {
-        if( pArray[ i ] == ServiceName )
-            return sal_True;
-    }
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
index f033beb..a5f4b43 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/script/XLibraryContainerPassword.hpp>
 #include <com/sun/star/document/XEmbeddedScripts.hpp>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 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 08a2d54..85ad944 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
@@ -25,6 +25,7 @@
 #include <com/sun/star/script/XLibraryContainerPassword.hpp>
 #include <com/sun/star/document/XEmbeddedScripts.hpp>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 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)
     {


More information about the Libreoffice-commits mailing list