[Libreoffice-commits] core.git: include/ucbhelper ucbhelper/source ucb/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Oct 26 06:50:07 UTC 2016


 include/ucbhelper/macros.hxx                     |   12 +-----
 include/ucbhelper/resultset.hxx                  |    3 -
 include/ucbhelper/resultsethelper.hxx            |    3 -
 ucb/source/cacher/cachedcontentresultset.cxx     |   21 +++++++++---
 ucb/source/cacher/cachedcontentresultset.hxx     |    3 -
 ucb/source/cacher/cachedcontentresultsetstub.cxx |   20 +++++++++--
 ucb/source/cacher/cachedcontentresultsetstub.hxx |    3 -
 ucb/source/cacher/cacheddynamicresultset.cxx     |   19 +++++++++-
 ucb/source/cacher/cacheddynamicresultset.hxx     |    4 --
 ucb/source/cacher/cacheddynamicresultsetstub.cxx |   20 +++++++++--
 ucb/source/cacher/cacheddynamicresultsetstub.hxx |    4 --
 ucb/source/core/provprox.cxx                     |   19 +++++++++-
 ucb/source/core/provprox.hxx                     |    3 -
 ucb/source/core/ucbstore.cxx                     |   40 +++++++++++++++++++----
 ucb/source/core/ucbstore.hxx                     |    6 ---
 ucb/source/inc/regexpmap.hxx                     |   26 +++++---------
 ucb/source/sorter/sortdynres.cxx                 |   13 -------
 ucb/source/sorter/sortdynres.hxx                 |    2 -
 ucb/source/sorter/sortresult.cxx                 |   13 -------
 ucb/source/sorter/sortresult.hxx                 |    3 -
 ucb/source/ucp/ftp/ftpcontent.cxx                |   13 -------
 ucb/source/ucp/ftp/ftpcontent.hxx                |    3 -
 ucb/source/ucp/ftp/ftpcontentprovider.cxx        |   11 ------
 ucb/source/ucp/ftp/ftpcontentprovider.hxx        |    4 --
 ucb/source/ucp/hierarchy/hierarchydatasource.cxx |   24 ++++++++-----
 ucbhelper/source/provider/resultset.cxx          |   19 +++++++++-
 ucbhelper/source/provider/resultsethelper.cxx    |   19 ++++++++--
 27 files changed, 177 insertions(+), 153 deletions(-)

