[Libreoffice-commits] core.git: drawinglayer/source dtrans/source editeng/source embeddedobj/source embeddedobj/test extensions/source fpicker/source linguistic/source linguistic/workben unoxml/source uui/source xmloff/source

Marcos Paulo de Souza marcos.souza.org at gmail.com
Mon Oct 7 10:01:56 PDT 2013


 drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx |   13 +----------
 dtrans/source/cnttype/mcnttfactory.cxx                       |   12 +---------
 dtrans/source/generic/clipboardmanager.cxx                   |   11 +--------
 dtrans/source/generic/generic_clipboard.cxx                  |   11 +--------
 dtrans/source/win32/clipb/WinClipboard.cxx                   |   12 +---------
 dtrans/source/win32/ftransl/ftransl.cxx                      |   12 +---------
 editeng/source/accessibility/AccessibleEditableTextPara.cxx  |   10 +-------
 editeng/source/accessibility/AccessibleImageBullet.cxx       |   10 +-------
 embeddedobj/source/commonembedding/xfactory.cxx              |   11 +--------
 embeddedobj/source/general/xcreator.cxx                      |   11 +--------
 embeddedobj/source/msole/xdialogcreator.cxx                  |    9 +------
 embeddedobj/source/msole/xolefactory.cxx                     |   10 +-------
 embeddedobj/test/MainThreadExecutor/xexecutor.cxx            |   10 +-------
 embeddedobj/test/mtexecutor/bitmapcreator.cxx                |   10 +-------
 embeddedobj/test/mtexecutor/mainthreadexecutor.cxx           |   10 +-------
 extensions/source/bibliography/bibload.cxx                   |    8 +-----
 extensions/source/config/ldap/ldapuserprofilebe.cxx          |   11 +--------
 extensions/source/logging/consolehandler.cxx                 |   10 +-------
 extensions/source/logging/csvformatter.cxx                   |   10 +-------
 extensions/source/logging/filehandler.cxx                    |   11 +--------
 extensions/source/logging/plaintextformatter.cxx             |   11 +--------
 extensions/source/propctrlr/inspectormodelbase.cxx           |   12 +---------
 extensions/source/propctrlr/propcontroller.cxx               |    9 +------
 extensions/source/update/check/updatecheckconfig.cxx         |   11 +--------
 extensions/source/update/check/updatecheckjob.cxx            |   11 +--------
 extensions/source/update/feed/updatefeed.cxx                 |   11 +--------
 extensions/source/update/ui/updatecheckui.cxx                |   10 +-------
 fpicker/source/office/OfficeFilePicker.cxx                   |   12 +---------
 fpicker/source/office/OfficeFolderPicker.cxx                 |   12 +---------
 fpicker/source/win32/filepicker/FilePicker.cxx               |   12 +---------
 fpicker/source/win32/filepicker/VistaFilePicker.cxx          |   12 +---------
 fpicker/source/win32/folderpicker/FolderPicker.cxx           |   12 +---------
 linguistic/source/convdic.cxx                                |    9 +------
 linguistic/source/dlistimp.cxx                               |   11 +--------
 linguistic/source/gciterator.cxx                             |    8 +-----
 linguistic/source/hhconvdic.cxx                              |    7 +----
 linguistic/source/lngopt.cxx                                 |   10 +-------
 linguistic/source/lngsvcmgr.cxx                              |   10 +-------
 linguistic/workben/sspellimp.cxx                             |   11 +--------
 unoxml/source/dom/documentbuilder.cxx                        |    8 +-----
 unoxml/source/dom/saxbuilder.cxx                             |   10 +-------
 unoxml/source/events/testlistener.cxx                        |    8 +-----
 unoxml/source/rdf/CBlankNode.cxx                             |    8 +-----
 unoxml/source/rdf/CLiteral.cxx                               |    8 +-----
 unoxml/source/rdf/CURI.cxx                                   |    8 +-----
 unoxml/source/rdf/librdf_repository.cxx                      |    9 +------
 unoxml/source/xpath/xpathapi.cxx                             |   10 +-------
 uui/source/interactionhandler.cxx                            |    8 +-----
 uui/source/passwordcontainer.cxx                             |   10 +-------
 uui/source/requeststringresolver.cxx                         |    8 +-----
 xmloff/source/core/unoatrcn.cxx                              |   12 +---------
 51 files changed, 102 insertions(+), 418 deletions(-)

New commits:
commit 7235d23267e4591e5cf47762abd3f63421b06904
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Wed Sep 25 15:41:29 2013 -0300

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

diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 5568f8b..128d0ff 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -20,6 +20,7 @@
 #include <com/sun/star/graphic/XPrimitive2DRenderer.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/xml/sax/XParser.hpp>
 #include <com/sun/star/xml/sax/InputSource.hpp>
 #include <comphelper/processfactory.hxx>
@@ -193,17 +194,7 @@ namespace drawinglayer
 
         sal_Bool SAL_CALL XPrimitive2DRenderer::supportsService(const OUString& rServiceName) throw(uno::RuntimeException)
         {
-            const uno::Sequence< OUString > aServices(XPrimitive2DRenderer_getSupportedServiceNames());
-
-            for(sal_Int32 nService(0); nService < aServices.getLength(); nService++)
-            {
-                if(rServiceName == aServices[nService])
-                {
-                    return sal_True;
-                }
-            }
-
-            return sal_False;
+            return cppu::supportsService(this, rServiceName);
         }
 
         uno::Sequence< OUString > SAL_CALL XPrimitive2DRenderer::getSupportedServiceNames() throw(uno::RuntimeException)
diff --git a/dtrans/source/cnttype/mcnttfactory.cxx b/dtrans/source/cnttype/mcnttfactory.cxx
index ec43fcd..8aa26fe 100644
--- a/dtrans/source/cnttype/mcnttfactory.cxx
+++ b/dtrans/source/cnttype/mcnttfactory.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <osl/diagnose.h>
+#include <cppuhelper/supportsservice.hxx>
 #include "mcnttfactory.hxx"
 #include "mcnttype.hxx"
 
@@ -77,20 +78,11 @@ OUString SAL_CALL CMimeContentTypeFactory::getImplementationName(  )
     return OUString( MIMECONTENTTYPEFACTORY_IMPL_NAME );
 }
 
-// -------------------------------------------------
 //  XServiceInfo
