fdo#54938: Convert sw to use cppu::supportsService

Change-Id: Ic27bf31e5eb991ccceb8b97713d1e50a736709c8
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index 137fa4c..8bc30eb 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include <cellfrm.hxx>
#include <tabfrm.hxx>
@@ -247,14 +248,10 @@ OUString SAL_CALL SwAccessibleCell::getImplementationName()
    return OUString(sImplementationName);
}

sal_Bool SAL_CALL SwAccessibleCell::supportsService(
        const OUString& sTestServiceName)
sal_Bool SAL_CALL SwAccessibleCell::supportsService(const OUString& sTestServiceName)
    throw (uno::RuntimeException)
{
    return sTestServiceName.equalsAsciiL( sServiceName,
                                          sizeof(sServiceName)-1 ) ||
           sTestServiceName.equalsAsciiL( sAccessibleServiceName,
                                             sizeof(sAccessibleServiceName)-1 );
    return cppu::supportsService(this, sTestServiceName);
}

uno::Sequence< OUString > SAL_CALL SwAccessibleCell::getSupportedServiceNames()
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 893c63c..44af38c 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -44,6 +44,7 @@
#include <acccontext.hxx>
#include <svx/AccessibleShape.hxx>
#include <comphelper/accessibleeventnotifier.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "accpara.hxx"
#include <PostItMgr.hxx>

@@ -988,12 +989,10 @@ OUString SAL_CALL SwAccessibleContext::getImplementationName()
    THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "implementation name needs to be overloaded" )
}

sal_Bool SAL_CALL
    SwAccessibleContext::supportsService (const OUString& )
sal_Bool SAL_CALL SwAccessibleContext::supportsService (const OUString& ServiceName)
        throw (uno::RuntimeException)
{
    OSL_ENSURE( !this, "supports service needs to be overloaded" );
    THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "supports service needs to be overloaded" )
    return cppu::supportsService(this, ServiceName);
}

uno::Sequence< OUString > SAL_CALL SwAccessibleContext::getSupportedServiceNames()
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 7403608..1d49da2 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -29,6 +29,7 @@
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <viewsh.hxx>
#include <doc.hxx>
#include <accmap.hxx>
@@ -435,14 +436,10 @@ OUString SAL_CALL SwAccessibleDocument::getImplementationName()
    return OUString(sImplementationName);
}

sal_Bool SAL_CALL SwAccessibleDocument::supportsService(
        const OUString& sTestServiceName)
sal_Bool SAL_CALL SwAccessibleDocument::supportsService(const OUString& sTestServiceName)
    throw (uno::RuntimeException)
{
    return sTestServiceName.equalsAsciiL( sServiceName,
                                          sizeof(sServiceName)-1 ) ||
           sTestServiceName.equalsAsciiL( sAccessibleServiceName,
                                             sizeof(sAccessibleServiceName)-1 );
    return cppu::supportsService(this, sTestServiceName);
}

uno::Sequence< OUString > SAL_CALL SwAccessibleDocument::getSupportedServiceNames()
diff --git a/sw/source/core/access/accembedded.cxx b/sw/source/core/access/accembedded.cxx
index 7744efc..61680c5 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <flyfrm.hxx>
#include "accembedded.hxx"
#include "cntfrm.hxx"
@@ -34,7 +35,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::accessibility;

const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextEmbeddedObject";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleEmbeddedObject";

SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject(
@@ -80,14 +80,10 @@ OUString SAL_CALL SwAccessibleEmbeddedObject::getImplementationName()
    return OUString(sImplementationName);
}

sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(
        const OUString& sTestServiceName)
sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(const OUString& sTestServiceName)
    throw (uno::RuntimeException)
{
    return sTestServiceName.equalsAsciiL( sServiceName,
                                          sizeof(sServiceName)-1 ) ||
           sTestServiceName.equalsAsciiL( sAccessibleServiceName,
                                             sizeof(sAccessibleServiceName)-1 );
    return cppu::supportsService(this, sTestServiceName);
}

uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServiceNames()
@@ -95,7 +91,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServi
{
    uno::Sequence< OUString > aRet(2);
    OUString* pArray = aRet.getArray();
    pArray[0] = OUString( sServiceName );
    pArray[0] = "com.sun.star.text.AccessibleTextEmbeddedObject";
    pArray[1] = OUString( sAccessibleServiceName );
    return aRet;
}
diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx
index 24afed8..b23c07f 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include <ftnfrm.hxx>
#include <fmtftn.hxx>
@@ -102,18 +103,10 @@ OUString SAL_CALL SwAccessibleFootnote::getImplementationName()
        return OUString(sImplementationNameFootnote);
}

sal_Bool SAL_CALL SwAccessibleFootnote::supportsService(
        const OUString& sTestServiceName)
sal_Bool SAL_CALL SwAccessibleFootnote::supportsService(const OUString& sTestServiceName)
    throw (uno::RuntimeException)
{
    if( sTestServiceName.equalsAsciiL( sAccessibleServiceName,
                                       sizeof(sAccessibleServiceName)-1 ) )
        return sal_True;
    else if( AccessibleRole::END_NOTE == GetRole() )
        return sTestServiceName.equalsAsciiL( sServiceNameEndnote, sizeof(sServiceNameEndnote)-1 );
    else
        return sTestServiceName.equalsAsciiL( sServiceNameFootnote, sizeof(sServiceNameFootnote)-1 );

    return cppu::supportsService(this, sTestServiceName);
}

Sequence< OUString > SAL_CALL SwAccessibleFootnote::getSupportedServiceNames()
diff --git a/sw/source/core/access/accgraphic.cxx b/sw/source/core/access/accgraphic.cxx
index cc5b63d..5326df0 100644
--- a/sw/source/core/access/accgraphic.cxx
+++ b/sw/source/core/access/accgraphic.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <flyfrm.hxx>
#include <fmturl.hxx>
#include "accgraphic.hxx"
@@ -30,9 +31,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility;

