[Libreoffice-commits] core.git: chart2/source editeng/source extensions/source framework/source include/ucbhelper mysqlc/source reportdesign/source sccomp/source scripting/source svx/source ucb/source xmlhelp/source xmlsecurity/source

Marcos Paulo de Souza marcos.souza.org at gmail.com
Tue Mar 4 05:30:24 PST 2014


 chart2/source/model/main/PageBackground.hxx                     |    8 +-
 editeng/source/accessibility/AccessibleContextBase.cxx          |   24 ------
 extensions/source/bibliography/framectr.cxx                     |    5 -
 extensions/source/plugin/base/manager.cxx                       |    9 --
 extensions/source/plugin/inc/plugin/impl.hxx                    |    3 
 framework/source/uielement/popuptoolbarcontroller.cxx           |   37 ++++------
 include/ucbhelper/macros.hxx                                    |   12 ---
 mysqlc/source/mysqlc_driver.cxx                                 |    2 
 mysqlc/source/mysqlc_resultset.cxx                              |    2 
 reportdesign/source/core/api/Shape.cxx                          |    1 
 sccomp/source/solver/solver.cxx                                 |   10 --
 scripting/source/provider/URIHelper.cxx                         |   10 --
 svx/source/unodraw/unoshape.cxx                                 |    2 
 ucb/source/ucp/file/bc.cxx                                      |   20 -----
 ucb/source/ucp/file/prov.cxx                                    |   14 +--
 xmlhelp/source/treeview/tvfactory.cxx                           |    9 --
 xmlsecurity/source/component/certificatecontainer.cxx           |    6 -
 xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx |    9 --
 xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx         |   12 ---
 xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx     |   14 ---
 xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx      |   13 ---
 21 files changed, 62 insertions(+), 160 deletions(-)

New commits:
commit 4d6560f5066d143552cba861aaadc2f49b4357d4
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Tue Mar 4 08:41:53 2014 -0300

    fdo#54938: Convert some places to use cppu::supportsService
    
    The last cases are non obvious, so it's pratically done
    
    Change-Id: Icae1da8e238f516eaed0f7fbdf96fff778eac547
    Reviewed-on: https://gerrit.libreoffice.org/8445
    Reviewed-by: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
    Tested-by: Marcos Paulo de Souza <marcos.souza.org at gmail.com>

diff --git a/chart2/source/model/main/PageBackground.hxx b/chart2/source/model/main/PageBackground.hxx
index 7070037..f4b0b58 100644
--- a/chart2/source/model/main/PageBackground.hxx
+++ b/chart2/source/model/main/PageBackground.hxx
@@ -19,11 +19,12 @@
 #ifndef INCLUDED_CHART2_SOURCE_MODEL_MAIN_PAGEBACKGROUND_HXX
 #define INCLUDED_CHART2_SOURCE_MODEL_MAIN_PAGEBACKGROUND_HXX
 
+#include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/util/XCloneable.hpp>
 #include "MutexContainer.hxx"
 #include "OPropertySet.hxx"
-#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase4.hxx>
 
 #include "ServiceMacros.hxx"
 #include "ModifyListenerHelper.hxx"
@@ -34,10 +35,11 @@ namespace chart
 
 namespace impl
 {
-typedef ::cppu::WeakImplHelper3<
+typedef ::cppu::WeakImplHelper4<
         ::com::sun::star::util::XCloneable,
         ::com::sun::star::util::XModifyBroadcaster,
-        ::com::sun::star::util::XModifyListener >
+        ::com::sun::star::util::XModifyListener,
+        ::com::sun::star::lang::XServiceInfo >
     PageBackground_Base;
 }
 
diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx b/editeng/source/accessibility/AccessibleContextBase.cxx
index 15958e9..e0ff20c 100644
--- a/editeng/source/accessibility/AccessibleContextBase.cxx
+++ b/editeng/source/accessibility/AccessibleContextBase.cxx
@@ -29,6 +29,7 @@
 #include <unotools/accessiblerelationsethelper.hxx>
 #include <comphelper/accessibleeventnotifier.hxx>
 #include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/mutex.hxx>
 
 #include <utility>
@@ -465,11 +466,7 @@ void SAL_CALL AccessibleContextBase::removeAccessibleEventListener (
     }
 }
 
-
-
-
 //=====  XServiceInfo  ========================================================
-
 OUString SAL_CALL AccessibleContextBase::getImplementationName (void)
     throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