-// -------------------------------------------------
-
 sal_Bool SAL_CALL CMimeContentTypeFactory::supportsService( const OUString& ServiceName )
     throw( RuntimeException )
 {
-    Sequence < OUString > SupportedServicesNames = MimeContentTypeFactory_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-        if ( SupportedServicesNames[n] == ServiceName )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 // -------------------------------------------------
diff --git a/dtrans/source/generic/clipboardmanager.cxx b/dtrans/source/generic/clipboardmanager.cxx
index d4f6f9d..6d13061 100644
--- a/dtrans/source/generic/clipboardmanager.cxx
+++ b/dtrans/source/generic/clipboardmanager.cxx
@@ -19,6 +19,7 @@
 
 #include <clipboardmanager.hxx>
 #include <com/sun/star/lang/DisposedException.hpp>
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace com::sun::star::container;
 using namespace com::sun::star::datatransfer;
@@ -53,18 +54,10 @@ OUString SAL_CALL ClipboardManager::getImplementationName(  )
     return OUString(CLIPBOARDMANAGER_IMPLEMENTATION_NAME);
 }
 
-// ------------------------------------------------------------------------
-
 sal_Bool SAL_CALL ClipboardManager::supportsService( const OUString& ServiceName )
     throw(RuntimeException)
 {
-    Sequence < OUString > SupportedServicesNames = ClipboardManager_getSupportedServiceNames();
-
-    for ( sal_Int32 n = 0, nmax = SupportedServicesNames.getLength(); n < nmax; n++ )
-        if ( SupportedServicesNames[n] == ServiceName )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 // ------------------------------------------------------------------------
diff --git a/dtrans/source/generic/generic_clipboard.cxx b/dtrans/source/generic/generic_clipboard.cxx
index 04e8135..d582cca 100644
--- a/dtrans/source/generic/generic_clipboard.cxx
+++ b/dtrans/source/generic/generic_clipboard.cxx
@@ -20,6 +20,7 @@
 #include <generic_clipboard.hxx>
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/datatransfer/clipboard/RenderingCapabilities.hpp>
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace com::sun::star::datatransfer;
 using namespace com::sun::star::datatransfer::clipboard;
@@ -66,18 +67,10 @@ OUString SAL_CALL GenericClipboard::getImplementationName(  )
     return OUString(GENERIC_CLIPBOARD_IMPLEMENTATION_NAME);
 }
 
-// ------------------------------------------------------------------------
-
 sal_Bool SAL_CALL GenericClipboard::supportsService( const OUString& ServiceName )
     throw(RuntimeException)
 {
-    Sequence < OUString > SupportedServicesNames = GenericClipboard_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-        if ( SupportedServicesNames[n] == ServiceName )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 // ------------------------------------------------------------------------
diff --git a/dtrans/source/win32/clipb/WinClipboard.cxx b/dtrans/source/win32/clipb/WinClipboard.cxx
index ef7d410..66f5444 100644
--- a/dtrans/source/win32/clipb/WinClipboard.cxx
+++ b/dtrans/source/win32/clipb/WinClipboard.cxx
@@ -22,6 +22,7 @@
 #include <com/sun/star/datatransfer/clipboard/ClipboardEvent.hpp>
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include "WinClipbImpl.hxx"
 
 //------------------------------------------------------------------------
@@ -277,20 +278,11 @@ OUString SAL_CALL CWinClipboard::getImplementationName(  )
     return OUString( WINCLIPBOARD_IMPL_NAME );
 }
 
-// -------------------------------------------------
 //  XServiceInfo
-// -------------------------------------------------
-
 sal_Bool SAL_CALL CWinClipboard::supportsService( const OUString& ServiceName )
     throw(RuntimeException)
 {
-    Sequence < OUString > SupportedServicesNames = WinClipboard_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-        if ( SupportedServicesNames[n] == ServiceName )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 // -------------------------------------------------
diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx
index b808fe8..41b903a 100644
--- a/dtrans/source/win32/ftransl/ftransl.cxx
+++ b/dtrans/source/win32/ftransl/ftransl.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/datatransfer/XMimeContentType.hpp>
 #include <com/sun/star/datatransfer/MimeContentTypeFactory.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include "../misc/ImplHelper.hxx"
 
 #if defined _MSC_VER
@@ -214,20 +215,11 @@ OUString SAL_CALL CDataFormatTranslator::getImplementationName(  )
     return OUString( IMPL_NAME );
 }
 
-// -------------------------------------------------
 //  XServiceInfo
-// -------------------------------------------------
-
 sal_Bool SAL_CALL CDataFormatTranslator::supportsService( const OUString& ServiceName )
     throw( RuntimeException )
 {
-    Sequence < OUString > SupportedServicesNames = DataFormatTranslator_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-        if ( SupportedServicesNames[n] == ServiceName )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 // -------------------------------------------------
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 8a56882..191a193 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -42,6 +42,7 @@
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
 #include <comphelper/accessibleeventnotifier.hxx>
 #include <comphelper/sequenceashashmap.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <unotools/accessiblestatesethelper.hxx>
 #include <unotools/accessiblerelationsethelper.hxx>
 #include <com/sun/star/accessibility/AccessibleRelationType.hpp>
@@ -2197,14 +2198,7 @@ namespace accessibility
     {
         DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
 
-        //  Iterate over all supported service names and return true if on of them
-        //  matches the given name.
-        uno::Sequence< OUString> aSupportedServices (
-            getSupportedServiceNames ());
-        for (int i=0; i<aSupportedServices.getLength(); i++)
-            if (sServiceName == aSupportedServices[i])
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, sServiceName);
     }
 
     uno::Sequence< OUString> SAL_CALL AccessibleEditableTextPara::getSupportedServiceNames (void) throw (uno::RuntimeException)
diff --git a/editeng/source/accessibility/AccessibleImageBullet.cxx b/editeng/source/accessibility/AccessibleImageBullet.cxx
index 3e9c2e2..51b4644 100644
--- a/editeng/source/accessibility/AccessibleImageBullet.cxx
+++ b/editeng/source/accessibility/AccessibleImageBullet.cxx
@@ -29,6 +29,7 @@
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
 #include <comphelper/accessibleeventnotifier.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <unotools/accessiblestatesethelper.hxx>
 #include <editeng/unolingu.hxx>
 #include "editeng/AccessibleEditableTextPara.hxx"
@@ -380,14 +381,7 @@ namespace accessibility
     {
         DBG_CHKTHIS( AccessibleImageBullet, NULL );
 
-        //  Iterate over all supported service names and return true if on of them
-        //  matches the given name.
-        uno::Sequence< OUString > aSupportedServices (
-            getSupportedServiceNames ());
-        for (int i=0; i<aSupportedServices.getLength(); i++)
-            if (sServiceName == aSupportedServices[i])
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, sServiceName);
     }
 
     uno::Sequence< OUString > SAL_CALL AccessibleImageBullet::getSupportedServiceNames (void) throw (uno::RuntimeException)
diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx
index 5856727..5a964bc 100644
--- a/embeddedobj/source/commonembedding/xfactory.cxx
+++ b/embeddedobj/source/commonembedding/xfactory.cxx
@@ -25,7 +25,7 @@
 #include <com/sun/star/container/XNameAccess.hpp>
 
 #include <comphelper/processfactory.hxx>
-
+#include <cppuhelper/supportsservice.hxx>
 
 #include "xfactory.hxx"
 #include "commonembobj.hxx"
@@ -454,17 +454,10 @@ OUString SAL_CALL OOoEmbeddedObjectFactory::getImplementationName()
     return impl_staticGetImplementationName();
 }
 
-//-------------------------------------------------------------------------
 sal_Bool SAL_CALL OOoEmbeddedObjectFactory::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 //-------------------------------------------------------------------------
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx
index d3bb4ccb..64d2e03 100644
--- a/embeddedobj/source/general/xcreator.cxx
+++ b/embeddedobj/source/general/xcreator.cxx
@@ -30,7 +30,7 @@
 #include <com/sun/star/lang/XComponent.hpp>
 
 #include <comphelper/processfactory.hxx>
-
+#include <cppuhelper/supportsservice.hxx>
 
 #include <xcreator.hxx>
 #include <dummyobject.hxx>
@@ -445,17 +445,10 @@ OUString SAL_CALL UNOEmbeddedObjectCreator::getImplementationName()
     return impl_staticGetImplementationName();
 }
 
-//-------------------------------------------------------------------------
 sal_Bool SAL_CALL UNOEmbeddedObjectCreator::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 //-------------------------------------------------------------------------
diff --git a/embeddedobj/source/msole/xdialogcreator.cxx b/embeddedobj/source/msole/xdialogcreator.cxx
index 72d9508..dce9eba 100644
--- a/embeddedobj/source/msole/xdialogcreator.cxx
+++ b/embeddedobj/source/msole/xdialogcreator.cxx
@@ -33,6 +33,7 @@
 #include "platform.h"
 #include <comphelper/mimeconfighelper.hxx>
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include "xdialogcreator.hxx"
 #include "oleembobj.hxx"
@@ -343,13 +344,7 @@ OUString SAL_CALL MSOLEDialogObjectCreator::getImplementationName()
 sal_Bool SAL_CALL MSOLEDialogObjectCreator::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 //-------------------------------------------------------------------------
diff --git a/embeddedobj/source/msole/xolefactory.cxx b/embeddedobj/source/msole/xolefactory.cxx
index 11e7a7f..65bf507 100644
--- a/embeddedobj/source/msole/xolefactory.cxx
+++ b/embeddedobj/source/msole/xolefactory.cxx
@@ -27,6 +27,7 @@
 #include "xolefactory.hxx"
 #include "oleembobj.hxx"
 
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace ::com::sun::star;
 
@@ -307,17 +308,10 @@ OUString SAL_CALL OleEmbeddedObjectFactory::getImplementationName()
     return impl_staticGetImplementationName();
 }
 
-//-------------------------------------------------------------------------
 sal_Bool SAL_CALL OleEmbeddedObjectFactory::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 //-------------------------------------------------------------------------
diff --git a/embeddedobj/test/MainThreadExecutor/xexecutor.cxx b/embeddedobj/test/MainThreadExecutor/xexecutor.cxx
index 2634e7a..1fdbb10 100644
--- a/embeddedobj/test/MainThreadExecutor/xexecutor.cxx
+++ b/embeddedobj/test/MainThreadExecutor/xexecutor.cxx
@@ -20,6 +20,7 @@
 #include "xexecutor.hxx"
 #include <vcl/svapp.hxx>
 #include <osl/thread.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace ::com::sun::star;
 
@@ -109,17 +110,10 @@ OUString SAL_CALL UNOMainThreadExecutor::getImplementationName()
     return impl_staticGetImplementationName();
 }
 
-//-------------------------------------------------------------------------
 sal_Bool SAL_CALL UNOMainThreadExecutor::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 //-------------------------------------------------------------------------
diff --git a/embeddedobj/test/mtexecutor/bitmapcreator.cxx b/embeddedobj/test/mtexecutor/bitmapcreator.cxx
index 7f09078..3c81cca 100644
--- a/embeddedobj/test/mtexecutor/bitmapcreator.cxx
+++ b/embeddedobj/test/mtexecutor/bitmapcreator.cxx
@@ -19,6 +19,7 @@
 
 #include "bitmapcreator.hxx"
 
+#include <cppuhelper/supportsservice.hxx>
 #include <vcl/bitmapex.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <tools/stream.hxx>
@@ -90,17 +91,10 @@ OUString SAL_CALL VCLBitmapCreator::getImplementationName()
     return impl_staticGetImplementationName();
 }
 
-//-------------------------------------------------------------------------
 sal_Bool SAL_CALL VCLBitmapCreator::supportsService( const OUString& ServiceName )
         throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 //-------------------------------------------------------------------------
diff --git a/embeddedobj/test/mtexecutor/mainthreadexecutor.cxx b/embeddedobj/test/mtexecutor/mainthreadexecutor.cxx
index 788c0e8..1a0b70f 100644
--- a/embeddedobj/test/mtexecutor/mainthreadexecutor.cxx
+++ b/embeddedobj/test/mtexecutor/mainthreadexecutor.cxx
@@ -19,6 +19,7 @@
 
 #include "mainthreadexecutor.hxx"
 
+#include <cppuhelper/supportsservice.hxx>
 #include <vcl/svapp.hxx>
 
 using namespace ::com::sun::star;
@@ -91,17 +92,10 @@ OUString SAL_CALL MainThreadExecutor::getImplementationName()
     return impl_staticGetImplementationName();
 }
 
-//-------------------------------------------------------------------------
 sal_Bool SAL_CALL MainThreadExecutor::supportsService( const OUString& ServiceName )
         throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 //-------------------------------------------------------------------------
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index adb0046..560b085 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -20,6 +20,7 @@
 #include <osl/mutex.hxx>
 #include <tools/diagnose_ex.h>
 #include <cppuhelper/weak.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <svl/itemprop.hxx>
 #include <uno/environment.h>
 #include <svl/urihelper.hxx>