const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextGraphicObject";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleGraphic";

SwAccessibleGraphic::SwAccessibleGraphic(
        SwAccessibleMap* pInitMap,
        const SwFlyFrm* pFlyFrm  ) :
@@ -47,17 +45,13 @@ SwAccessibleGraphic::~SwAccessibleGraphic()
OUString SAL_CALL SwAccessibleGraphic::getImplementationName()
        throw( RuntimeException )
{
    return OUString(sImplementationName);
    return OUString("com.sun.star.comp.Writer.SwAccessibleGraphic");
}

sal_Bool SAL_CALL SwAccessibleGraphic::supportsService(
        const OUString& sTestServiceName)
sal_Bool SAL_CALL SwAccessibleGraphic::supportsService(const OUString& sTestServiceName)
    throw (uno::RuntimeException)
{
    return sTestServiceName.equalsAsciiL( sServiceName,
                                          sizeof(sServiceName)-1 ) ||
           sTestServiceName.equalsAsciiL( sAccessibleServiceName,
                                             sizeof(sAccessibleServiceName)-1 );
    return cppu::supportsService(this, sTestServiceName);
}

Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
@@ -65,7 +59,7 @@ Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
{
    Sequence< OUString > aRet(2);
    OUString* pArray = aRet.getArray();
    pArray[0] = OUString( sServiceName );
    pArray[0] = "com.sun.star.text.AccessibleTextGraphicObject";
    pArray[1] = OUString( sAccessibleServiceName );
    return aRet;
}
diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx
index ed0eba4..38016a3 100644
--- a/sw/source/core/access/accheaderfooter.cxx
+++ b/sw/source/core/access/accheaderfooter.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include <hffrm.hxx>
#include "accheaderfooter.hxx"
@@ -32,8 +33,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility;

const sal_Char sServiceNameHeader[] = "com.sun.star.text.AccessibleHeaderView";
const sal_Char sServiceNameFooter[] = "com.sun.star.text.AccessibleFooterView";
const sal_Char sImplementationNameHeader[] = "com.sun.star.comp.Writer.SwAccessibleHeaderView";
const sal_Char sImplementationNameFooter[] = "com.sun.star.comp.Writer.SwAccessibleFooterView";

@@ -88,18 +87,10 @@ OUString SAL_CALL SwAccessibleHeaderFooter::getImplementationName()
        return OUString(sImplementationNameFooter);
}

sal_Bool SAL_CALL SwAccessibleHeaderFooter::supportsService(
        const OUString& sTestServiceName)
sal_Bool SAL_CALL SwAccessibleHeaderFooter::supportsService(const OUString& sTestServiceName)
    throw (uno::RuntimeException)
{
    if( sTestServiceName.equalsAsciiL( sAccessibleServiceName,
                                       sizeof(sAccessibleServiceName)-1 ) )
        return sal_True;
    else if( AccessibleRole::HEADER == GetRole() )
        return sTestServiceName.equalsAsciiL( sServiceNameHeader, sizeof(sServiceNameHeader)-1 );
    else
        return sTestServiceName.equalsAsciiL( sServiceNameFooter, sizeof(sServiceNameFooter)-1 );

    return cppu::supportsService(this, sTestServiceName);
}

Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames()
@@ -108,9 +99,9 @@ Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames
    Sequence< OUString > aRet(2);
    OUString* pArray = aRet.getArray();
    if( AccessibleRole::HEADER == GetRole() )
        pArray[0] = OUString( sServiceNameHeader );
        pArray[0] = "com.sun.star.text.AccessibleHeaderView";
    else
        pArray[0] = OUString( sServiceNameFooter );
        pArray[0] = "com.sun.star.text.AccessibleFooterView";
    pArray[1] = OUString( sAccessibleServiceName );
    return aRet;
}
diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx
index cc1ee1d..b20506a 100644
--- a/sw/source/core/access/accpage.cxx
+++ b/sw/source/core/access/accpage.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "accpage.hxx"

#include "access.hrc"
@@ -144,9 +145,7 @@ OUString SwAccessiblePage::getImplementationName( )
sal_Bool SwAccessiblePage::supportsService( const OUString& rServiceName)
    throw( RuntimeException )
{
    return rServiceName.equalsAsciiL( sServiceName, sizeof(sServiceName)-1 ) ||
           rServiceName.equalsAsciiL( sAccessibleServiceName,
                                   sizeof(sAccessibleServiceName)-1 );
    return cppu::supportsService(this, rServiceName);
}

Sequence<OUString> SwAccessiblePage::getSupportedServiceNames( )
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index c2b0671..062e63a 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -91,6 +91,7 @@
#include <parachangetrackinginfo.hxx>
#include <com/sun/star/text/TextMarkupType.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>

#include <reffld.hxx>
#include <docufld.hxx>
@@ -1219,10 +1220,7 @@ sal_Bool SAL_CALL SwAccessibleParagraph::supportsService(
        const OUString& sTestServiceName)
    throw (uno::RuntimeException)
{
    return sTestServiceName.equalsAsciiL( sServiceName,
                                          sizeof(sServiceName)-1 ) ||
           sTestServiceName.equalsAsciiL( sAccessibleServiceName,
                                             sizeof(sAccessibleServiceName)-1 );
    return cppu::supportsService(this, sTestServiceName);
}

uno::Sequence< OUString > SAL_CALL SwAccessibleParagraph::getSupportedServiceNames()
diff --git a/sw/source/core/access/accpreview.cxx b/sw/source/core/access/accpreview.cxx
index 9ca0ffe..853ed2e 100644
--- a/sw/source/core/access/accpreview.cxx
+++ b/sw/source/core/access/accpreview.cxx
@@ -20,10 +20,10 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "access.hrc"
#include <accpreview.hxx>