@@ -477,27 +474,12 @@ OUString SAL_CALL AccessibleContextBase::getImplementationName (void)
     return OUString("AccessibleContextBase");
 }
 
-
-
-
-sal_Bool SAL_CALL
-     AccessibleContextBase::supportsService (const OUString& sServiceName)
+sal_Bool SAL_CALL AccessibleContextBase::supportsService (const OUString& sServiceName)
     throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    ThrowIfDisposed ();
-    //  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
        AccessibleContextBase::getSupportedServiceNames (void)
     throw (::com::sun::star::uno::RuntimeException, std::exception)
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index 45e6faf..440d19b 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <vcl/waitobj.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
 #include <com/sun/star/util/URL.hpp>
 #include <vcl/msgbox.hxx>
 #include <tools/debug.hxx>
@@ -46,6 +45,8 @@
 #include <com/sun/star/sdb/RowChangeAction.hpp>
 #include <com/sun/star/frame/CommandGroup.hpp>
 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <sot/exchange.hxx>
 #include <sot/formats.hxx>
 #include <vcl/edit.hxx>
@@ -208,7 +209,7 @@ OUString SAL_CALL BibFrameController_Impl::getImplementationName() throw (::com:
 
 sal_Bool SAL_CALL BibFrameController_Impl::supportsService( const OUString& sServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    return ( sServiceName == "com.sun.star.frame.Bibliography" || sServiceName == "com.sun.star.frame.Controller" );
+    return cppu::supportsService( this, sServiceName );
 }
 
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL BibFrameController_Impl::getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException, std::exception)
diff --git a/extensions/source/plugin/base/manager.cxx b/extensions/source/plugin/base/manager.cxx
index b5039b1..a83c4b9 100644
--- a/extensions/source/plugin/base/manager.cxx
+++ b/extensions/source/plugin/base/manager.cxx
@@ -57,6 +57,8 @@
 #include "com/sun/star/container/XIndexAccess.hpp"
 #include "com/sun/star/loader/XImplementationLoader.hpp"
 
+#include <cppuhelper/supportsservice.hxx>
+
 PluginManager* PluginManager::pManager = NULL;
 
 PluginManager& PluginManager::get()
@@ -115,12 +117,7 @@ OUString XPluginManager_Impl::getImplementationName() throw(  )
 // ::com::sun::star::lang::XServiceInfo
 sal_Bool XPluginManager_Impl::supportsService(const OUString& ServiceName) throw(  )
 {
-    Sequence< OUString > aSNL = getSupportedServiceNames();
-    const OUString * pArray = aSNL.getConstArray();
-    for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
-        if( pArray[i] == ServiceName )
-            return sal_True;
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 // ::com::sun::star::lang::XServiceInfo
diff --git a/extensions/source/plugin/inc/plugin/impl.hxx b/extensions/source/plugin/inc/plugin/impl.hxx
index 57620f4..85be9c8 100644
--- a/extensions/source/plugin/inc/plugin/impl.hxx
+++ b/extensions/source/plugin/inc/plugin/impl.hxx
@@ -288,7 +288,8 @@ public:
 };
 
 class XPluginManager_Impl :
