summaryrefslogtreecommitdiff
path: root/lingucomponent
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-23 14:35:10 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-25 08:19:58 +0000
commit704f95e5255ff72bfb548d50d66d4da61dc483ef (patch)
tree3b0799aa8ce5185f4775966f733e1acb2df6285c /lingucomponent
parenta95ecd8b65ea2275a66f6694f0c09e3faaef4407 (diff)
fdo#54938: More uses of cppu::supportsService
Change-Id: I90a7a07a43559b8d7e1d4b886b2624255200d46b Reviewed-on: https://gerrit.libreoffice.org/6406 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx17
-rw-r--r--lingucomponent/source/languageguessing/guesslang.cxx16
-rw-r--r--lingucomponent/source/spellcheck/macosxspell/macspellimp.mm17
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx16
-rw-r--r--lingucomponent/source/thesaurus/libnth/nthesimp.cxx16
5 files changed, 10 insertions, 72 deletions
diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
index 686704ebfd1e..60f428f39581 100644
--- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <i18nlangtag/languagetag.hxx>
#include <tools/debug.hxx>
@@ -847,11 +848,7 @@ void SAL_CALL Hyphenator::removeEventListener( const Reference< XEventListener >
aEvtListeners.removeInterface( rxListener );
}
-
-///////////////////////////////////////////////////////////////////////////
// Service specific part
-//
-
OUString SAL_CALL Hyphenator::getImplementationName()
throw(RuntimeException)
{
@@ -860,21 +857,12 @@ OUString SAL_CALL Hyphenator::getImplementationName()
return getImplementationName_Static();
}
-
sal_Bool SAL_CALL Hyphenator::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 Hyphenator::getSupportedServiceNames()
throw(RuntimeException)
{
@@ -883,7 +871,6 @@ Sequence< OUString > SAL_CALL Hyphenator::getSupportedServiceNames()
return getSupportedServiceNames_Static();
}
-
Sequence< OUString > Hyphenator::getSupportedServiceNames_Static()
throw()
{
diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx
index e6406d213277..a65ec51de4ab 100644
--- a/lingucomponent/source/languageguessing/guesslang.cxx
+++ b/lingucomponent/source/languageguessing/guesslang.cxx
@@ -26,6 +26,7 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <simpleguesser.hxx>
#include <guess.hxx>
@@ -346,7 +347,6 @@ void SAL_CALL LangGuess_Impl::enableLanguages(
}
}
-//*************************************************************************
OUString SAL_CALL LangGuess_Impl::getImplementationName( )
throw(RuntimeException)
{
@@ -354,20 +354,12 @@ OUString SAL_CALL LangGuess_Impl::getImplementationName( )
return OUString( IMPLNAME );
}
-//*************************************************************************
sal_Bool SAL_CALL LangGuess_Impl::supportsService( const OUString& ServiceName )
throw(RuntimeException)
{
- osl::MutexGuard aGuard( GetLangGuessMutex() );
- 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);
}
-//*************************************************************************
Sequence<OUString> SAL_CALL LangGuess_Impl::getSupportedServiceNames( )
throw(RuntimeException)
{
@@ -375,16 +367,12 @@ Sequence<OUString> SAL_CALL LangGuess_Impl::getSupportedServiceNames( )
return getSupportedServiceNames_Static();
}
-//*************************************************************************
Sequence<OUString> SAL_CALL LangGuess_Impl::getSupportedServiceNames_Static( )
{
OUString aName( SERVICENAME );
return Sequence< OUString >( &aName, 1 );
}
-//*************************************************************************
-
-
/**
* Function to create a new component instance; is needed by factory helper implementation.
* @param xMgr service manager to if the components needs other component instances
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
index c862fcc8c844..9bed1265656c 100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
@@ -22,6 +22,7 @@
#include <com/sun/star/linguistic2/SpellFailure.hpp>
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <tools/debug.hxx>
#include <osl/mutex.hxx>
@@ -520,11 +521,7 @@ void SAL_CALL
aEvtListeners.removeInterface( rxListener );
}
-
-///////////////////////////////////////////////////////////////////////////
// Service specific part
-//
-
OUString SAL_CALL MacSpellChecker::getImplementationName()
throw(RuntimeException)
{
@@ -533,21 +530,12 @@ OUString SAL_CALL MacSpellChecker::getImplementationName()
return getImplementationName_Static();
}
-
sal_Bool SAL_CALL MacSpellChecker::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 MacSpellChecker::getSupportedServiceNames()
throw(RuntimeException)
{
@@ -556,7 +544,6 @@ Sequence< OUString > SAL_CALL MacSpellChecker::getSupportedServiceNames()
return getSupportedServiceNames_Static();
}
-
Sequence< OUString > MacSpellChecker::getSupportedServiceNames_Static()
throw()
{
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index c0e84100f735..cec853547039 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/linguistic2/SpellFailure.hpp>
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <tools/debug.hxx>
#include <osl/mutex.hxx>
@@ -630,10 +631,7 @@ void SAL_CALL SpellChecker::removeEventListener( const Reference< XEventListener
}
-///////////////////////////////////////////////////////////////////////////
// Service specific part
-//
-
OUString SAL_CALL SpellChecker::getImplementationName()
throw(RuntimeException)
{
@@ -642,21 +640,12 @@ OUString SAL_CALL SpellChecker::getImplementationName()
return getImplementationName_Static();
}
-
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)
{
@@ -665,7 +654,6 @@ Sequence< OUString > SAL_CALL SpellChecker::getSupportedServiceNames()
return getSupportedServiceNames_Static();
}
-
Sequence< OUString > SpellChecker::getSupportedServiceNames_Static()
throw()
{
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index 132f03d23366..e549e45847af 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -20,6 +20,7 @@
#include <com/sun/star/uno/Reference.h>
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/linguistic2/LinguServiceManager.hpp>
@@ -645,11 +646,7 @@ void SAL_CALL Thesaurus::removeEventListener( const Reference< XEventListener >&
aEvtListeners.removeInterface( rxListener );
}
-
-///////////////////////////////////////////////////////////////////////////
// Service specific part
-//
-
OUString SAL_CALL Thesaurus::getImplementationName()
throw(RuntimeException)
{
@@ -661,17 +658,9 @@ OUString SAL_CALL Thesaurus::getImplementationName()
sal_Bool SAL_CALL Thesaurus::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 Thesaurus::getSupportedServiceNames()
throw(RuntimeException)
{
@@ -679,7 +668,6 @@ Sequence< OUString > SAL_CALL Thesaurus::getSupportedServiceNames()
return getSupportedServiceNames_Static();
}
-
Sequence< OUString > Thesaurus::getSupportedServiceNames_Static()
throw()
{