const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextDocumentPageView";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentPageView";

using ::com::sun::star::lang::IndexOutOfBoundsException;
@@ -51,14 +51,14 @@ OUString SwAccessiblePreview::getImplementationName( )
sal_Bool SwAccessiblePreview::supportsService( const OUString& rServiceName )
    throw( RuntimeException )
{
    return rServiceName == sServiceName || rServiceName == sAccessibleServiceName;
    return cppu::supportsService(this, rServiceName);
}

Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( )
    throw( RuntimeException )
{
    Sequence<OUString> aSeq( 2 );
    aSeq[0] = OUString( sServiceName );
    aSeq[0] = "com.sun.star.text.AccessibleTextDocumentPageView";
    aSeq[1] = OUString( sAccessibleServiceName );
    return aSeq;
}
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 92e1b09..9233ee9 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -53,14 +53,12 @@
#include <frmatr.hxx>

#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>

using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using namespace ::sw::access;

const sal_Char sServiceName[] = "com.sun.star.table.AccessibleTableView";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleTableView";

typedef ::std::less < sal_Int32 > Int32Less_Impl;
typedef ::std::set < sal_Int32, Int32Less_Impl > Int32Set_Impl;

@@ -1370,17 +1368,14 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumn(
OUString SAL_CALL SwAccessibleTable::getImplementationName()
        throw( uno::RuntimeException )
{
    return OUString(sImplementationName);
    return OUString("com.sun.star.comp.Writer.SwAccessibleTableView");
}

sal_Bool SAL_CALL SwAccessibleTable::supportsService(
        const OUString& sTestServiceName)
    throw (uno::RuntimeException)
{
    return sTestServiceName.equalsAsciiL( sServiceName,
                                          sizeof(sServiceName)-1 ) ||
           sTestServiceName.equalsAsciiL( sAccessibleServiceName,
                                             sizeof(sAccessibleServiceName)-1 );
    return cppu::supportsService(this, sTestServiceName);
}

uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames()
@@ -1388,7 +1383,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames()
{
    uno::Sequence< OUString > aRet(2);
    OUString* pArray = aRet.getArray();
    pArray[0] = OUString( sServiceName );
    pArray[0] = "com.sun.star.table.AccessibleTableView";
    pArray[1] = OUString( sAccessibleServiceName );
    return aRet;
}
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index 1a2aa61..dc6bc34 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -19,6 +19,7 @@

#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
@@ -42,8 +43,6 @@ using namespace ::com::sun::star::accessibility;
using utl::AccessibleRelationSetHelper;
using ::com::sun::star::accessibility::XAccessibleContext;

const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextFrameView";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleTextFrameView";

SwAccessibleTextFrame::SwAccessibleTextFrame(
        SwAccessibleMap* pInitMap,
@@ -288,17 +287,13 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleDescription (void)
OUString SAL_CALL SwAccessibleTextFrame::getImplementationName()
        throw( uno::RuntimeException )
{
    return OUString(sImplementationName);
    return OUString("com.sun.star.comp.Writer.SwAccessibleTextFrameView");
}

sal_Bool SAL_CALL SwAccessibleTextFrame::supportsService(
        const OUString& sTestServiceName)
sal_Bool SAL_CALL SwAccessibleTextFrame::supportsService(const OUString& sTestServiceName)
    throw (uno::RuntimeException)
{
    return sTestServiceName.equalsAsciiL( sServiceName,
                                          sizeof(sServiceName)-1 ) ||
           sTestServiceName.equalsAsciiL( sAccessibleServiceName,
                                             sizeof(sAccessibleServiceName)-1 );
    return cppu::supportsService(this, sTestServiceName);
}

uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNames()
@@ -306,7 +301,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNam
{
    uno::Sequence< OUString > aRet(2);
    OUString* pArray = aRet.getArray();
    pArray[0] = OUString( sServiceName );
    pArray[0] = "com.sun.star.text.AccessibleTextFrameView";
    pArray[1] = OUString( sAccessibleServiceName );
    return aRet;
}
diff --git a/sw/source/core/docnode/finalthreadmanager.cxx b/sw/source/core/docnode/finalthreadmanager.cxx
index 2fdb442..0dec4ff 100644
--- a/sw/source/core/docnode/finalthreadmanager.cxx
+++ b/sw/source/core/docnode/finalthreadmanager.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <rtl/ustring.hxx>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <cppuhelper/supportsservice.hxx>

/** thread to cancel a give list of cancellable jobs

@@ -283,12 +284,7 @@ OUString SAL_CALL FinalThreadManager::getImplementationName() throw (css::uno::R

::sal_Bool SAL_CALL FinalThreadManager::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException)
{
    css::uno::Sequence< OUString > serviceNames = comp_FinalThreadManager::_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 FinalThreadManager::getSupportedServiceNames() throw (css::uno::RuntimeException)
diff --git a/sw/source/core/layout/dumpfilter.cxx b/sw/source/core/layout/dumpfilter.cxx
index c6275c3..6e8f14c 100644
--- a/sw/source/core/layout/dumpfilter.cxx
+++ b/sw/source/core/layout/dumpfilter.cxx
@@ -10,6 +10,7 @@
#include "dumpfilter.hxx"

#include <wrtsh.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <docsh.hxx>
#include <rootfrm.hxx>
#include <unotxdoc.hxx>
@@ -166,16 +167,7 @@ namespace sw
    sal_Bool LayoutDumpFilter::supportsService( const OUString& rServiceName )
        throw (uno::RuntimeException)
    {
        uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames();
        const OUString* pArray = seqServiceNames.getConstArray();
        for ( sal_Int32 nCounter=0; nCounter < seqServiceNames.getLength(); nCounter++ )
        {
            if ( pArray[nCounter] == rServiceName )
            {
                return sal_True ;
            }
        }
        return sal_False ;
        return cppu::supportsService(this, rServiceName);
    }

    uno::Sequence< OUString > LayoutDumpFilter::getSupportedServiceNames()
diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx
index 70712cc..1acbf41 100644
--- a/sw/source/core/unocore/SwXTextDefaults.cxx
+++ b/sw/source/core/unocore/SwXTextDefaults.cxx
@@ -27,6 +27,7 @@
#include <SwStyleNameMapper.hxx>
#include <fchrfmt.hxx>
#include <charfmt.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <docstyle.hxx>
#include <doc.hxx>
#include <docsh.hxx>
@@ -238,22 +239,18 @@ Any SAL_CALL SwXTextDefaults::getPropertyDefault( const OUString& rPropertyName 
    return aRet;
}


OUString SAL_CALL SwXTextDefaults::getImplementationName(  )
    throw (RuntimeException)
{
    return OUString("SwXTextDefaults");
}


sal_Bool SAL_CALL SwXTextDefaults::supportsService( const OUString& rServiceName )
    throw (RuntimeException)
{
    uno::Sequence< OUString > aSeq(getSupportedServiceNames());
    return std::find(aSeq.begin(), aSeq.end(), rServiceName) != aSeq.end();
    return cppu::supportsService(this, rServiceName);
}


uno::Sequence< OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNames(  )
    throw (RuntimeException)
{
@@ -269,6 +266,4 @@ uno::Sequence< OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNames(  )
    return aRet;
}



/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index f996ad5..dcda8ce 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart2/data/LabelOrigin.hpp>
#include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <svl/zforlist.hxx>
@@ -46,11 +47,6 @@
#include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx>

#define SN_DATA_PROVIDER            "com.sun.star.chart2.data.DataProvider"
#define SN_DATA_SOURCE              "com.sun.star.chart2.data.DataSource"
#define SN_DATA_SEQUENCE            "com.sun.star.chart2.data.DataSequence"
#define SN_LABELED_DATA_SEQUENCE    "com.sun.star.chart2.data.LabeledDataSequence"

using namespace ::com::sun::star;

// from unotbl.cxx
@@ -1505,12 +1501,10 @@ OUString SAL_CALL SwChartDataProvider::getImplementationName(  )
    return OUString("SwChartDataProvider");
}

sal_Bool SAL_CALL SwChartDataProvider::supportsService(
        const OUString& rServiceName )
sal_Bool SAL_CALL SwChartDataProvider::supportsService(const OUString& rServiceName )
    throw (uno::RuntimeException)
{
    SolarMutexGuard aGuard;
    return rServiceName == SN_DATA_PROVIDER;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames(  )
@@ -1518,7 +1512,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames
{
    SolarMutexGuard aGuard;
    uno::Sequence< OUString > aRes(1);
    aRes.getArray()[0] = SN_DATA_PROVIDER;
    aRes.getArray()[0] = "com.sun.star.chart2.data.DataProvider";
    return aRes;
}

@@ -1894,12 +1888,10 @@ OUString SAL_CALL SwChartDataSource::getImplementationName(  )
    return OUString("SwChartDataSource");
}

sal_Bool SAL_CALL SwChartDataSource::supportsService(
        const OUString& rServiceName )
sal_Bool SAL_CALL SwChartDataSource::supportsService(const OUString& rServiceName )
    throw (uno::RuntimeException)
{
    SolarMutexGuard aGuard;
    return rServiceName == SN_DATA_SOURCE;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames(  )
@@ -1907,7 +1899,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames( 
{
    SolarMutexGuard aGuard;
    uno::Sequence< OUString > aRes(1);
    aRes.getArray()[0] = SN_DATA_SOURCE;
    aRes.getArray()[0] = "com.sun.star.chart2.data.DataSource";
    return aRes;
}

@@ -2354,11 +2346,10 @@ OUString SAL_CALL SwChartDataSequence::getImplementationName(  )
    return OUString("SwChartDataSequence");
}

sal_Bool SAL_CALL SwChartDataSequence::supportsService(
        const OUString& rServiceName )
sal_Bool SAL_CALL SwChartDataSequence::supportsService(const OUString& rServiceName )
    throw (uno::RuntimeException)
{
    return rServiceName == SN_DATA_SEQUENCE;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames(  )
@@ -2366,7 +2357,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames
{
    SolarMutexGuard aGuard;
    uno::Sequence< OUString > aRes(1);
    aRes.getArray()[0] = SN_DATA_SEQUENCE;
    aRes.getArray()[0] = "com.sun.star.chart2.data.DataSequence";
    return aRes;
}

@@ -2867,7 +2858,7 @@ sal_Bool SAL_CALL SwChartLabeledDataSequence::supportsService(
        const OUString& rServiceName )
    throw (uno::RuntimeException)
{
    return rServiceName == SN_LABELED_DATA_SEQUENCE;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL SwChartLabeledDataSequence::getSupportedServiceNames(  )
@@ -2875,7 +2866,8 @@ uno::Sequence< OUString > SAL_CALL SwChartLabeledDataSequence::getSupportedServi
{
    SolarMutexGuard aGuard;
    uno::Sequence< OUString > aRes(1);
    aRes.getArray()[0] = SN_LABELED_DATA_SEQUENCE;
    aRes.getArray()[0] = "com.sun.star.chart2.data.LabeledDataSequence";

    return aRes;
}

diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 58f36a2..0d22540 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -58,6 +58,7 @@
#include <unochart.hxx>
#include <comphelper/makesequence.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <list>
#include <iterator>
#include <unosection.hxx>
@@ -982,7 +983,7 @@ OUString SwXTextTables::getImplementationName(void) throw( uno::RuntimeException

sal_Bool SwXTextTables::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextTables";
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( uno::RuntimeException )
@@ -1140,7 +1141,7 @@ OUString SwXFrameEnumeration<T>::getImplementationName(void) throw( RuntimeExcep
template<FlyCntType T>
sal_Bool SwXFrameEnumeration<T>::supportsService(const OUString& ServiceName) throw( RuntimeException )
{
    return ServiceName == "com.sun.star.container.XEnumeration";
    return cppu::supportsService(this, ServiceName);
}

template<FlyCntType T>
@@ -1159,7 +1160,7 @@ OUString SwXFrames::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextFrames";
    return cppu::supportsService(this, rServiceName);
}

Sequence<OUString> SwXFrames::getSupportedServiceNames(void) throw( RuntimeException )
@@ -1326,7 +1327,7 @@ OUString SwXTextFrames::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextFrames";
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( RuntimeException )
@@ -1356,7 +1357,7 @@ OUString SwXTextGraphicObjects::getImplementationName(void) throw( RuntimeExcept

sal_Bool SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextGraphicObjects";
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw( RuntimeException )
@@ -1386,7 +1387,7 @@ OUString SwXTextEmbeddedObjects::getImplementationName(void) throw( RuntimeExcep

sal_Bool SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextEmbeddedObjects";
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) throw( RuntimeException )
@@ -1413,7 +1414,7 @@ OUString SwXTextSections::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextSections";
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( RuntimeException )
@@ -1601,7 +1602,7 @@ OUString SwXBookmarks::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXBookmarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return OUString("com.sun.star.text.Bookmarks") == rServiceName;
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXBookmarks::getSupportedServiceNames(void) throw( RuntimeException )
@@ -1810,7 +1811,7 @@ OUString SwXFootnotes::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.Footnotes";
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( RuntimeException )
@@ -1909,7 +1910,7 @@ OUString SwXReferenceMarks::getImplementationName(void) throw( RuntimeException 

sal_Bool SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.ReferenceMarks";
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( RuntimeException )
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index e832d08..9033c16 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -55,6 +55,7 @@
#include <crstate.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/makesequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <svx/scene3d.hxx>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <fmtwrapinfluenceonobjpos.hxx>
@@ -433,7 +434,7 @@ OUString SwXShapesEnumeration::getImplementationName(void) throw(uno::RuntimeExc

sal_Bool SwXShapesEnumeration::supportsService(const OUString& ServiceName) throw(uno::RuntimeException)
{
    return ServiceName == "com.sun.star.container.XEnumeration";
    return cppu::supportsService(this, ServiceName);
}

uno::Sequence< OUString > SwXShapesEnumeration::getSupportedServiceNames(void) throw(uno::RuntimeException)
@@ -458,7 +459,7 @@ OUString SwXDrawPage::getImplementationName(void) throw( uno::RuntimeException )

sal_Bool SwXDrawPage::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    return rServiceName == "com.sun.star.drawing.GenericDrawPage";
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXDrawPage::getSupportedServiceNames(void) throw( uno::RuntimeException )
@@ -2132,16 +2133,7 @@ OUString SwXShape::getImplementationName(void) throw( uno::RuntimeException )

sal_Bool SwXShape::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    sal_Bool bRet = sal_False;
    if (rServiceName == "com.sun.star.drawing.Shape")
        bRet = sal_True;
    else if(xShapeAgg.is())
    {
        uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShapeAgg, uno::UNO_QUERY);
        SvxShape* pSvxShape = GetSvxShape();
        bRet = pSvxShape->supportsService(rServiceName);
    }
    return bRet;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXShape::getSupportedServiceNames(void) throw( uno::RuntimeException )
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 96ba067..5ca5911 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -43,6 +43,7 @@
#include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/Date.hpp>
@@ -489,15 +490,10 @@ OUString getServiceName(const sal_uInt16 aId)

}

sal_Bool SAL_CALL
SwXFieldMaster::supportsService(const OUString& rServiceName)
sal_Bool SAL_CALL SwXFieldMaster::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
{
    if (rServiceName=="com.sun.star.text.TextFieldMaster")
        return sal_True;

    const OUString sName(getServiceName(m_pImpl->m_nResTypeId));
    return !sName.isEmpty() && sName==rServiceName;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL
@@ -2476,15 +2472,7 @@ static OUString OldNameToNewName_Impl( const OUString &rOld )
sal_Bool SAL_CALL SwXTextField::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
{
    OUString sServiceName =
        SwXServiceProvider::GetProviderName(m_pImpl->m_nServiceId);

    // case-corected version of service-name (see #i67811)
    // (need to supply both because of compatibility to older versions)
    OUString sServiceNameCC(  OldNameToNewName_Impl( sServiceName ) );

    return sServiceName == rServiceName || sServiceNameCC == rServiceName ||
        rServiceName == "com.sun.star.text.TextContent";
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL SwXTextField::getSupportedServiceNames()
@@ -2562,7 +2550,7 @@ OUString SwXTextFieldMasters::getImplementationName(void) throw( uno::RuntimeExc

sal_Bool SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextFieldMasters";
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) throw( uno::RuntimeException )
@@ -2778,7 +2766,7 @@ OUString SwXTextFieldTypes::getImplementationName(void) throw( uno::RuntimeExcep

sal_Bool SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextFields";
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) throw( uno::RuntimeException )
@@ -2891,11 +2879,10 @@ SwXFieldEnumeration::getImplementationName() throw (uno::RuntimeException)
    return OUString("SwXFieldEnumeration");
}

sal_Bool SAL_CALL
SwXFieldEnumeration::supportsService(const OUString& rServiceName)
sal_Bool SAL_CALL SwXFieldEnumeration::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
{
    return rServiceName == "com.sun.star.text.FieldEnumeration";
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 035340e..1688672 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -110,6 +110,7 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <switerator.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>

// from fefly1.cxx
extern sal_Bool sw_ChkAndSetNewAnchor( SwEditShell& rEditShell, const SwFlyFrm& rFly, SfxItemSet& rSet );
@@ -815,9 +816,7 @@ OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException )

sal_Bool SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException )
{
    return rServiceName.equalsAscii("com.sun.star.text.BaseFrame") ||
           rServiceName.equalsAscii("com.sun.star.text.TextContent") ||
           rServiceName.equalsAscii("com.sun.star.document.LinkTarget");
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
@@ -2743,9 +2742,7 @@ OUString SwXTextFrame::getImplementationName(void) throw( uno::RuntimeException 

sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    return rServiceName == "com.sun.star.text.Text" ||
           rServiceName == "com.sun.star.text.TextFrame" ||
           SwXFrame::supportsService(rServiceName);
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
@@ -2905,8 +2902,7 @@ OUString SwXTextGraphicObject::getImplementationName(void) throw( uno::RuntimeEx

sal_Bool SwXTextGraphicObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextGraphicObject" ||
           SwXFrame::supportsService(rServiceName);
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void)
@@ -3166,8 +3162,7 @@ OUString SwXTextEmbeddedObject::getImplementationName(void) throw( uno::RuntimeE

sal_Bool SwXTextEmbeddedObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextEmbeddedObject" ||
           SwXFrame::supportsService(rServiceName);
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void)
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 0806e22..6d265a4 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -58,7 +58,7 @@
#include <SwStyleNameMapper.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx>

#include <cppuhelper/supportsservice.hxx>

using namespace ::com::sun::star;

@@ -457,16 +457,7 @@ sal_Bool SAL_CALL
SwXDocumentIndex::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
{
    SolarMutexGuard g;

    return rServiceName == "com.sun.star.text.BaseIndex"
        || ((TOX_INDEX == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.DocumentIndex")
        || ((TOX_CONTENT == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.ContentIndex")
        || ((TOX_USER == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.UserDefinedIndex")
        || ((TOX_ILLUSTRATIONS == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.IllustrationsIndex")
        || ((TOX_TABLES == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.TableIndex")
        || ((TOX_OBJECTS == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.ObjectIndex")
        || ((TOX_AUTHORITIES == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.Bibliography");
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL
@@ -1674,22 +1665,10 @@ SwXDocumentIndexMark::getImplementationName() throw (uno::RuntimeException)
    return OUString("SwXDocumentIndexMark");
}

sal_Bool SAL_CALL
SwXDocumentIndexMark::supportsService(const OUString& rServiceName)
sal_Bool SAL_CALL SwXDocumentIndexMark::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
{
    SolarMutexGuard g;

    return rServiceName.equalsAscii(cBaseMark)
        || rServiceName.equalsAscii(cTextContent)
        || ((m_pImpl->m_eTOXType == TOX_USER)
                && rServiceName.equalsAscii(cUserMark))
        || ((m_pImpl->m_eTOXType == TOX_CONTENT)
                && rServiceName.equalsAscii(cContentMark))
        || ((m_pImpl->m_eTOXType == TOX_INDEX)
                && rServiceName.equalsAscii(cIdxMark))
        || ((m_pImpl->m_eTOXType == TOX_INDEX)
                && rServiceName.equalsAscii(cIdxMarkAsian));
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL
@@ -2375,8 +2354,7 @@ static char const*const g_ServicesDocumentIndexes[] =
    "com.sun.star.text.DocumentIndexes",
};

sal_Bool SAL_CALL
SwXDocumentIndexes::supportsService(const OUString& rServiceName)
sal_Bool SAL_CALL SwXDocumentIndexes::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
{
    return cppu::supportsService(this, rServiceName);
@@ -2705,8 +2683,7 @@ static char const*const g_ServicesIndexTokenAccess[] =
    "com.sun.star.text.DocumentIndexLevelFormat",
};

sal_Bool SAL_CALL
SwXDocumentIndex::TokenAccess_Impl::supportsService(
sal_Bool SAL_CALL SwXDocumentIndex::TokenAccess_Impl::supportsService(
        const OUString& rServiceName)
throw (uno::RuntimeException)
{
diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx
index f726abc..323f7f7 100644
--- a/sw/source/core/unocore/unoredlines.cxx
+++ b/sw/source/core/unocore/unoredlines.cxx
@@ -19,6 +19,7 @@


#include <com/sun/star/beans/XPropertySet.hpp>
#include <cppuhelper/supportsservice.hxx>

#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
@@ -99,11 +100,10 @@ OUString SwXRedlines::getImplementationName(void) throw( uno::RuntimeException )
    return OUString("SwXRedlines");
}

sal_Bool SwXRedlines::supportsService(const OUString& /*ServiceName*/)
sal_Bool SwXRedlines::supportsService(const OUString& ServiceName)
    throw( uno::RuntimeException )
{
    OSL_FAIL("not implemented");
    return sal_False;
    return cppu::supportsService(this, ServiceName);
}

uno::Sequence< OUString > SwXRedlines::getSupportedServiceNames(void)
@@ -166,9 +166,9 @@ OUString SwXRedlineEnumeration::getImplementationName(void) throw( uno::RuntimeE
    return OUString("SwXRedlineEnumeration");
}

sal_Bool SwXRedlineEnumeration::supportsService(const OUString& /*ServiceName*/) throw( uno::RuntimeException )
sal_Bool SwXRedlineEnumeration::supportsService(const OUString& ServiceName) throw( uno::RuntimeException )
{
    return sal_False;
    return cppu::supportsService(this, ServiceName);
}

uno::Sequence< OUString > SwXRedlineEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException )
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index c10ddfd..d218056 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -22,6 +22,7 @@
#include <sfx2/sfxbasecontroller.hxx>
#include <SwXDocumentSettings.hxx>
#include <comphelper/MasterPropertySetInfo.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
@@ -1239,15 +1240,7 @@ OUString SAL_CALL SwXDocumentSettings::getImplementationName(  )
sal_Bool SAL_CALL SwXDocumentSettings::supportsService( const OUString& ServiceName )
    throw(RuntimeException)
{
    const Sequence< OUString > aSeq( getSupportedServiceNames() );
    sal_Int32 nCount = aSeq.getLength();
    const OUString* pServices = aSeq.getConstArray();
    while( nCount-- )
    {
        if( *pServices++ == ServiceName )
            return sal_True;
    }
    return sal_True;
    return cppu::supportsService(this, ServiceName);
}