-    public cppu::WeakAggImplHelper1< com::sun::star::plugin::XPluginManager >
+    public cppu::WeakAggImplHelper2< com::sun::star::plugin::XPluginManager,
+                                    com::sun::star::lang::XServiceInfo >
 {
     Reference< com::sun::star::uno::XComponentContext >     m_xContext;
 public:
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index e0ce22a..51274af 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <comphelper/processfactory.hxx>
 #include <framework/menuconfiguration.hxx>
 #include <rtl/ref.hxx>
@@ -46,7 +47,11 @@ using namespace framework;
 
 namespace {
 
-class PopupMenuToolbarController : public svt::ToolboxController
+typedef cppu::ImplInheritanceHelper1< svt::ToolboxController,
+                                    css::lang::XServiceInfo >
+                ToolBarBase;
+
+class PopupMenuToolbarController : public ToolBarBase
 {
 public:
     virtual ~PopupMenuToolbarController();
@@ -80,8 +85,7 @@ private:
 PopupMenuToolbarController::PopupMenuToolbarController(
     const css::uno::Reference< css::uno::XComponentContext >& xContext,
     const OUString &rPopupCommand )
-    : svt::ToolboxController()
-    , m_xContext( xContext )
+    : m_xContext( xContext )
     , m_bHasController( sal_False )
     , m_aPopupCommand( rPopupCommand )
 {
@@ -249,14 +253,11 @@ public:
     WizardsToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
 
     // XServiceInfo
-    OUString SAL_CALL getImplementationName()
-        throw (css::uno::RuntimeException);
+    virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException);
 
-    sal_Bool SAL_CALL supportsService(OUString const & rServiceName)
-        throw (css::uno::RuntimeException);
+    virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException);
 
-    css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
-        throw (css::uno::RuntimeException);
+    virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException);
 
 private:
     sal_uInt16 getDropDownStyle() const;
@@ -277,7 +278,7 @@ OUString WizardsToolbarController::getImplementationName()
 sal_Bool WizardsToolbarController::supportsService(OUString const & rServiceName)
     throw (css::uno::RuntimeException)
 {
-    return rServiceName == "com.sun.star.frame.ToolbarController";
+    return cppu::supportsService( this, rServiceName );
 }
 
 css::uno::Sequence<OUString> WizardsToolbarController::getSupportedServiceNames()
@@ -300,14 +301,11 @@ public:
     OpenToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
 
     // XServiceInfo
-    OUString SAL_CALL getImplementationName()
-        throw (css::uno::RuntimeException);
+    virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException);
 
-    sal_Bool SAL_CALL supportsService(OUString const & rServiceName)
-        throw (css::uno::RuntimeException);
+    virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException);
 
-    css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
-        throw (css::uno::RuntimeException);
+    virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException);
 };
 
 OpenToolbarController::OpenToolbarController(
@@ -325,7 +323,7 @@ OUString OpenToolbarController::getImplementationName()
 sal_Bool OpenToolbarController::supportsService(OUString const & rServiceName)
     throw (css::uno::RuntimeException)
 {
-    return rServiceName == "com.sun.star.frame.ToolbarController";
+    return cppu::supportsService( this, rServiceName );
 }
 
 css::uno::Sequence<OUString> OpenToolbarController::getSupportedServiceNames()
@@ -346,8 +344,7 @@ public:
     OUString SAL_CALL getImplementationName()
         throw (css::uno::RuntimeException);
 
-    sal_Bool SAL_CALL supportsService(OUString const & rServiceName)
-        throw (css::uno::RuntimeException);
+    virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException);
 
     css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
         throw (css::uno::RuntimeException);
@@ -378,7 +375,7 @@ OUString NewToolbarController::getImplementationName()
 sal_Bool NewToolbarController::supportsService(OUString const & rServiceName)
     throw (css::uno::RuntimeException)
 {
-    return rServiceName == "com.sun.star.frame.ToolbarController";
+    return cppu::supportsService( this, rServiceName );
 }
 
 css::uno::Sequence<OUString> NewToolbarController::getSupportedServiceNames()
diff --git a/include/ucbhelper/macros.hxx b/include/ucbhelper/macros.hxx
index 3c6b395..e8b8cee 100644
--- a/include/ucbhelper/macros.hxx
+++ b/include/ucbhelper/macros.hxx
@@ -24,6 +24,7 @@
 #include <cppuhelper/queryinterface.hxx>
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/weakref.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 
 #include <osl/mutex.hxx>
@@ -625,16 +626,7 @@ sal_Bool SAL_CALL                                                           \
 Class::supportsService( const OUString& ServiceName )                  \
     throw( com::sun::star::uno::RuntimeException, std::exception )          \
 {                                                                           \
-    com::sun::star::uno::Sequence< OUString > aSNL =                   \
-                                        getSupportedServiceNames();         \
-    const OUString* pArray = aSNL.getArray();                          \
-    for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )                       \
-    {                                                                       \
-        if( pArray[ i ] == ServiceName )                                    \
-            return sal_True;                                                \
-    }                                                                       \
-                                                                            \
-    return sal_False;                                                       \
+    return cppu::supportsService( this, ServiceName );                      \
 }                                                                           \
                                                                             \
 com::sun::star::uno::Sequence< OUString > SAL_CALL                     \
diff --git a/mysqlc/source/mysqlc_driver.cxx b/mysqlc/source/mysqlc_driver.cxx
index 05cd9e0..850d47f 100644
--- a/mysqlc/source/mysqlc_driver.cxx
+++ b/mysqlc/source/mysqlc_driver.cxx
@@ -108,11 +108,9 @@ OUString SAL_CALL MysqlCDriver::getImplementationName()
 }
 /* }}} */
 