@@ -169,12 +170,7 @@ OUString BibliographyLoader::getImplementationName() throw(  )
 // XServiceInfo
 sal_Bool BibliographyLoader::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/extensions/source/config/ldap/ldapuserprofilebe.cxx b/extensions/source/config/ldap/ldapuserprofilebe.cxx
index 6985b07..fd595f3 100644
--- a/extensions/source/config/ldap/ldapuserprofilebe.cxx
+++ b/extensions/source/config/ldap/ldapuserprofilebe.cxx
@@ -30,6 +30,7 @@
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/beans/Optional.hpp>
 #include <com/sun/star/configuration/theDefaultProvider.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/security.hxx>
 
 //==============================================================================
@@ -229,21 +230,13 @@ uno::Sequence<OUString> SAL_CALL LdapUserProfileBe::getLdapUserProfileBeServiceN
     aServices[0] = OUString("com.sun.star.configuration.backend.LdapUserProfileBe") ;
     return aServices ;
 }
-//------------------------------------------------------------------------------
 
 sal_Bool SAL_CALL LdapUserProfileBe::supportsService(const OUString& aServiceName)
     throw (uno::RuntimeException)
 {
-    uno::Sequence< OUString > const svc = getLdapUserProfileBeServiceNames();
-
-    for(sal_Int32 i = 0; i < svc.getLength(); ++i )
-        if(svc[i] == aServiceName)
-            return true;
-    return false;
+    return cppu::supportsService(this, aServiceName);
 }
 
-//------------------------------------------------------------------------------
-
 uno::Sequence<OUString>
 SAL_CALL LdapUserProfileBe::getSupportedServiceNames(void)
     throw (uno::RuntimeException)
diff --git a/extensions/source/logging/consolehandler.cxx b/extensions/source/logging/consolehandler.cxx
index 9c162ee..95a9a51 100644
--- a/extensions/source/logging/consolehandler.cxx
+++ b/extensions/source/logging/consolehandler.cxx
@@ -32,6 +32,7 @@
 
 #include <cppuhelper/compbase3.hxx>
 #include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <stdio.h>
 
@@ -276,14 +277,7 @@ namespace logging
     //--------------------------------------------------------------------
     ::sal_Bool SAL_CALL ConsoleHandler::supportsService( const OUString& _rServiceName ) throw(RuntimeException)
     {
-        const Sequence< OUString > aServiceNames( getSupportedServiceNames() );
-        for (   const OUString* pServiceNames = aServiceNames.getConstArray();
-                pServiceNames != aServiceNames.getConstArray() + aServiceNames.getLength();
-                ++pServiceNames
-            )
-            if ( _rServiceName == *pServiceNames )
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, _rServiceName);
     }
 
     //--------------------------------------------------------------------
diff --git a/extensions/source/logging/csvformatter.cxx b/extensions/source/logging/csvformatter.cxx
index c65624f..8acd74b 100644
--- a/extensions/source/logging/csvformatter.cxx
+++ b/extensions/source/logging/csvformatter.cxx
@@ -29,6 +29,7 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 
 #include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <rtl/ustrbuf.hxx>
 
@@ -313,14 +314,7 @@ namespace logging
 
     ::sal_Bool SAL_CALL CsvFormatter::supportsService( const OUString& service_name ) throw(RuntimeException)
     {
-        const Sequence< OUString > aServiceNames( getSupportedServiceNames() );
-        for (   const OUString* pServiceNames = aServiceNames.getConstArray();
-                pServiceNames != aServiceNames.getConstArray() + aServiceNames.getLength();
-                ++pServiceNames
-            )
-            if ( service_name == *pServiceNames )
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, service_name);
     }
 
     OUString SAL_CALL CsvFormatter::getImplementationName() throw(RuntimeException)
diff --git a/extensions/source/logging/filehandler.cxx b/extensions/source/logging/filehandler.cxx
index 93a4e71..15f4e35 100644
--- a/extensions/source/logging/filehandler.cxx
+++ b/extensions/source/logging/filehandler.cxx
@@ -34,6 +34,7 @@
 
 #include <cppuhelper/compbase3.hxx>
 #include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <osl/thread.h>
 #include <osl/file.hxx>
@@ -376,17 +377,9 @@ namespace logging
         return getImplementationName_static();
     }
 
-    //--------------------------------------------------------------------
     ::sal_Bool SAL_CALL FileHandler::supportsService( const OUString& _rServiceName ) throw(RuntimeException)
     {
-        const Sequence< OUString > aServiceNames( getSupportedServiceNames() );
-        for (   const OUString* pServiceNames = aServiceNames.getConstArray();
-                pServiceNames != aServiceNames.getConstArray() + aServiceNames.getLength();
-                ++pServiceNames
-            )
-            if ( _rServiceName == *pServiceNames )
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, _rServiceName);
     }
 
     //--------------------------------------------------------------------
diff --git a/extensions/source/logging/plaintextformatter.cxx b/extensions/source/logging/plaintextformatter.cxx
index 35b01a6..bf9bff1 100644
--- a/extensions/source/logging/plaintextformatter.cxx
+++ b/extensions/source/logging/plaintextformatter.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 
 #include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <rtl/ustrbuf.hxx>
 
@@ -150,17 +151,9 @@ namespace logging
         return OUString();
     }
 
-    //--------------------------------------------------------------------
     ::sal_Bool SAL_CALL PlainTextFormatter::supportsService( const OUString& _rServiceName ) throw(RuntimeException)
     {
-        const Sequence< OUString > aServiceNames( getSupportedServiceNames() );
-        for (   const OUString* pServiceNames = aServiceNames.getConstArray();
-                pServiceNames != aServiceNames.getConstArray() + aServiceNames.getLength();
-                ++pServiceNames
-            )
-            if ( _rServiceName == *pServiceNames )
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, _rServiceName);
     }
 
     //--------------------------------------------------------------------
diff --git a/extensions/source/propctrlr/inspectormodelbase.cxx b/extensions/source/propctrlr/inspectormodelbase.cxx
index 5c6f21e..3d5f2b5 100644
--- a/extensions/source/propctrlr/inspectormodelbase.cxx
+++ b/extensions/source/propctrlr/inspectormodelbase.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 
 #include <comphelper/propertycontainerhelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 //........................................................................
 namespace pcr
@@ -233,18 +234,9 @@ namespace pcr
         setFastPropertyValue( MODEL_PROPERTY_ID_IS_READ_ONLY, makeAny( _IsReadOnly ) );
     }
 