Sequence< OUString > SAL_CALL SwXDocumentSettings::getSupportedServiceNames(  )
diff --git a/sw/source/ui/uno/SwXFilterOptions.cxx b/sw/source/ui/uno/SwXFilterOptions.cxx
index 2ac9262..6f81eb2 100644
--- a/sw/source/ui/uno/SwXFilterOptions.cxx
+++ b/sw/source/ui/uno/SwXFilterOptions.cxx
@@ -26,6 +26,7 @@
#include <vcl/msgbox.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotxdoc.hxx>

@@ -37,7 +38,6 @@ using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::document;
using namespace ::com::sun::star::lang;

#define SWFILTEROPTIONSOBJ_SERVICE      "com.sun.star.ui.dialogs.FilterOptionsDialog"
#define SWFILTEROPTIONSOBJ_IMPLNAME     "com.sun.star.comp.Writer.FilterOptionsDialog"
#define FILTER_OPTIONS_NAME             "FilterOptions"

@@ -57,7 +57,7 @@ OUString  SwXFilterOptions::getImplementationName_Static()

uno::Sequence< OUString> SwXFilterOptions::getSupportedServiceNames_Static()
{
    OUString sService(SWFILTEROPTIONSOBJ_SERVICE);
    OUString sService("com.sun.star.ui.dialogs.FilterOptionsDialog");
    return uno::Sequence< OUString> (&sService, 1);
}