New commits:
commit 47317f041693db1a9d4618a1d9f7dcefe52b2904
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Oct 25 13:46:23 2016 +0200

    loplugin:expandablemethods in ucb..ucbhelper
    
    Change-Id: I42d077d7ebcfb77447d011644f8d64e80eae69c2
    Reviewed-on: https://gerrit.libreoffice.org/30266
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/ucbhelper/macros.hxx b/include/ucbhelper/macros.hxx
index 57de0ed..91a3aa3 100644
--- a/include/ucbhelper/macros.hxx
+++ b/include/ucbhelper/macros.hxx
@@ -214,13 +214,6 @@ Class::createServiceFactory( const css::uno::Reference< css::lang::XMultiService
 
 // Service without service factory.
 
-// Own implementation of getSupportedServiceNames_Static().
-#define XSERVICEINFO_NOFACTORY_IMPL_0( Class, ImplName )                    \
-XSERVICEINFO_COMMOM_IMPL( Class, ImplName )                                 \
-                                                                            \
-css::uno::Sequence< OUString >                              \
-Class::getSupportedServiceNames_Static()
-
 // 1 service name
 #define XSERVICEINFO_NOFACTORY_IMPL_1( Class, ImplName, Service1 )          \
 XSERVICEINFO_COMMOM_IMPL( Class, ImplName )                                 \
@@ -228,8 +221,7 @@ XSERVICEINFO_COMMOM_IMPL( Class, ImplName )                                 \
 css::uno::Sequence< OUString >                              \
 Class::getSupportedServiceNames_Static()                                    \
 {                                                                           \
-    css::uno::Sequence< OUString > aSNS { Service1 };                       \
-    return aSNS;                                                            \
+    return { Service1 };                       \
 }
 
 // Service with service factory.
@@ -256,7 +248,7 @@ Class::getSupportedServiceNames_Static()
   css::uno::Sequence< OUString >                              \
   Class::getSupportedServiceNames_Static()                                    \
   {                                                                             \
-      return css::uno::Sequence< OUString > { Service1 };                       \
+      return { Service1 };                       \
   }
 
 // 1 service name
diff --git a/include/ucbhelper/resultset.hxx b/include/ucbhelper/resultset.hxx
index e2f9945..d7f831f 100644
--- a/include/ucbhelper/resultset.hxx
+++ b/include/ucbhelper/resultset.hxx
@@ -125,9 +125,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XComponent
     virtual void SAL_CALL
     dispose()
diff --git a/include/ucbhelper/resultsethelper.hxx b/include/ucbhelper/resultsethelper.hxx
index d2f6c73..e35466f 100644
--- a/include/ucbhelper/resultsethelper.hxx
+++ b/include/ucbhelper/resultsethelper.hxx
@@ -152,9 +152,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XComponent ( base class of XDynamicResultSet )
     virtual void SAL_CALL
     dispose()
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index abf29aa..6b0a8fc 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -978,11 +978,24 @@ XTYPEPROVIDER_IMPL_11( CachedContentResultSet
 
 // XServiceInfo methods.
 
+OUString SAL_CALL CachedContentResultSet::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "com.sun.star.comp.ucb.CachedContentResultSet" );
+}
+
+sal_Bool SAL_CALL CachedContentResultSet::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return cppu::supportsService( this, ServiceName );
+}
+
+css::uno::Sequence< OUString > SAL_CALL CachedContentResultSet::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { CACHED_CONTENT_RESULTSET_SERVICE_NAME };
+}
 
-XSERVICEINFO_NOFACTORY_IMPL_1( CachedContentResultSet,
-                               OUString(
-                            "com.sun.star.comp.ucb.CachedContentResultSet" ),
-                            CACHED_CONTENT_RESULTSET_SERVICE_NAME );
 
 
 // XPropertySet methods. ( inherited )
diff --git a/ucb/source/cacher/cachedcontentresultset.hxx b/ucb/source/cacher/cachedcontentresultset.hxx
index 143fe02..12ff581 100644
--- a/ucb/source/cacher/cachedcontentresultset.hxx
+++ b/ucb/source/cacher/cachedcontentresultset.hxx
@@ -211,9 +211,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XPropertySet inherited
 
 
diff --git a/ucb/source/cacher/cachedcontentresultsetstub.cxx b/ucb/source/cacher/cachedcontentresultsetstub.cxx
index aed7d5b..93f4467 100644
--- a/ucb/source/cacher/cachedcontentresultsetstub.cxx
+++ b/ucb/source/cacher/cachedcontentresultsetstub.cxx
@@ -169,10 +169,24 @@ Sequence< Type > SAL_CALL CachedContentResultSetStub
 
 // XServiceInfo methods.
 
+OUString SAL_CALL CachedContentResultSetStub::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "com.sun.star.comp.ucb.CachedContentResultSetStub" );
+}
+
+sal_Bool SAL_CALL CachedContentResultSetStub::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return cppu::supportsService( this, ServiceName );
+}
+
+css::uno::Sequence< OUString > SAL_CALL CachedContentResultSetStub::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { CACHED_CRS_STUB_SERVICE_NAME };
+}
 
-XSERVICEINFO_NOFACTORY_IMPL_1( CachedContentResultSetStub,
-                        OUString( "com.sun.star.comp.ucb.CachedContentResultSetStub" ),
-                        CACHED_CRS_STUB_SERVICE_NAME );
 
 
 // XFetchProvider methods.