-/* {{{ MysqlCDriver::supportsService() -I- */
 sal_Bool SAL_CALL MysqlCDriver::supportsService(const OUString& _rServiceName)
     throw(RuntimeException, std::exception)
 {
-    OSL_TRACE("MysqlCDriver::supportsService");
     return cppu::supportsService(this, _rServiceName);
 }
 /* }}} */
diff --git a/mysqlc/source/mysqlc_resultset.cxx b/mysqlc/source/mysqlc_resultset.cxx
index cafcd8e..aa602f6 100644
--- a/mysqlc/source/mysqlc_resultset.cxx
+++ b/mysqlc/source/mysqlc_resultset.cxx
@@ -70,11 +70,9 @@ Sequence< OUString > SAL_CALL OResultSet::getSupportedServiceNames()
 }
 /* }}} */
 
-/* {{{ OResultSet::supportsService() -I- */
 sal_Bool SAL_CALL OResultSet::supportsService(const OUString& _rServiceName)
     throw(RuntimeException, std::exception)
 {
-    OSL_TRACE("OResultSet::supportsService");
     return cppu::supportsService(this, _rServiceName);
 }
 /* }}} */
diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx
index dfddf41..9f024d2 100644
--- a/reportdesign/source/core/api/Shape.cxx
+++ b/reportdesign/source/core/api/Shape.cxx
@@ -157,7 +157,6 @@ uno::Sequence< OUString > SAL_CALL OShape::getSupportedServiceNames(  ) throw(un
 
 sal_Bool SAL_CALL OShape::supportsService(const OUString& ServiceName) throw( uno::RuntimeException, std::exception )
 {
-
     return cppu::supportsService(this, ServiceName);
 }
 
diff --git a/sccomp/source/solver/solver.cxx b/sccomp/source/solver/solver.cxx
index be21535..128e877 100644
--- a/sccomp/source/solver/solver.cxx
+++ b/sccomp/source/solver/solver.cxx
@@ -35,6 +35,7 @@
 #include <rtl/math.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <vector>
 #include <unordered_map>
 
@@ -577,8 +578,6 @@ void SAL_CALL SolverComponent::solve() throw(uno::RuntimeException, std::excepti
     CoinUnloadProblem( hProb );
 }
 
-// -------------------------------------------------------------------------
-
 // XServiceInfo
 
 uno::Sequence< OUString > SolverComponent_getSupportedServiceNames()
@@ -600,10 +599,7 @@ OUString SAL_CALL SolverComponent::getImplementationName() throw(uno::RuntimeExc
 
 sal_Bool SAL_CALL SolverComponent::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException, std::exception)
 {
-    const uno::Sequence< OUString > aServices = SolverComponent_getSupportedServiceNames();
-    const OUString* pArray = aServices.getConstArray();
-    const OUString* pArrayEnd = pArray + aServices.getLength();
-    return ::std::find( pArray, pArrayEnd, rServiceName ) != pArrayEnd;
+    return cppu::supportsService( this, rServiceName );
 }
 
 uno::Sequence<OUString> SAL_CALL SolverComponent::getSupportedServiceNames() throw(uno::RuntimeException, std::exception)
@@ -617,8 +613,6 @@ uno::Reference<uno::XInterface> SolverComponent_createInstance( const uno::Refer
     return (cppu::OWeakObject*) new SolverComponent( rSMgr );
 }
 
-// -------------------------------------------------------------------------
-
 extern "C"
 {
     SAL_DLLPUBLIC_EXPORT void* SAL_CALL solver_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index 9343aa3..b6f1103 100644
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
@@ -21,6 +21,7 @@
 
 #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
 #include <com/sun/star/uri/UriReferenceFactory.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include <rtl/ustrbuf.hxx>
 #include "URIHelper.hxx"
 
@@ -272,14 +273,7 @@ sal_Bool SAL_CALL
 ScriptingFrameworkURIHelper::supportsService( const OUString& serviceName )
     throw( uno::RuntimeException, std::exception )
 {
-    OUString m_sServiceName(
-        "com.sun.star.script.provider.ScriptURIHelper" );
-
-    if ( serviceName.equals( m_sServiceName ) )
-    {
-        return sal_True;
-    }
-    return sal_False;
+    return cppu::supportsService( this, serviceName );
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 3aa5515..71a82eb 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -4071,7 +4071,7 @@ uno::Sequence< OUString > SAL_CALL SvxShapeText::getSupportedServiceNames() thro
 
 sal_Bool SAL_CALL SvxShapeText::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException, std::exception )
 {
-    return SvxShape::supportsService(ServiceName);
+    return cppu::supportsService(static_cast<SvxShape*>(this), ServiceName);
 }
 
     // XTypeProvider
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 06ea3a9..9723918 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/beans/PropertySetInfoChange.hpp>
 #include <com/sun/star/ucb/ContentAction.hpp>
 #include <com/sun/star/ucb/NameClash.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include "filglob.hxx"
 #include "filid.hxx"
 #include "filrow.hxx"
@@ -251,12 +252,7 @@ BaseContent::dispose()
     delete pPropertySetInfoChangeListeners;
 }
 
-
-
-
 //  XServiceInfo
-
-
 OUString SAL_CALL
 BaseContent::getImplementationName()
     throw( RuntimeException, std::exception)
@@ -264,20 +260,13 @@ BaseContent::getImplementationName()
     return OUString("com.sun.star.comp.ucb.FileContent");
 }
 