@@ -159,7 +159,7 @@ OUString SwXFilterOptions::getImplementationName() throw(uno::RuntimeException)
sal_Bool SwXFilterOptions::supportsService( const OUString& rServiceName )
    throw(uno::RuntimeException)
{
    return rServiceName == SWFILTEROPTIONSOBJ_SERVICE;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXFilterOptions::getSupportedServiceNames()
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index 117a0c0..bdfd354 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
@@ -426,16 +427,7 @@ OUString SAL_CALL SwFilterDetect::getImplementationName() throw( RuntimeExceptio
/* XServiceInfo */
sal_Bool SAL_CALL SwFilterDetect::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/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx
index a74cda6..f75af83 100644
--- a/sw/source/ui/uno/unoatxt.cxx
+++ b/sw/source/ui/uno/unoatxt.cxx
@@ -47,6 +47,7 @@
#include <editeng/acorrcfg.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <memory>


@@ -219,13 +220,7 @@ OUString SwXAutoTextContainer::getImplementationName(void) throw( uno::RuntimeEx

sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    const uno::Sequence< OUString > aNames = SwXAutoTextContainer_getSupportedServiceNames();
    for(sal_Int32 nService = 0; nService < aNames.getLength(); nService++)
    {
        if(aNames.getConstArray()[nService] == rServiceName)
            return sal_True;
    }
    return sal_False;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXAutoTextContainer::getSupportedServiceNames(void) throw( uno::RuntimeException )
@@ -716,7 +711,7 @@ OUString SwXAutoTextGroup::getImplementationName(void) throw( uno::RuntimeExcept

sal_Bool SwXAutoTextGroup::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    return "com.sun.star.text.AutoTextGroup" == rServiceName;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames(void) throw( uno::RuntimeException )
@@ -997,7 +992,7 @@ OUString SwXAutoTextEntry::getImplementationName(void) throw( uno::RuntimeExcept

sal_Bool SwXAutoTextEntry::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
    return rServiceName == "com.sun.star.text.AutoTextEntry";
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames(void) throw( uno::RuntimeException )
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index f1a75fe..89c896b 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -29,6 +29,7 @@
#include <sfx2/docfilt.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/timer.hxx>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/text/MailMergeType.hpp>
@@ -70,9 +71,6 @@

#include <unomid.h>

#define SN_MAIL_MERGE               "com.sun.star.text.MailMerge"
#define SN_DATA_ACCESS_DESCRIPTOR   "com.sun.star.sdb.DataAccessDescriptor"

using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::uno;
@@ -1162,8 +1160,7 @@ OUString SAL_CALL SwXMailMerge::getImplementationName()
sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName )
    throw(RuntimeException)
{
    SolarMutexGuard aGuard;
    return rServiceName == SN_MAIL_MERGE || rServiceName == SN_DATA_ACCESS_DESCRIPTOR;
    return cppu::supportsService(this, rServiceName);
}

uno::Sequence< OUString > SAL_CALL SwXMailMerge::getSupportedServiceNames()
@@ -1178,8 +1175,8 @@ uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames()
{
    uno::Sequence< OUString > aNames(2);
    OUString *pName = aNames.getArray();
    pName[0] = SN_MAIL_MERGE;
    pName[1] = SN_DATA_ACCESS_DESCRIPTOR;
    pName[0] = "com.sun.star.text.MailMerge";
    pName[1] = "com.sun.star.sdb.DataAccessDescriptor";
    return aNames;
}

diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index 05723ab..2a78e86 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/view/DocumentZoomType.hpp>
#include <comphelper/ChainablePropertySetInfo.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <edtwin.hxx>
#include <rtl/ustrbuf.hxx>
#include <tools/urlobj.hxx>
@@ -253,13 +254,7 @@ OUString SwXModule::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    const Sequence< OUString > aNames = SwXModule_getSupportedServiceNames();
    for(sal_Int32 nService = 0; nService < aNames.getLength(); nService++)
    {
        if(aNames.getConstArray()[nService] == rServiceName)
            return sal_True;
    }
    return sal_False;
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXModule::getSupportedServiceNames(void) throw( RuntimeException )
@@ -545,7 +540,7 @@ OUString SwXPrintSettings::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXPrintSettings::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.PrintSettings";
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXPrintSettings::getSupportedServiceNames(void) throw( RuntimeException )
@@ -984,7 +979,7 @@ OUString SwXViewSettings::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXViewSettings::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.ViewSettings";
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXViewSettings::getSupportedServiceNames(void) throw( RuntimeException )
diff --git a/sw/source/ui/uno/unomodule.cxx b/sw/source/ui/uno/unomodule.cxx
index 13a2238..de79abec 100644
--- a/sw/source/ui/uno/unomodule.cxx
+++ b/sw/source/ui/uno/unomodule.cxx
@@ -23,6 +23,7 @@
#include "swmodule.hxx"
#include "swdll.hxx"
#include "unomodule.hxx"
#include <cppuhelper/supportsservice.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/request.hxx>
@@ -142,16 +143,7 @@ OUString SAL_CALL SwUnoModule::getImplementationName(  ) throw(uno::RuntimeExcep

sal_Bool SAL_CALL SwUnoModule::supportsService( const OUString& sServiceName ) throw(uno::RuntimeException)
{
    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);
}

uno::Sequence< OUString > SAL_CALL SwUnoModule::getSupportedServiceNames(  ) throw(uno::RuntimeException)
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index b5789f5..095a481 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -101,6 +101,7 @@
#include <SwStyleNameMapper.hxx>
#include <osl/file.hxx>
#include <comphelper/storagehelper.hxx>
#include <cppuhelper/supportsservice.hxx>

// #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
@@ -1772,16 +1773,7 @@ OUString SwXTextDocument::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXTextDocument::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    if ( rServiceName == "com.sun.star.document.OfficeDocument" || rServiceName == "com.sun.star.text.GenericTextDocument" )
        return sal_True;

    bool bWebDoc    = (0 != PTR_CAST(SwWebDocShell,    pDocShell));
    bool bGlobalDoc = (0 != PTR_CAST(SwGlobalDocShell, pDocShell));
    bool bTextDoc   = (!bWebDoc && !bGlobalDoc);

    return ( (bWebDoc    && rServiceName == "com.sun.star.text.WebDocument")
          || (bGlobalDoc && rServiceName == "com.sun.star.text.GlobalDocument")
          || (bTextDoc   && rServiceName == "com.sun.star.text.TextDocument") );
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( RuntimeException )
@@ -3475,7 +3467,7 @@ OUString SwXLinkTargetSupplier::getImplementationName(void) throw( RuntimeExcept
sal_Bool SwXLinkTargetSupplier::supportsService(const OUString& rServiceName)
                                                throw( RuntimeException )
{
    return (rServiceName == "com.sun.star.document.LinkTargets");
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void)
@@ -3761,7 +3753,7 @@ OUString SwXLinkNameAccessWrapper::getImplementationName(void) throw( RuntimeExc
sal_Bool SwXLinkNameAccessWrapper::supportsService(const OUString& rServiceName)
                                                    throw( RuntimeException )
{
    return (rServiceName == "com.sun.star.document.LinkTargets");
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXLinkNameAccessWrapper::getSupportedServiceNames(void)
@@ -3839,7 +3831,7 @@ OUString SwXOutlineTarget::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXOutlineTarget::supportsService(const OUString& ServiceName) throw( RuntimeException )
{
    return ServiceName == "com.sun.star.document.LinkTarget";
    return cppu::supportsService(this, ServiceName);
}

Sequence< OUString > SwXOutlineTarget::getSupportedServiceNames(void) throw( RuntimeException )
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index f6565e76..6309cdc 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -73,6 +73,7 @@
#include "swdtflvr.hxx"
#include <vcl/svapp.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>

using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -856,7 +857,7 @@ OUString SwXTextView::getImplementationName(void) throw( RuntimeException )

sal_Bool SwXTextView::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName == "com.sun.star.text.TextDocumentView" || rServiceName == "com.sun.star.view.OfficeDocumentView";
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXTextView::getSupportedServiceNames(void) throw( RuntimeException )
@@ -1698,13 +1699,7 @@ OUString SwXTextViewCursor::getImplementationName(void) throw( RuntimeException 

sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
    return rServiceName.equalsAscii("com.sun.star.text.TextViewCursor") ||
            rServiceName.equalsAscii("com.sun.star.style.CharacterProperties") ||
            rServiceName.equalsAscii("com.sun.star.style.CharacterPropertiesAsian") ||
            rServiceName.equalsAscii("com.sun.star.style.CharacterPropertiesComplex") ||
            rServiceName.equalsAscii("com.sun.star.style.ParagraphProperties") ||
            rServiceName.equalsAscii("com.sun.star.style.ParagraphPropertiesAsian") ||
            rServiceName.equalsAscii("com.sun.star.style.ParagraphPropertiesComplex");
    return cppu::supportsService(this, rServiceName);
}

Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( RuntimeException )