-    //--------------------------------------------------------------------
     ::sal_Bool SAL_CALL ImplInspectorModel::supportsService( const OUString& ServiceName ) throw (RuntimeException)
     {
-        StlSyntaxSequence< OUString > aSupported( getSupportedServiceNames() );
-        for (   StlSyntaxSequence< OUString >::const_iterator check = aSupported.begin();
-                check != aSupported.end();
-                ++check
-            )
-            if ( check->equals( ServiceName ) )
-                return sal_True;
-
-        return sal_False;
+        return cppu::supportsService(this, ServiceName);
     }
 
     //--------------------------------------------------------------------
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index eeab02c..460ed2a 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -46,6 +46,7 @@
 #include <osl/mutex.hxx>
 #include <cppuhelper/component_context.hxx>
 #include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <algorithm>
 #include <functional>
@@ -562,15 +563,9 @@ namespace pcr
         return getImplementationName_static();
     }
 
-    //------------------------------------------------------------------------
     sal_Bool SAL_CALL OPropertyBrowserController::supportsService( const OUString& ServiceName ) throw(RuntimeException)
     {
-        Sequence< OUString > aSupported(getSupportedServiceNames());
-        const OUString* pArray = aSupported.getConstArray();
-        for (sal_Int32 i = 0; i < aSupported.getLength(); ++i, ++pArray)
-            if (pArray->equals(ServiceName))
-                return sal_True;
-        return sal_False;
+        return cppu::supportsService(this, ServiceName);
     }
 
     //------------------------------------------------------------------------
diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx
index 79a23ca..d739bdc 100644
--- a/extensions/source/update/check/updatecheckconfig.cxx
+++ b/extensions/source/update/check/updatecheckconfig.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/configuration/theDefaultProvider.hpp>
 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/security.hxx>
 #include <osl/time.h>
 #include <osl/file.hxx>
@@ -754,19 +755,11 @@ UpdateCheckConfig::getImplementationName()  throw (uno::RuntimeException)
     return getImplName();
 }
 
-//------------------------------------------------------------------------------
-
 sal_Bool SAL_CALL
 UpdateCheckConfig::supportsService(OUString const & serviceName)
     throw (uno::RuntimeException)
 {
-    uno::Sequence< OUString > aServiceNameList = getServiceNames();
-
-    for( sal_Int32 n=0; n < aServiceNameList.getLength(); n++ )
-        if( aServiceNameList[n].equals(serviceName) )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 //------------------------------------------------------------------------------
diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx
index b9cf884..2734505 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -27,6 +27,7 @@
 
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include "com/sun/star/frame/Desktop.hpp"
 #include "com/sun/star/frame/XTerminateListener.hpp"
@@ -284,18 +285,10 @@ UpdateCheckJob::getSupportedServiceNames() throw (uno::RuntimeException)
     return getServiceNames();
 }
 
-//------------------------------------------------------------------------------
-
 sal_Bool SAL_CALL
 UpdateCheckJob::supportsService( OUString const & serviceName ) throw (uno::RuntimeException)
 {
-    uno::Sequence< OUString > aServiceNameList = getServiceNames();
-
-    for( sal_Int32 n=0; n < aServiceNameList.getLength(); n++ )
-        if( aServiceNameList[n].equals(serviceName) )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 //------------------------------------------------------------------------------
diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx
index 555edb6..e18afa1 100644
--- a/extensions/source/update/feed/updatefeed.cxx
+++ b/extensions/source/update/feed/updatefeed.cxx
@@ -22,6 +22,7 @@
 #include <cppuhelper/implbase1.hxx>
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/beans/Property.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
@@ -758,18 +759,10 @@ UpdateInformationProvider::getSupportedServiceNames() throw (uno::RuntimeExcepti
     return getServiceNames();
 }
 
-//------------------------------------------------------------------------------
-
 sal_Bool SAL_CALL
 UpdateInformationProvider::supportsService( OUString const & serviceName ) throw (uno::RuntimeException)
 {
-    uno::Sequence< OUString > aServiceNameList = getServiceNames();
-
-    for( sal_Int32 n=0; n < aServiceNameList.getLength(); n++ )
-        if( aServiceNameList[n].equals(serviceName) )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 } // anonymous namespace
diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx
index 7f1ec03..9b167cb 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -22,6 +22,7 @@
 
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/document/XEventListener.hpp>
@@ -264,17 +265,10 @@ UpdateCheckUI::getSupportedServiceNames() throw (uno::RuntimeException)
     return ::getServiceNames();
 }
 
-//------------------------------------------------------------------------------
 sal_Bool SAL_CALL
 UpdateCheckUI::supportsService( OUString const & serviceName ) throw (uno::RuntimeException)
 {
-    uno::Sequence< OUString > aServiceNameList = ::getServiceNames();
-
-    for( sal_Int32 n=0; n < aServiceNameList.getLength(); n++ )
-        if( aServiceNameList[n].equals(serviceName) )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 //------------------------------------------------------------------------------
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index 13c7dbb..3ec8b9f 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -38,6 +38,7 @@
 #include <unotools/ucbhelper.hxx>
 #include <unotools/pathoptions.hxx>
 #include <comphelper/sequence.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include "osl/mutex.hxx"
 #include "vcl/svapp.hxx"
@@ -1117,16 +1118,7 @@ OUString SAL_CALL SvtFilePicker::getImplementationName() throw( RuntimeException
 /* XServiceInfo */
 sal_Bool SAL_CALL SvtFilePicker::supportsService( const OUString& sServiceName ) throw( RuntimeException )
 {
-    Sequence< OUString > seqServiceNames = getSupportedServiceNames();
-    const OUString* pArray = seqServiceNames.getConstArray();
-    for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ )
-    {
-        if ( sServiceName == pArray[i] )
-        {
-            return sal_True ;
-        }
-    }
-    return sal_False ;
+    return cppu::supportsService(this, sServiceName);
 }
 
 /* XServiceInfo */
diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx
index 1cf1d05..8a00b20 100644
--- a/fpicker/source/office/OfficeFolderPicker.cxx
+++ b/fpicker/source/office/OfficeFolderPicker.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/container/XSet.hpp>
 #include <com/sun/star/uno/Any.hxx>
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <unotools/pathoptions.hxx>
 
@@ -161,16 +162,7 @@ OUString SAL_CALL SvtFolderPicker::getImplementationName() throw( RuntimeExcepti
 /* XServiceInfo */
 sal_Bool SAL_CALL SvtFolderPicker::supportsService( const OUString& sServiceName ) throw( RuntimeException )
 {
-    Sequence< OUString > seqServiceNames = getSupportedServiceNames();
-    const OUString* pArray = seqServiceNames.getConstArray();
-    for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ )
-    {
-        if ( sServiceName == pArray[i] )
-        {
-            return sal_True ;
-        }
-    }
-    return sal_False ;
+    return cppu::supportsService(this, sServiceName);
 }
 
 /* XServiceInfo */
diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx
index 5831103..18a1858 100644
--- a/fpicker/source/win32/filepicker/FilePicker.cxx
+++ b/fpicker/source/win32/filepicker/FilePicker.cxx
@@ -20,6 +20,7 @@
 #include <tchar.h>
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/diagnose.h>
 
 #include "FilePicker.hxx"
@@ -713,20 +714,11 @@ OUString SAL_CALL CFilePicker::getImplementationName()
     return OUString(RTL_CONSTASCII_USTRINGPARAM(FILE_PICKER_IMPL_NAME));
 }
 