diff --git a/ucb/source/cacher/cachedcontentresultsetstub.hxx b/ucb/source/cacher/cachedcontentresultsetstub.hxx
index c0898d6..6f855e8 100644
--- a/ucb/source/cacher/cachedcontentresultsetstub.hxx
+++ b/ucb/source/cacher/cachedcontentresultsetstub.hxx
@@ -123,9 +123,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XFetchProvider
 
 
diff --git a/ucb/source/cacher/cacheddynamicresultset.cxx b/ucb/source/cacher/cacheddynamicresultset.cxx
index f984e62..95acf89 100644
--- a/ucb/source/cacher/cacheddynamicresultset.cxx
+++ b/ucb/source/cacher/cacheddynamicresultset.cxx
@@ -118,10 +118,23 @@ XTYPEPROVIDER_IMPL_4( CachedDynamicResultSet
 
 // XServiceInfo methods.
 
+OUString SAL_CALL CachedDynamicResultSet::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "com.sun.star.comp.ucb.CachedDynamicResultSet" );
+}
+
+sal_Bool SAL_CALL CachedDynamicResultSet::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return cppu::supportsService( this, ServiceName );
+}
 
-XSERVICEINFO_NOFACTORY_IMPL_1( CachedDynamicResultSet,
-                            OUString( "com.sun.star.comp.ucb.CachedDynamicResultSet" ),
-                            CACHED_DRS_SERVICE_NAME );
+css::uno::Sequence< OUString > SAL_CALL CachedDynamicResultSet::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { CACHED_DRS_SERVICE_NAME };
+}
 
 
 // own methods. ( inherited )
diff --git a/ucb/source/cacher/cacheddynamicresultset.hxx b/ucb/source/cacher/cacheddynamicresultset.hxx
index cf5b1c9..c16a272 100644
--- a/ucb/source/cacher/cacheddynamicresultset.hxx
+++ b/ucb/source/cacher/cacheddynamicresultset.hxx
@@ -73,10 +73,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
-
     // own methods ( inherited )
 
     virtual void SAL_CALL
diff --git a/ucb/source/cacher/cacheddynamicresultsetstub.cxx b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
index 6643d2f..ed17b7c 100644
--- a/ucb/source/cacher/cacheddynamicresultsetstub.cxx
+++ b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
@@ -120,10 +120,24 @@ XTYPEPROVIDER_IMPL_5( CachedDynamicResultSetStub
 
 // XServiceInfo methods.
 
+OUString SAL_CALL CachedDynamicResultSetStub::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "com.sun.star.comp.ucb.CachedDynamicResultSetStub" );
+}
+
+sal_Bool SAL_CALL CachedDynamicResultSetStub::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return cppu::supportsService( this, ServiceName );
+}
+
+css::uno::Sequence< OUString > SAL_CALL CachedDynamicResultSetStub::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { CACHED_DRS_STUB_SERVICE_NAME };
+}
 
-XSERVICEINFO_NOFACTORY_IMPL_1( CachedDynamicResultSetStub,
-                        OUString( "com.sun.star.comp.ucb.CachedDynamicResultSetStub" ),
-                        CACHED_DRS_STUB_SERVICE_NAME );
 
 
 // class CachedDynamicResultSetStubFactory
diff --git a/ucb/source/cacher/cacheddynamicresultsetstub.hxx b/ucb/source/cacher/cacheddynamicresultsetstub.hxx
index b0577d2..afc6144 100644
--- a/ucb/source/cacher/cacheddynamicresultsetstub.hxx
+++ b/ucb/source/cacher/cacheddynamicresultsetstub.hxx
@@ -67,10 +67,6 @@ public:
         throw( css::uno::RuntimeException, std::exception ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
-
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
 };
 
 