-
-
 sal_Bool SAL_CALL
 BaseContent::supportsService( const OUString& ServiceName )
     throw( RuntimeException, std::exception)
 {
-    if ( ServiceName == "com.sun.star.ucb.FileContent" )
-        return true;
-    else
-        return false;
+    return cppu::supportsService( this, ServiceName );
 }
 
-
-
 Sequence< OUString > SAL_CALL
 BaseContent::getSupportedServiceNames()
     throw( RuntimeException, std::exception )
@@ -287,12 +276,7 @@ BaseContent::getSupportedServiceNames()
     return ret;
 }
 
-
-
-
 //  XTypeProvider
-
-
 XTYPEPROVIDER_IMPL_10( BaseContent,
                        lang::XComponent,
                        lang::XTypeProvider,
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index 56c579c..1510a77 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -21,10 +21,11 @@
 #include <osl/file.hxx>
 #include <osl/socket.h>
 #include <comphelper/processfactory.hxx>
-#include <cppuhelper/factory.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/ucb/FileSystemNotation.hpp>
 #include <com/sun/star/beans/PropertyState.hpp>
+#include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include "filglob.hxx"
 #include "filid.hxx"
 #include "shell.hxx"
@@ -183,7 +184,6 @@ XTYPEPROVIDER_IMPL_7( FileProvider,
 
 
 // XServiceInfo methods.
-
 OUString SAL_CALL
 FileProvider::getImplementationName()
     throw( RuntimeException, std::exception )
@@ -191,16 +191,12 @@ FileProvider::getImplementationName()
     return fileaccess::shell::getImplementationName_static();
 }
 
-
-sal_Bool SAL_CALL
-FileProvider::supportsService(
-                  const OUString& ServiceName )
+sal_Bool SAL_CALL FileProvider::supportsService(const OUString& ServiceName )
   throw( RuntimeException, std::exception )
 {
-  return ServiceName == "com.sun.star.ucb.FileContentProvider";
+    return cppu::supportsService(this, ServiceName);
 }
 
-
 Sequence< OUString > SAL_CALL
 FileProvider::getSupportedServiceNames(
                        void )
@@ -209,8 +205,6 @@ FileProvider::getSupportedServiceNames(
     return fileaccess::shell::getSupportedServiceNames_static();
 }
 
-
-
 Reference< XSingleServiceFactory > SAL_CALL
 FileProvider::createServiceFactory(
                    const Reference< XMultiServiceFactory >& rxServiceMgr )
diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx
index 12f455f..288d542 100644
--- a/xmlhelp/source/treeview/tvfactory.cxx
+++ b/xmlhelp/source/treeview/tvfactory.cxx
@@ -21,6 +21,7 @@
 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include "tvfactory.hxx"
 #include "tvread.hxx"
 
@@ -87,14 +88,10 @@ TVFactory::getImplementationName()
     return TVFactory::getImplementationName_static();
 }
 
-sal_Bool SAL_CALL
-TVFactory::supportsService(
-    const OUString& ServiceName )
+sal_Bool SAL_CALL TVFactory::supportsService( const OUString& ServiceName )
     throw( RuntimeException, std::exception )
 {
-    return
-        ServiceName.equalsAscii( "com.sun.star.help.TreeView" ) ||
-        ServiceName.equalsAscii( "com.sun.star.ucb.HiearchyDataSource" );
+    return cppu::supportsService( this, ServiceName );
 }
 
 Sequence< OUString > SAL_CALL
diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx
index c021e30..c65202d8 100644
--- a/xmlsecurity/source/component/certificatecontainer.cxx
+++ b/xmlsecurity/source/component/certificatecontainer.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <certificatecontainer.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <sal/config.h>
 
@@ -96,10 +97,7 @@ sal_Bool SAL_CALL
 CertificateContainer::supportsService( const OUString& ServiceName )
     throw(::com::sun::star::uno::RuntimeException, std::exception)
 {
-    if ( ServiceName.equalsAscii("com.sun.star.security.CertificateContainer") )
-        return sal_True;
-    else
-        return sal_False;
+    return cppu::supportsService( this, ServiceName );
 }
 
 Sequence< OUString > SAL_CALL
diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
index 277222c..411b482 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
@@ -27,6 +27,7 @@
 #include "com/sun/star/xml/crypto/SecurityEnvironment.hpp"
 #include "com/sun/star/xml/crypto/XMLSecurityContext.hpp"
 #include "comphelper/processfactory.hxx"
+#include <cppuhelper/supportsservice.hxx>
 
 namespace cssu = com::sun::star::uno;
 namespace cssl = com::sun::star::lang;
@@ -152,12 +153,6 @@ OUString SEInitializer_MSCryptImpl_getImplementationName()
     return OUString( "com.sun.star.xml.security.bridge.xmlsec.SEInitializer_MSCryptImpl" );
 }
 
