summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-09-25 15:41:29 -0300
committerStephan Bergmann <sbergman@redhat.com>2013-10-07 17:01:33 +0000
commit7235d23267e4591e5cf47762abd3f63421b06904 (patch)
tree6353239b1c586642e22c5df892a7c0560e632fa5 /linguistic
parent8e37c7ae282f10724d6322aa028a7dd6b698f071 (diff)
fdo#54938: Adapt supportsService implementations to cppu::supportsService
Change-Id: I683c0d30c3286ed5d725d4eefe8b3977b82ee316 Reviewed-on: https://gerrit.libreoffice.org/6035 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/convdic.cxx9
-rw-r--r--linguistic/source/dlistimp.cxx11
-rw-r--r--linguistic/source/gciterator.cxx8
-rw-r--r--linguistic/source/hhconvdic.cxx7
-rw-r--r--linguistic/source/lngopt.cxx10
-rw-r--r--linguistic/source/lngsvcmgr.cxx10
-rw-r--r--linguistic/workben/sspellimp.cxx11
7 files changed, 14 insertions, 52 deletions
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 66c657eb6db3..fb00d9db2eac 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -27,6 +27,7 @@
#include <tools/urlobj.hxx>
#include <ucbhelper/content.hxx>
#include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <unotools/streamwrap.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -655,18 +656,12 @@ OUString SAL_CALL ConvDic::getImplementationName( )
return getImplementationName_Static();
}
-
sal_Bool SAL_CALL ConvDic::supportsService( const OUString& rServiceName )
throw (RuntimeException)
{
- MutexGuard aGuard( GetLinguMutex() );
- sal_Bool bRes = sal_False;
- if ( rServiceName == SN_CONV_DICTIONARY )
- bRes = sal_True;
- return bRes;
+ return cppu::supportsService(this, rServiceName);
}
-
uno::Sequence< OUString > SAL_CALL ConvDic::getSupportedServiceNames( )
throw (RuntimeException)
{
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 45db2012f9ee..2267e20d6c3b 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -26,6 +26,7 @@
#include <unotools/pathoptions.hxx>
#include <unotools/useroptions.hxx>
#include <cppuhelper/factory.hxx> // helper for factories
+#include <cppuhelper/supportsservice.hxx>
#include <unotools/localfilehelper.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -739,17 +740,9 @@ OUString SAL_CALL DicList::getImplementationName( ) throw(RuntimeException)
sal_Bool SAL_CALL DicList::supportsService( const OUString& ServiceName )
throw(RuntimeException)
{
- osl::MutexGuard aGuard( GetLinguMutex() );
-
- uno::Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString * pArray = aSNL.getConstArray();
- for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- if( pArray[i] == ServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-
uno::Sequence< OUString > SAL_CALL DicList::getSupportedServiceNames( )
throw(RuntimeException)
{
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index efde32c9b067..5f2c51f658b5 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -52,6 +52,7 @@
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/extract.hxx>
@@ -1048,12 +1049,7 @@ sal_Bool SAL_CALL GrammarCheckingIterator::supportsService(
const OUString & rServiceName )
throw(uno::RuntimeException)
{
- uno::Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString * pArray = aSNL.getConstArray();
- for( sal_Int32 i = 0; i < aSNL.getLength(); ++i )
- if( pArray[i] == rServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, rServiceName);
}
diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx
index a34644216cb1..090f0e96493a 100644
--- a/linguistic/source/hhconvdic.cxx
+++ b/linguistic/source/hhconvdic.cxx
@@ -25,6 +25,7 @@
#include <ucbhelper/content.hxx>
#include <cppuhelper/factory.hxx> // helper for factories
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/linguistic2/XConversionDictionary.hpp>
#include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
#include <com/sun/star/lang/Locale.hpp>
@@ -121,11 +122,7 @@ OUString SAL_CALL HHConvDic::getImplementationName( )
sal_Bool SAL_CALL HHConvDic::supportsService( const OUString& rServiceName )
throw (RuntimeException)
{
- MutexGuard aGuard( GetLinguMutex() );
- sal_Bool bRes = sal_False;
- if ( rServiceName == SN_CONV_DICTIONARY || rServiceName == SN_HH_CONV_DICTIONARY )
- bRes = sal_True;
- return bRes;
+ return cppu::supportsService(this, rServiceName);
}
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index 75babc93dfce..9b6be98fdce4 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -29,6 +29,7 @@
#include <cppuhelper/implbase1.hxx> // helper for implementations
#include <cppuhelper/factory.hxx> // helper for factories
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/registry/XSimpleRegistry.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
@@ -433,14 +434,7 @@ OUString SAL_CALL LinguProps::getImplementationName()
sal_Bool SAL_CALL LinguProps::supportsService( const OUString& ServiceName )
throw(RuntimeException)
{
- MutexGuard aGuard( GetLinguMutex() );
-
- uno::Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString * pArray = aSNL.getConstArray();
- for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- if( pArray[i] == ServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
// XServiceInfo
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index a8aeeede7766..51dc1708dff8 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -34,6 +34,7 @@
#include <i18nlangtag/lang.h>
#include <i18nlangtag/languagetag.hxx>
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/extract.hxx>
#include <boost/checked_delete.hpp>
@@ -2053,14 +2054,7 @@ sal_Bool SAL_CALL
LngSvcMgr::supportsService( const OUString& ServiceName )
throw(uno::RuntimeException)
{
- osl::MutexGuard aGuard( GetLinguMutex() );
-
- uno::Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString * pArray = aSNL.getConstArray();
- for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- if( pArray[i] == ServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx
index 775c2fab20de..e4e7dd945c93 100644
--- a/linguistic/workben/sspellimp.cxx
+++ b/linguistic/workben/sspellimp.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <comphelper/string.hxx>
#include <cppuhelper/factory.hxx> // helper for factories
+#include <cppuhelper/supportsservice.hxx>
#include <tools/debug.hxx>
#include <osl/mutex.hxx>
@@ -415,17 +416,9 @@ OUString SAL_CALL SpellChecker::getImplementationName()
sal_Bool SAL_CALL SpellChecker::supportsService( const OUString& ServiceName )
throw(RuntimeException)
{
- MutexGuard aGuard( GetLinguMutex() );
-
- Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString * pArray = aSNL.getConstArray();
- for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- if( pArray[i] == ServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-
Sequence< OUString > SAL_CALL SpellChecker::getSupportedServiceNames()
throw(RuntimeException)
{