diff --git a/ucb/source/core/provprox.cxx b/ucb/source/core/provprox.cxx
index e1df427..3bc1333 100644
--- a/ucb/source/core/provprox.cxx
+++ b/ucb/source/core/provprox.cxx
@@ -163,10 +163,23 @@ Sequence< Type > SAL_CALL UcbContentProviderProxy::getTypes()
 
 // XServiceInfo methods.
 
+OUString SAL_CALL UcbContentProviderProxy::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "com.sun.star.comp.ucb.UcbContentProviderProxy" );
+}
 
-XSERVICEINFO_NOFACTORY_IMPL_1( UcbContentProviderProxy,
-                            OUString( "com.sun.star.comp.ucb.UcbContentProviderProxy" ),
-                            "com.sun.star.ucb.ContentProviderProxy" );
+sal_Bool SAL_CALL UcbContentProviderProxy::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return cppu::supportsService( this, ServiceName );
+}
+
+css::uno::Sequence< OUString > SAL_CALL UcbContentProviderProxy::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { "com.sun.star.ucb.ContentProviderProxy" };
+}
 
 
 // XContentProvider methods.
diff --git a/ucb/source/core/provprox.hxx b/ucb/source/core/provprox.hxx
index c23ab69..2e1a4fc 100644
--- a/ucb/source/core/provprox.hxx
+++ b/ucb/source/core/provprox.hxx
@@ -123,9 +123,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XContentProviderSupplier
     virtual css::uno::Reference<
         css::ucb::XContentProvider > SAL_CALL
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 19ba94a..560a122 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -249,9 +249,23 @@ PropertySetRegistry::~PropertySetRegistry()
 // XServiceInfo methods.
 
 
-XSERVICEINFO_NOFACTORY_IMPL_1( PropertySetRegistry,
-                                OUString( "com.sun.star.comp.ucb.PropertySetRegistry" ),
-                                PROPSET_REG_SERVICE_NAME );
+OUString SAL_CALL PropertySetRegistry::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "com.sun.star.comp.ucb.PropertySetRegistry" );
+}
+
+sal_Bool SAL_CALL PropertySetRegistry::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return cppu::supportsService( this, ServiceName );
+}
+
+css::uno::Sequence< OUString > SAL_CALL PropertySetRegistry::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { PROPSET_REG_SERVICE_NAME };
+}
 
 
 // XPropertySetRegistry methods.
@@ -1107,10 +1121,24 @@ PersistentPropertySet::~PersistentPropertySet()
 
 // XServiceInfo methods.
 
+OUString SAL_CALL PersistentPropertySet::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "com.sun.star.comp.ucb.PersistentPropertySet" );
+}
 
-XSERVICEINFO_NOFACTORY_IMPL_1( PersistentPropertySet,
-                                OUString( "com.sun.star.comp.ucb.PersistentPropertySet" ),
-                                PERS_PROPSET_SERVICE_NAME );
+sal_Bool SAL_CALL PersistentPropertySet::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return cppu::supportsService( this, ServiceName );
+}
+
+css::uno::Sequence< OUString > SAL_CALL
+PersistentPropertySet::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { PERS_PROPSET_SERVICE_NAME };
+}
 
 
 // XComponent methods.
diff --git a/ucb/source/core/ucbstore.hxx b/ucb/source/core/ucbstore.hxx
index c0c8de3..912256f 100644
--- a/ucb/source/core/ucbstore.hxx
+++ b/ucb/source/core/ucbstore.hxx
@@ -124,9 +124,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XPropertySetRegistry
     virtual css::uno::Reference< css::ucb::XPersistentPropertySet > SAL_CALL
     openPropertySet( const OUString& key, sal_Bool create )
@@ -197,9 +194,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XComponent
     virtual void SAL_CALL
     dispose()