-// -------------------------------------------------
 //  XServiceInfo
-// -------------------------------------------------
-
 sal_Bool SAL_CALL CFilePicker::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);
 }
 
 // -------------------------------------------------
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
index f5f343f..76f0658 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
@@ -37,6 +37,7 @@
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
 
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <comphelper/processfactory.hxx>
 #include <osl/diagnose.h>
 #include <osl/mutex.hxx>
@@ -610,20 +611,11 @@ OUString SAL_CALL VistaFilePicker::getImplementationName()
     return OUString("com.sun.star.comp.fpicker.VistaFileDialog");
 }
 
-// -------------------------------------------------
 //  XServiceInfo
-// -------------------------------------------------
-
 sal_Bool SAL_CALL VistaFilePicker::supportsService(const OUString& sServiceName)
     throw(css::uno::RuntimeException )
 {
-    css::uno::Sequence< OUString > lSupportedServicesNames = VistaFilePicker_getSupportedServiceNames();
-
-    for (sal_Int32 n = lSupportedServicesNames.getLength(); n--;)
-        if (lSupportedServicesNames[n] == sServiceName)
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, sServiceName);
 }
 
 // -------------------------------------------------
diff --git a/fpicker/source/win32/folderpicker/FolderPicker.cxx b/fpicker/source/win32/folderpicker/FolderPicker.cxx
index 2ea5458..bdf4d22 100644
--- a/fpicker/source/win32/folderpicker/FolderPicker.cxx
+++ b/fpicker/source/win32/folderpicker/FolderPicker.cxx
@@ -21,6 +21,7 @@
 
 #include "FolderPicker.hxx"
 #include <com/sun/star/lang/DisposedException.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include "WinFOPImpl.hxx"
 
 //------------------------------------------------------------------------
@@ -149,20 +150,11 @@ OUString SAL_CALL CFolderPicker::getImplementationName(  )
     return OUString(RTL_CONSTASCII_USTRINGPARAM( FOLDERPICKER_IMPL_NAME ));
 }
 
-// -------------------------------------------------
 //  XServiceInfo
-// -------------------------------------------------
-
 sal_Bool SAL_CALL CFolderPicker::supportsService( const OUString& ServiceName )
     throw( RuntimeException )
 {
-    Sequence < OUString > SupportedServicesNames = FolderPicker_getSupportedServiceNames();
-
-    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-        if ( SupportedServicesNames[n] == ServiceName )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 // -------------------------------------------------
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 66c657e..fb00d9d 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -27,6 +27,7 @@
 #include <tools/urlobj.hxx>
 #include <ucbhelper/content.hxx>
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <unotools/streamwrap.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 
@@ -655,18 +656,12 @@ OUString SAL_CALL ConvDic::getImplementationName(  )
     return getImplementationName_Static();
 }
 
-
 sal_Bool SAL_CALL ConvDic::supportsService( const OUString& rServiceName )
     throw (RuntimeException)
 {
-    MutexGuard  aGuard( GetLinguMutex() );
-    sal_Bool bRes = sal_False;
-    if ( rServiceName == SN_CONV_DICTIONARY )
-        bRes = sal_True;
-    return bRes;
+    return cppu::supportsService(this, rServiceName);
 }
 
-
 uno::Sequence< OUString > SAL_CALL ConvDic::getSupportedServiceNames(  )
     throw (RuntimeException)
 {
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 45db201..2267e20 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -26,6 +26,7 @@
 #include <unotools/pathoptions.hxx>
 #include <unotools/useroptions.hxx>
 #include <cppuhelper/factory.hxx>   // helper for factories
+#include <cppuhelper/supportsservice.hxx>
 #include <unotools/localfilehelper.hxx>
 #include <comphelper/processfactory.hxx>
 #include <unotools/ucbstreamhelper.hxx>
@@ -739,17 +740,9 @@ OUString SAL_CALL DicList::getImplementationName(  ) throw(RuntimeException)
 sal_Bool SAL_CALL DicList::supportsService( const OUString& ServiceName )
         throw(RuntimeException)
 {
-    osl::MutexGuard aGuard( GetLinguMutex() );
-
-    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);
 }
 
-
 uno::Sequence< OUString > SAL_CALL DicList::getSupportedServiceNames(  )
         throw(RuntimeException)
 {
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index efde32c..5f2c51f 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -52,6 +52,7 @@
 #include <cppuhelper/implementationentry.hxx>
 #include <cppuhelper/interfacecontainer.h>
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <i18nlangtag/languagetag.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/extract.hxx>
@@ -1048,12 +1049,7 @@ sal_Bool SAL_CALL GrammarCheckingIterator::supportsService(
     const OUString & rServiceName )
 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] == rServiceName )
-            return sal_True;
-    return sal_False;
+    return cppu::supportsService(this, rServiceName);
 }
 
 
diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx
index a346442..090f0e9 100644
--- a/linguistic/source/hhconvdic.cxx
+++ b/linguistic/source/hhconvdic.cxx
@@ -25,6 +25,7 @@
 #include <ucbhelper/content.hxx>
 
 #include <cppuhelper/factory.hxx>   // helper for factories
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/linguistic2/XConversionDictionary.hpp>
 #include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
 #include <com/sun/star/lang/Locale.hpp>
@@ -121,11 +122,7 @@ OUString SAL_CALL HHConvDic::getImplementationName(  )
 sal_Bool SAL_CALL HHConvDic::supportsService( const OUString& rServiceName )
     throw (RuntimeException)
 {
-    MutexGuard  aGuard( GetLinguMutex() );
-    sal_Bool bRes = sal_False;
-    if ( rServiceName == SN_CONV_DICTIONARY || rServiceName == SN_HH_CONV_DICTIONARY )
-        bRes = sal_True;
-    return bRes;
+    return cppu::supportsService(this, rServiceName);
 }
 
 
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index 75babc9..9b6be98 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -29,6 +29,7 @@
 #include <cppuhelper/implbase1.hxx> // helper for implementations
 
 #include <cppuhelper/factory.hxx>   // helper for factories
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/registry/XSimpleRegistry.hpp>
 #include <com/sun/star/registry/XRegistryKey.hpp>