-sal_Bool SAL_CALL SEInitializer_MSCryptImpl_supportsService( const OUString& rServiceName )
-    throw (cssu::RuntimeException)
-{
-    return rServiceName == "com.sun.star.xml.crypto.SEInitializer";
-}
-
 cssu::Sequence< OUString > SAL_CALL SEInitializer_MSCryptImpl_getSupportedServiceNames()
     throw (cssu::RuntimeException)
 {
@@ -183,7 +178,7 @@ OUString SAL_CALL SEInitializer_MSCryptImpl::getImplementationName()
 sal_Bool SAL_CALL SEInitializer_MSCryptImpl::supportsService( const OUString& rServiceName )
     throw (cssu::RuntimeException)
 {
-    return SEInitializer_MSCryptImpl_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 
 cssu::Sequence< OUString > SAL_CALL SEInitializer_MSCryptImpl::getSupportedServiceNames()
diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
index 6e5ead4..bac83e4 100644
--- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
@@ -34,6 +34,7 @@
 #include <osl/thread.h>
 #include <com/sun/star/xml/crypto/SecurityEnvironment.hpp>
 #include <com/sun/star/xml/crypto/XMLSecurityContext.hpp>
+#include <cppuhelper/supportsservice.hxx>
 
 #include "seinitializer_nssimpl.hxx"
 #include "securityenvironment_nssimpl.hxx"
@@ -51,7 +52,6 @@ namespace cssxc = css::xml::crypto;
 
 using namespace com::sun::star;
 
-#define SE_SERVICE_NAME "com.sun.star.xml.crypto.SEInitializer"
 
 SEInitializer_NssImpl::SEInitializer_NssImpl( const css::uno::Reference< css::uno::XComponentContext > &rxContext )
 {
@@ -117,18 +117,12 @@ OUString SEInitializer_NssImpl_getImplementationName ()
     return OUString ("com.sun.star.xml.security.bridge.xmlsec.SEInitializer_NssImpl" );
 }
 
-sal_Bool SAL_CALL SEInitializer_NssImpl_supportsService( const OUString& ServiceName )
-    throw (uno::RuntimeException)
-{
-    return ( ServiceName == SE_SERVICE_NAME || ServiceName == NSS_SERVICE_NAME );
-}
-
 uno::Sequence< OUString > SAL_CALL SEInitializer_NssImpl_getSupportedServiceNames(  )
     throw (uno::RuntimeException)
 {
     uno::Sequence < OUString > aRet(2);
     OUString* pArray = aRet.getArray();
-    pArray[0] =  OUString ( SE_SERVICE_NAME );
+    pArray[0] =  "com.sun.star.xml.crypto.SEInitializer";
     pArray[1] =  OUString ( NSS_SERVICE_NAME );
     return aRet;
 }
@@ -148,7 +142,7 @@ OUString SAL_CALL SEInitializer_NssImpl::getImplementationName(  )
 sal_Bool SAL_CALL SEInitializer_NssImpl::supportsService( const OUString& rServiceName )
     throw (uno::RuntimeException, std::exception)
 {
-    return SEInitializer_NssImpl_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 uno::Sequence< OUString > SAL_CALL SEInitializer_NssImpl::getSupportedServiceNames(  )
     throw (uno::RuntimeException, std::exception)
diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
index 1e6e8cb..02f9d9b 100644
--- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
+#include <cppuhelper/supportsservice.hxx>
 #include "xmldocumentwrapper_xmlsecimpl.hxx"
 
 #include <xmloff/attrlist.hxx>
@@ -43,7 +43,6 @@ namespace cssxcsax = com::sun::star::xml::csax;
 namespace cssxs = com::sun::star::xml::sax;
 namespace cssxw = com::sun::star::xml::wrapper;
 
-#define SERVICE_NAME "com.sun.star.xml.wrapper.XMLDocumentWrapper"
 #define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.XMLDocumentWrapper_XmlSecImpl"
 
 #define STRXMLNS "xmlns"
@@ -1061,21 +1060,14 @@ OUString XMLDocumentWrapper_XmlSecImpl_getImplementationName ()
     return OUString ( IMPLEMENTATION_NAME );
 }
 
-sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl_supportsService( const OUString& ServiceName )
-    throw (cssu::RuntimeException)
-{
-    return ServiceName == SERVICE_NAME;
-}
-
 cssu::Sequence< OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames(  )
     throw (cssu::RuntimeException)
 {
     cssu::Sequence < OUString > aRet(1);
     OUString* pArray = aRet.getArray();
-    pArray[0] =  OUString ( SERVICE_NAME );
+    pArray[0] = "com.sun.star.xml.wrapper.XMLDocumentWrapper";
     return aRet;
 }
-#undef SERVICE_NAME
 
 cssu::Reference< cssu::XInterface > SAL_CALL XMLDocumentWrapper_XmlSecImpl_createInstance(
     const cssu::Reference< cssu::XComponentContext > &)
@@ -1093,7 +1085,7 @@ OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getImplementationName(  )
 sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::supportsService( const OUString& rServiceName )
     throw (cssu::RuntimeException, std::exception)
 {
-    return XMLDocumentWrapper_XmlSecImpl_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 cssu::Sequence< OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl::getSupportedServiceNames(  )
     throw (cssu::RuntimeException, std::exception)
diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
index afaf1ef..fb4a35f 100644
--- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
@@ -20,11 +20,11 @@
 #include <string.h>
 
 #include "xmlelementwrapper_xmlsecimpl.hxx"
+#include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 
 namespace cssu = com::sun::star::uno;
 
-#define SERVICE_NAME "com.sun.star.xml.wrapper.XMLElementWrapper"
 #define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl"
 
 XMLElementWrapper_XmlSecImpl::XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNode)
@@ -76,21 +76,14 @@ OUString XMLElementWrapper_XmlSecImpl_getImplementationName ()
     return OUString ( IMPLEMENTATION_NAME );
 }
 
-sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl_supportsService( const OUString& ServiceName )
-    throw (cssu::RuntimeException)
-{
-    return ServiceName == SERVICE_NAME;
-}
-
 cssu::Sequence< OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames(  )
     throw (cssu::RuntimeException)
 {
     cssu::Sequence < OUString > aRet(1);
     OUString* pArray = aRet.getArray();
-    pArray[0] =  OUString ( SERVICE_NAME );
+    pArray[0] = "com.sun.star.xml.wrapper.XMLElementWrapper";
     return aRet;
 }
-#undef SERVICE_NAME
 
 cssu::Reference< cssu::XInterface > SAL_CALL
     XMLElementWrapper_XmlSecImpl_createInstance(
@@ -109,7 +102,7 @@ OUString SAL_CALL XMLElementWrapper_XmlSecImpl::getImplementationName(  )
 sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl::supportsService( const OUString& rServiceName )
     throw (cssu::RuntimeException, std::exception)
 {
-    return XMLElementWrapper_XmlSecImpl_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 cssu::Sequence< OUString > SAL_CALL XMLElementWrapper_XmlSecImpl::getSupportedServiceNames(  )
     throw (cssu::RuntimeException, std::exception)


More information about the Libreoffice-commits mailing list