diff --git a/ucb/source/inc/regexpmap.hxx b/ucb/source/inc/regexpmap.hxx
index 6194b18..f8f5450 100644
--- a/ucb/source/inc/regexpmap.hxx
+++ b/ucb/source/inc/regexpmap.hxx
@@ -119,8 +119,6 @@ private:
     RegexpMapImpl< Val > * m_pMap;
     int m_nList;
     mutable bool m_bEntrySet;
-
-    void setEntry() const;
 };
 
 template< typename Val >
@@ -143,20 +141,6 @@ inline RegexpMapIterImpl< Val >::RegexpMapIterImpl(MapImpl * pTheMap,
 {}
 
 template< typename Val >
-void RegexpMapIterImpl< Val >::setEntry() const
-{
-    if (!m_bEntrySet)
-    {
-        Entry< Val > const & rTheEntry
-            = m_nList == -1 ? *m_pMap->m_pDefault : *m_aIndex;
-        m_aEntry
-            = RegexpMapEntry< Val >(rTheEntry.m_aRegexp.getRegexp(),
-                                    const_cast< Val * >(&rTheEntry.m_aValue));
-        m_bEntrySet = true;
-    }
-}
-
-template< typename Val >
 RegexpMapIterImpl< Val >::RegexpMapIterImpl(RegexpMapImpl< Val > * pTheMap,
                                             bool bBegin):
     m_aEntry(rtl::OUString(), 0),
@@ -243,7 +227,15 @@ void RegexpMapIterImpl< Val >::next()
 template< typename Val >
 RegexpMapEntry< Val > & RegexpMapIterImpl< Val >::get()
 {
-    setEntry();
+    if (!m_bEntrySet)
+    {
+        Entry< Val > const & rTheEntry
+            = m_nList == -1 ? *m_pMap->m_pDefault : *m_aIndex;
+        m_aEntry
+            = RegexpMapEntry< Val >(rTheEntry.m_aRegexp.getRegexp(),
+                                    const_cast< Val * >(&rTheEntry.m_aValue));
+        m_bEntrySet = true;
+    }
     return m_aEntry;
 }
 
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index 65f4132..ead0def 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -101,11 +101,6 @@ SortedDynamicResultSet::~SortedDynamicResultSet()
 OUString SAL_CALL SortedDynamicResultSet::getImplementationName()
     throw( css::uno::RuntimeException, std::exception )
 {
-    return getImplementationName_Static();
-}
-
-OUString SortedDynamicResultSet::getImplementationName_Static()
-{
     return OUString( "com.sun.star.comp.ucb.SortedDynamicResultSet" );
 }
 
@@ -118,13 +113,7 @@ sal_Bool SAL_CALL SortedDynamicResultSet::supportsService( const OUString& Servi
 css::uno::Sequence< OUString > SAL_CALL SortedDynamicResultSet::getSupportedServiceNames()
     throw( css::uno::RuntimeException, std::exception )
 {
-    return getSupportedServiceNames_Static();
-}
-
-css::uno::Sequence< OUString > SortedDynamicResultSet::getSupportedServiceNames_Static()
-{
-    css::uno::Sequence<OUString> aSNS { DYNAMIC_RESULTSET_SERVICE_NAME };
-    return aSNS;
+    return { DYNAMIC_RESULTSET_SERVICE_NAME };
 }
 
 // XComponent methods.
diff --git a/ucb/source/sorter/sortdynres.hxx b/ucb/source/sorter/sortdynres.hxx
index 0078fd8..a766f5f 100644
--- a/ucb/source/sorter/sortdynres.hxx
+++ b/ucb/source/sorter/sortdynres.hxx
@@ -86,8 +86,6 @@ public:
         throw( css::uno::RuntimeException, std::exception ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
 
     // XComponent
 
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index b9d530c..392775b 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -164,11 +164,6 @@ SortedResultSet::~SortedResultSet()
 OUString SAL_CALL SortedResultSet::getImplementationName()
     throw( css::uno::RuntimeException, std::exception )
 {
-    return getImplementationName_Static();
-}
-
-OUString SortedResultSet::getImplementationName_Static()
-{
     return OUString( "com.sun.star.comp.ucb.SortedResultSet" );
 }
 
@@ -181,13 +176,7 @@ sal_Bool SAL_CALL SortedResultSet::supportsService( const OUString& ServiceName
 css::uno::Sequence< OUString > SAL_CALL SortedResultSet::getSupportedServiceNames()
     throw( css::uno::RuntimeException, std::exception )
 {
-    return getSupportedServiceNames_Static();
-}
-
-css::uno::Sequence< OUString >SortedResultSet::getSupportedServiceNames_Static()
-{
-    css::uno::Sequence<OUString> aSNS { RESULTSET_SERVICE_NAME };
-    return aSNS;
+    return { RESULTSET_SERVICE_NAME };
 }
 
 
diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx
index b0b575a..af481be 100644
--- a/ucb/source/sorter/sortresult.hxx
+++ b/ucb/source/sorter/sortresult.hxx
@@ -190,9 +190,6 @@ public:
         throw( css::uno::RuntimeException,
                std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XComponent
     virtual void SAL_CALL
     dispose() throw( css::uno::RuntimeException, std::exception ) override;
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index 8e73b49..ca606c9 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -177,11 +177,6 @@ css::uno::Sequence< css::uno::Type > SAL_CALL FTPContent::getTypes()
 OUString SAL_CALL FTPContent::getImplementationName()
     throw( css::uno::RuntimeException, std::exception )
 {
-    return getImplementationName_Static();
-}
-
-OUString FTPContent::getImplementationName_Static()
-{
     return OUString( "com.sun.star.comp.FTPContent");
 }
 
@@ -194,13 +189,7 @@ sal_Bool SAL_CALL FTPContent::supportsService( const OUString& ServiceName )
 css::uno::Sequence< OUString > SAL_CALL FTPContent::getSupportedServiceNames()
     throw( css::uno::RuntimeException, std::exception )
 {
-    return getSupportedServiceNames_Static();
-}
-
-css::uno::Sequence< OUString > FTPContent::getSupportedServiceNames_Static()
-{
-    css::uno::Sequence<OUString> aSNS { "com.sun.star.ucb.FTPContent" };
-    return aSNS;
+    return { "com.sun.star.ucb.FTPContent" };
 }
 
 
diff --git a/ucb/source/ucp/ftp/ftpcontent.hxx b/ucb/source/ucp/ftp/ftpcontent.hxx
index dde4be2..9c7a640 100644
--- a/ucb/source/ucp/ftp/ftpcontent.hxx
+++ b/ucb/source/ucp/ftp/ftpcontent.hxx
@@ -86,9 +86,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XContent
     virtual OUString SAL_CALL getContentType()
         throw( css::uno::RuntimeException, std::exception ) override;
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
index cb67852..fb5db74 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
@@ -209,8 +209,7 @@ Reference<XContent> SAL_CALL FTPContentProvider::queryContent(
             registerNewContent(xContent);
         }
         else {
-            Reference<XContentProvider>
-                xProvider(getHttpProvider());
+            Reference<XContentProvider> xProvider(UniversalContentBroker::create( m_xContext )->queryContentProvider("http:"));
             if(xProvider.is())
                 return xProvider->queryContent(xCanonicId);
             else
@@ -288,12 +287,4 @@ bool  FTPContentProvider::setHost( const OUString& host,
     return !present;
 }
 
-
-Reference<XContentProvider> FTPContentProvider::getHttpProvider()
-    throw(RuntimeException)
-{
-    // used for access to ftp-proxy
-    return UniversalContentBroker::create( m_xContext )->queryContentProvider("http:");
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.hxx b/ucb/source/ucp/ftp/ftpcontentprovider.hxx
index aedc02f..1bba004 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.hxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.hxx
@@ -125,10 +125,6 @@ namespace ftp
         std::vector<ServerInfo> m_ServerInfo;
 
         void init();
-
-        css::uno::Reference<css::ucb::XContentProvider> getHttpProvider()
-            throw(css::uno::RuntimeException);
-
     };  // end class FTPContentProvider
 
 }       // end namespace ftp
diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx
index 87d1353..a3eed99 100644
--- a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx
@@ -107,9 +107,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw( css::uno::RuntimeException, std::exception ) override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     // XTypeProvider
     virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
         throw( css::uno::RuntimeException, std::exception ) override;
@@ -722,15 +719,22 @@ uno::Sequence< uno::Type > SAL_CALL HierarchyDataAccess::getTypes()
 
 // XServiceInfo methods.
 
+OUString SAL_CALL HierarchyDataAccess::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString("com.sun.star.comp.ucb.HierarchyDataAccess");
+}
 
-XSERVICEINFO_NOFACTORY_IMPL_0(
-        HierarchyDataAccess,
-        OUString( "com.sun.star.comp.ucb.HierarchyDataAccess"  ) )
+sal_Bool SAL_CALL HierarchyDataAccess::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
 {
-    uno::Sequence< OUString > aSNS( 2 );
-    aSNS[ 0 ] = READ_SERVICE_NAME;
-    aSNS[ 1 ] = READWRITE_SERVICE_NAME;
-    return aSNS;
+    return cppu::supportsService( this, ServiceName );
+}
+
+css::uno::Sequence< OUString > SAL_CALL HierarchyDataAccess::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { READ_SERVICE_NAME, READWRITE_SERVICE_NAME };
 }
 
 
diff --git a/ucbhelper/source/provider/resultset.cxx b/ucbhelper/source/provider/resultset.cxx
index d8e34ac..fb6d332 100644
--- a/ucbhelper/source/provider/resultset.cxx
+++ b/ucbhelper/source/provider/resultset.cxx
@@ -270,10 +270,23 @@ XTYPEPROVIDER_IMPL_9( ResultSet,
 
 // XServiceInfo methods.
 
+OUString SAL_CALL ResultSet::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "ResultSet" );
+}
+
+sal_Bool SAL_CALL ResultSet::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return cppu::supportsService( this, ServiceName );
+}
 
-XSERVICEINFO_NOFACTORY_IMPL_1( ResultSet,
-                    OUString("ResultSet"),
-                    RESULTSET_SERVICE_NAME );
+css::uno::Sequence< OUString > SAL_CALL ResultSet::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { RESULTSET_SERVICE_NAME };
+}
 
 
 // XComponent methods.