@@ -433,14 +434,7 @@ OUString SAL_CALL LinguProps::getImplementationName()
 sal_Bool SAL_CALL LinguProps::supportsService( const OUString& ServiceName )
         throw(RuntimeException)
 {
-    MutexGuard  aGuard( GetLinguMutex() );
-
-    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);
 }
 
 // XServiceInfo
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index a8aeeed..51dc170 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -34,6 +34,7 @@
 #include <i18nlangtag/lang.h>
 #include <i18nlangtag/languagetag.hxx>
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <comphelper/extract.hxx>
 
 #include <boost/checked_delete.hpp>
@@ -2053,14 +2054,7 @@ sal_Bool SAL_CALL
     LngSvcMgr::supportsService( const OUString& ServiceName )
         throw(uno::RuntimeException)
 {
-    osl::MutexGuard aGuard( GetLinguMutex() );
-
-    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/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx
index 775c2fa..e4e7dd9 100644
--- a/linguistic/workben/sspellimp.cxx
+++ b/linguistic/workben/sspellimp.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/registry/XRegistryKey.hpp>
 #include <comphelper/string.hxx>
 #include <cppuhelper/factory.hxx>   // helper for factories
+#include <cppuhelper/supportsservice.hxx>
 #include <tools/debug.hxx>
 #include <osl/mutex.hxx>
 
@@ -415,17 +416,9 @@ OUString SAL_CALL SpellChecker::getImplementationName()
 sal_Bool SAL_CALL SpellChecker::supportsService( const OUString& ServiceName )
         throw(RuntimeException)
 {
-    MutexGuard  aGuard( GetLinguMutex() );
-
-    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 > SAL_CALL SpellChecker::getSupportedServiceNames()
         throw(RuntimeException)
 {
diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx
index e3a7bac..6cd4798 100644
--- a/unoxml/source/dom/documentbuilder.cxx
+++ b/unoxml/source/dom/documentbuilder.cxx
@@ -33,6 +33,7 @@
 
 #include <comphelper/processfactory.hxx>
 #include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/xml/sax/SAXParseException.hpp>
 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
@@ -132,12 +133,7 @@ namespace DOM
     sal_Bool SAL_CALL CDocumentBuilder::supportsService(const OUString& aServiceName)
         throw (RuntimeException)
     {
-        Sequence< OUString > supported = CDocumentBuilder::_getSupportedServiceNames();
-        for (sal_Int32 i=0; i<supported.getLength(); i++)
-        {
-            if (supported[i] == aServiceName) return sal_True;
-        }
-        return sal_False;
+        return cppu::supportsService(this, aServiceName);
     }
 
     Reference< XDOMImplementation > SAL_CALL CDocumentBuilder::getDOMImplementation()
diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx
index 75edd9a..8e1c69c 100644
--- a/unoxml/source/dom/saxbuilder.cxx
+++ b/unoxml/source/dom/saxbuilder.cxx
@@ -24,7 +24,7 @@
 
 #include <com/sun/star/xml/dom/DocumentBuilder.hpp>
 #include <comphelper/processfactory.hxx>
-
+#include <cppuhelper/supportsservice.hxx>
 
 namespace DOM
 {
@@ -73,15 +73,9 @@ namespace DOM
     sal_Bool SAL_CALL CSAXDocumentBuilder::supportsService(const OUString& aServiceName)
         throw (RuntimeException)
     {
-        Sequence< OUString > supported = CSAXDocumentBuilder::_getSupportedServiceNames();
-        for (sal_Int32 i=0; i<supported.getLength(); i++)
-        {
-            if (supported[i] == aServiceName) return sal_True;
-        }
-        return sal_False;
+        return cppu::supportsService(this, aServiceName);
     }
 
-
     SAXDocumentBuilderState SAL_CALL CSAXDocumentBuilder::getState()
         throw (RuntimeException)
     {
diff --git a/unoxml/source/events/testlistener.cxx b/unoxml/source/events/testlistener.cxx
index f99d53f..9c9dad0 100644
--- a/unoxml/source/events/testlistener.cxx
+++ b/unoxml/source/events/testlistener.cxx
@@ -19,6 +19,7 @@
 #include <stdio.h>
 
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <cppuhelper/supportsservice.hxx>
 
 #include "testlistener.hxx"
 
@@ -74,12 +75,7 @@ namespace DOM { namespace events
     sal_Bool SAL_CALL CTestListener::supportsService(const OUString& aServiceName)
         throw (RuntimeException)
     {
-        Sequence< OUString > supported = CTestListener::_getSupportedServiceNames();
-        for (sal_Int32 i=0; i<supported.getLength(); i++)
-        {
-            if (supported[i] == aServiceName) return sal_True;
-        }
-        return sal_False;
+        return cppu::supportsService(this, aServiceName);
     }
 
     // --- XInitialize
diff --git a/unoxml/source/rdf/CBlankNode.cxx b/unoxml/source/rdf/CBlankNode.cxx
index f4540cf..8b46929 100644
--- a/unoxml/source/rdf/CBlankNode.cxx
+++ b/unoxml/source/rdf/CBlankNode.cxx
@@ -20,6 +20,7 @@
 #include "CNodes.hxx"
 
 #include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/rdf/XBlankNode.hpp>
@@ -72,12 +73,7 @@ OUString SAL_CALL CBlankNode::getImplementationName() throw (css::uno::RuntimeEx
 
 ::sal_Bool SAL_CALL CBlankNode::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException)
 {
-    css::uno::Sequence< OUString > serviceNames = comp_CBlankNode::_getSupportedServiceNames();
-    for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
-        if (serviceNames[i] == serviceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 css::uno::Sequence< OUString > SAL_CALL CBlankNode::getSupportedServiceNames() throw (css::uno::RuntimeException)
diff --git a/unoxml/source/rdf/CLiteral.cxx b/unoxml/source/rdf/CLiteral.cxx
index 14c3fca..e19d4cf 100644
--- a/unoxml/source/rdf/CLiteral.cxx
+++ b/unoxml/source/rdf/CLiteral.cxx
@@ -20,6 +20,7 @@
 #include "CNodes.hxx"
 
 #include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/rdf/XLiteral.hpp>
@@ -81,12 +82,7 @@ OUString SAL_CALL CLiteral::getImplementationName() throw (css::uno::RuntimeExce
 
 ::sal_Bool SAL_CALL CLiteral::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException)
 {
-    css::uno::Sequence< OUString > serviceNames = comp_CLiteral::_getSupportedServiceNames();
-    for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
-        if (serviceNames[i] == serviceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 css::uno::Sequence< OUString > SAL_CALL CLiteral::getSupportedServiceNames() throw (css::uno::RuntimeException)
diff --git a/unoxml/source/rdf/CURI.cxx b/unoxml/source/rdf/CURI.cxx
index 63ff77e..474135e 100644
--- a/unoxml/source/rdf/CURI.cxx
+++ b/unoxml/source/rdf/CURI.cxx
@@ -20,6 +20,7 @@
 #include "CNodes.hxx"
 
 #include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/rdf/XURI.hpp>
@@ -81,12 +82,7 @@ OUString SAL_CALL CURI::getImplementationName() throw (css::uno::RuntimeExceptio
 
 ::sal_Bool SAL_CALL CURI::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException)
 {
-    css::uno::Sequence< OUString > serviceNames = comp_CURI::_getSupportedServiceNames();
-    for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
-        if (serviceNames[i] == serviceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 css::uno::Sequence< OUString > SAL_CALL CURI::getSupportedServiceNames() throw (css::uno::RuntimeException)
diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx
index 120c0ca..e25514f 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -54,6 +54,7 @@
 #include <cppuhelper/implbase1.hxx>
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <comphelper/stlunosequence.hxx>
 #include <comphelper/sequenceasvector.hxx>
@@ -820,13 +821,7 @@ throw (uno::RuntimeException)
 ::sal_Bool SAL_CALL librdf_Repository::supportsService(
     OUString const & serviceName) throw (uno::RuntimeException)
 {
-    uno::Sequence< OUString > serviceNames
-        = comp_librdf_Repository::_getSupportedServiceNames();
-    for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
-        if (serviceNames[i] == serviceName)
-            return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService(this, serviceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx
index 690dcfc..69960a0 100644
--- a/unoxml/source/xpath/xpathapi.cxx
+++ b/unoxml/source/xpath/xpathapi.cxx
@@ -35,6 +35,7 @@
 #include "../dom/node.hxx"
 #include "../dom/document.hxx"
 
+#include <cppuhelper/supportsservice.hxx>
 
 using ::com::sun::star::lang::XMultiServiceFactory;
 
@@ -89,16 +90,9 @@ namespace XPath
     sal_Bool SAL_CALL CXPathAPI::supportsService(const OUString& aServiceName)
         throw (RuntimeException)
     {
-        Sequence< OUString > supported = CXPathAPI::_getSupportedServiceNames();
-        for (sal_Int32 i=0; i<supported.getLength(); i++)
-        {
-            if (supported[i] == aServiceName) return sal_True;
-        }
-        return sal_False;
+        return cppu::supportsService(this, aServiceName);
     }
 
-    // -------------------------------------------------------------------
-
     void SAL_CALL CXPathAPI::registerNS(
             const OUString& aPrefix,
             const OUString& aURI)
diff --git a/uui/source/interactionhandler.cxx b/uui/source/interactionhandler.cxx
index de0a13c..207b968 100644
--- a/uui/source/interactionhandler.cxx
+++ b/uui/source/interactionhandler.cxx
@@ -21,6 +21,7 @@
 #include "interactionhandler.hxx"
 #include "comphelper/namedvaluecollection.hxx"
 #include "comphelper/processfactory.hxx"
+#include <cppuhelper/supportsservice.hxx>
 #include "com/sun/star/awt/XWindow.hpp"
 
 using namespace com::sun::star;
@@ -48,12 +49,7 @@ sal_Bool SAL_CALL
 UUIInteractionHandler::supportsService(OUString const & rServiceName)
     throw (uno::RuntimeException)
 {
-    uno::Sequence< OUString >
-    aNames(getSupportedServiceNames_static());
-    for (sal_Int32 i = 0; i < aNames.getLength(); ++i)
-        if (aNames[i] == rServiceName)
-            return true;
-    return false;
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx
index 1ee48589f9..a0bca11 100644
--- a/uui/source/passwordcontainer.cxx
+++ b/uui/source/passwordcontainer.cxx
@@ -19,6 +19,7 @@
 
 #include "comphelper/processfactory.hxx"
 #include "cppuhelper/factory.hxx"
+#include <cppuhelper/supportsservice.hxx>
 
 #include "com/sun/star/lang/XMultiServiceFactory.hpp"
 #include "com/sun/star/task/NoMasterException.hpp"
@@ -308,14 +309,7 @@ PasswordContainerInteractionHandler::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/uui/source/requeststringresolver.cxx b/uui/source/requeststringresolver.cxx
index 918b1ff..28698a1 100644
--- a/uui/source/requeststringresolver.cxx
+++ b/uui/source/requeststringresolver.cxx
@@ -20,6 +20,7 @@
 #include "requeststringresolver.hxx"
 #include "iahndl.hxx"
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace com::sun;
 
@@ -48,12 +49,7 @@ UUIInteractionRequestStringResolver::supportsService(
         OUString const & rServiceName)
     throw (star::uno::RuntimeException)
 {
-    star::uno::Sequence< OUString >
-        aNames(getSupportedServiceNames_static());
-    for (sal_Int32 i = 0; i < aNames.getLength(); ++i)
-        if (aNames[i] == rServiceName)
-            return true;
-    return false;
+    return cppu::supportsService(this, rServiceName);
 }
 
 star::uno::Sequence< OUString > SAL_CALL
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index d5a3f34..57ecb57 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -21,6 +21,7 @@
 #include <com/sun/star/xml/AttributeData.hpp>
 #include <rtl/ustrbuf.hxx>
 #include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <limits.h>
 
 #include <xmloff/xmlcnimp.hxx>
@@ -263,16 +264,7 @@ uno::Sequence< OUString > SvUnoAttributeContainer::getSupportedServiceNames(void
 sal_Bool SvUnoAttributeContainer::supportsService(const OUString& ServiceName)
     throw( uno::RuntimeException )
 {
-    const uno::Sequence < OUString > aServiceNames( getSupportedServiceNames() );
-    const OUString* pNames = aServiceNames.getConstArray();
-    sal_Int32 nCount = aServiceNames.getLength();
-    while( nCount-- )
-    {
-        if( *pNames++ == ServiceName )
-            return sal_True;
-    }
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list