[Libreoffice-commits] core.git: sw/inc sw/source

Marcos Paulo de Souza marcos.souza.org at gmail.com
Thu Oct 24 08:58:22 PDT 2013


 sw/inc/unobaseclass.hxx                 |    3 ---
 sw/source/core/unocore/unobkm.cxx       |    4 ++--
 sw/source/core/unocore/unoftn.cxx       |    6 ++----
 sw/source/core/unocore/unoidx.cxx       |   16 +++++-----------
 sw/source/core/unocore/unoobj.cxx       |    4 ++--
 sw/source/core/unocore/unoobj2.cxx      |   27 +++++----------------------
 sw/source/core/unocore/unoparagraph.cxx |    4 ++--
 sw/source/core/unocore/unorefmk.cxx     |   10 ++++------
 sw/source/core/unocore/unosect.cxx      |    5 ++---
 sw/source/core/unocore/unotext.cxx      |    8 +++-----
 10 files changed, 27 insertions(+), 60 deletions(-)

New commits:
commit be0adb9f0fc738fe8735d2e0802fd19091799d11
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Thu Oct 24 11:26:31 2013 -0200

    fdo#54938: Remove SupportsServiceImpl from sw and use cppu instead
    
    Change-Id: I285a03f615e2f2a2656873a8f433a2599bd62c28
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx
index 483bd29..3dfe62f 100644
--- a/sw/inc/unobaseclass.hxx
+++ b/sw/inc/unobaseclass.hxx
@@ -148,9 +148,6 @@ namespace sw {
     ::com::sun::star::uno::Sequence< OUString >
     GetSupportedServiceNamesImpl(
             size_t const nServices, char const*const pServices[]);
-    sal_Bool SupportsServiceImpl(
-            size_t const nServices, char const*const pServices[],
-            OUString const & rServiceName);
 
 } // namespace sw
 
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 06467b2..8e57246 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -21,6 +21,7 @@
 #include <unobookmark.hxx>
 #include <osl/mutex.hxx>
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <vcl/svapp.hxx>
 
 #include <TextCursorHelper.hxx>