diff --git a/ucbhelper/source/provider/resultsethelper.cxx b/ucbhelper/source/provider/resultsethelper.cxx
index 98a3a09..37a1310 100644
--- a/ucbhelper/source/provider/resultsethelper.cxx
+++ b/ucbhelper/source/provider/resultsethelper.cxx
@@ -100,12 +100,23 @@ XTYPEPROVIDER_IMPL_3( ResultSetImplHelper,
 
 // XServiceInfo methods.
 
+OUString SAL_CALL ResultSetImplHelper::getImplementationName()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "ResultSetImplHelper" );
+}
 
-XSERVICEINFO_NOFACTORY_IMPL_1( ResultSetImplHelper,
-                               OUString(
-                                   "ResultSetImplHelper" ),
-                               DYNAMICRESULTSET_SERVICE_NAME );
+sal_Bool SAL_CALL ResultSetImplHelper::supportsService( const OUString& ServiceName )
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return cppu::supportsService( this, ServiceName );
+}
 
+css::uno::Sequence< OUString > SAL_CALL ResultSetImplHelper::getSupportedServiceNames()
+    throw( css::uno::RuntimeException, std::exception )
+{
+    return { DYNAMICRESULTSET_SERVICE_NAME };
+}
 
 // XComponent methods.
 


More information about the Libreoffice-commits mailing list