@@ -392,8 +393,7 @@ static const size_t g_nServicesBookmark(
 sal_Bool SAL_CALL SwXBookmark::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesBookmark, g_ServicesBookmark, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index 84aedbb..fcefbf0 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -20,6 +20,7 @@
 
 #include <osl/mutex.hxx>
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <vcl/svapp.hxx>
 #include <comphelper/sequence.hxx>
 #include <comphelper/servicehelper.hxx>
@@ -206,10 +207,7 @@ static const size_t g_nServicesFootnote( g_nServicesEndnote - 1 ); // NB: omit!
 sal_Bool SAL_CALL SwXFootnote::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    SolarMutexGuard g;
-    return ::sw::SupportsServiceImpl(
-            (m_pImpl->m_bIsEndnote) ? g_nServicesEndnote : g_nServicesFootnote,
-            g_ServicesFootnote, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index c2efe98..ef8fdce 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -30,6 +30,7 @@
 
 #include <osl/mutex.hxx>
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <vcl/svapp.hxx>
 #include <editeng/unolingu.hxx>
 #include <hints.hxx>
@@ -2378,9 +2379,7 @@ sal_Bool SAL_CALL
 SwXDocumentIndexes::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-        SAL_N_ELEMENTS(g_ServicesDocumentIndexes),
-        g_ServicesDocumentIndexes, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
@@ -2577,13 +2576,10 @@ static char const*const g_ServicesIndexStyleAccess[] =
 };
 
 sal_Bool SAL_CALL
-SwXDocumentIndex::StyleAccess_Impl::supportsService(
-        const OUString& rServiceName)
+SwXDocumentIndex::StyleAccess_Impl::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-        SAL_N_ELEMENTS(g_ServicesIndexStyleAccess),
-        g_ServicesIndexStyleAccess, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
@@ -2715,9 +2711,7 @@ SwXDocumentIndex::TokenAccess_Impl::supportsService(
         const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-        SAL_N_ELEMENTS(g_ServicesIndexTokenAccess),
-        g_ServicesIndexTokenAccess, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index bae9789..0ffc5b9 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -19,6 +19,7 @@
 
 #include <com/sun/star/table/TableSortField.hpp>
 #include <comphelper/string.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/endian.h>
 #include <rtl/ustrbuf.hxx>
 #include <unotools/collatorwrapper.hxx>
@@ -919,8 +920,7 @@ static const size_t g_nServicesTextCursor(
 sal_Bool SAL_CALL SwXTextCursor::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesTextCursor, g_ServicesTextCursor, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 5fa3419..67f0c71 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -106,25 +106,12 @@
 #include <boost/bind.hpp>
 #include <switerator.hxx>
 #include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace ::com::sun::star;
 
 namespace sw {
 
-sal_Bool SupportsServiceImpl(
-        size_t const nServices, char const*const pServices[],
-        OUString const & rServiceName)
-{
-    for (size_t i = 0; i < nServices; ++i)
-    {
-        if (rServiceName.equalsAscii(pServices[i]))
-        {
-            return sal_True;
-        }
-    }
-    return sal_False;
-}
-
 uno::Sequence< OUString >
 GetSupportedServiceNamesImpl(
         size_t const nServices, char const*const pServices[])
@@ -535,8 +522,7 @@ sal_Bool SAL_CALL
 SwXParagraphEnumeration::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesParagraphEnum, g_ServicesParagraphEnum, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
@@ -917,8 +903,7 @@ static const size_t g_nServicesTextRange(
 sal_Bool SAL_CALL SwXTextRange::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesTextRange, g_ServicesTextRange, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
@@ -1644,8 +1629,7 @@ static const size_t g_nServicesTextRanges(
 sal_Bool SAL_CALL SwXTextRanges::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesTextRanges, g_ServicesTextRanges, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
@@ -1939,8 +1923,7 @@ sal_Bool SAL_CALL
 SwXParaFrameEnumeration::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesParaFrameEnum, g_ServicesParaFrameEnum, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index ce18912..fbe7c40 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -20,6 +20,7 @@
 #include <unoparagraph.hxx>
 
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <cmdid.h>
 #include <unomid.h>
@@ -305,8 +306,7 @@ sal_Bool SAL_CALL
 SwXParagraph::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesParagraph, g_ServicesParagraph, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 403407f..3ca9dd2 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -20,6 +20,7 @@
 
 #include <osl/mutex.hxx>
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 #include <vcl/svapp.hxx>
 
 #include <unomid.h>
@@ -183,8 +184,7 @@ sal_Bool SAL_CALL
 SwXReferenceMark::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesReferenceMark, g_ServicesReferenceMark, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
@@ -917,8 +917,7 @@ sal_Bool SAL_CALL
 SwXMeta::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesMeta, g_ServicesMeta, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
@@ -1347,8 +1346,7 @@ sal_Bool SAL_CALL
 SwXMetaField::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesMetaField, g_ServicesMetaField, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index d7a6e66..bf4f913 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/text/SectionFileLink.hpp>
 
 #include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <cmdid.h>
 #include <hintids.hxx>
@@ -1763,9 +1764,7 @@ static char const*const g_ServicesTextSection[] =
 sal_Bool SAL_CALL SwXTextSection::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            SAL_N_ELEMENTS(g_ServicesTextSection),
-            g_ServicesTextSection, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index c712ba1..cfbc527 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -30,6 +30,7 @@
 #include <vcl/svapp.hxx>
 #include <comphelper/sequence.hxx>
 #include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <cmdid.h>
 #include <unotextbodyhf.hxx>
@@ -2408,8 +2409,7 @@ static const size_t g_nServicesBodyText(
 sal_Bool SAL_CALL SwXBodyText::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            g_nServicesBodyText, g_ServicesBodyText, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL
@@ -2702,9 +2702,7 @@ static char const*const g_ServicesHeadFootText[] =
 sal_Bool SAL_CALL SwXHeadFootText::supportsService(const OUString& rServiceName)
 throw (uno::RuntimeException)
 {
-    return ::sw::SupportsServiceImpl(
-            SAL_N_ELEMENTS(g_ServicesHeadFootText),
-            g_ServicesHeadFootText, rServiceName);
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL


More information about the Libreoffice-commits mailing list