diff options
author | Alexandre Vicenzi <vicenzi.alexandre@gmail.com> | 2014-01-31 04:53:17 -0200 |
---|---|---|
committer | Marcos Souza <marcos.souza.org@gmail.com> | 2014-02-02 17:38:09 +0000 |
commit | 93ef9a43a53218bdfbdea2ec20fba73fef08db75 (patch) | |
tree | 02536ba1f94b8712372f33be509ad1e68086844c /scripting | |
parent | Print fair message from CPPUnitTest (diff) | |
download | core-93ef9a43a53218bdfbdea2ec20fba73fef08db75.tar.gz core-93ef9a43a53218bdfbdea2ec20fba73fef08db75.zip |
fdo#54938 Convert bridges, editeng and others to cppu::supportsService
Change-Id: I7ff5189473c3e0831c2f1e95264d1a04f3b716a9
Reviewed-on: https://gerrit.libreoffice.org/7761
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Marcos Souza <marcos.souza.org@gmail.com>
Tested-by: Marcos Souza <marcos.souza.org@gmail.com>
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/provider/MasterScriptProviderFactory.cxx | 51 |
1 files changed, 9 insertions, 42 deletions
diff --git a/scripting/source/provider/MasterScriptProviderFactory.cxx b/scripting/source/provider/MasterScriptProviderFactory.cxx index a91707228692..0f9bf5d8e777 100644 --- a/scripting/source/provider/MasterScriptProviderFactory.cxx +++ b/scripting/source/provider/MasterScriptProviderFactory.cxx @@ -17,11 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <cppuhelper/weakref.hxx> +#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implementationentry.hxx> -#include <cppuhelper/factory.hxx> #include <cppuhelper/exc_hlp.hxx> -#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/supportsservice.hxx> +#include <cppuhelper/weakref.hxx> #include "MasterScriptProviderFactory.hxx" @@ -42,12 +43,6 @@ MasterScriptProviderFactory::~MasterScriptProviderFactory() { } - -//############################################################################ -// Implementation of XScriptProviderFactory -//############################################################################ - - Reference< provider::XScriptProvider > SAL_CALL MasterScriptProviderFactory::createScriptProvider( const Any& context ) throw ( lang::IllegalArgumentException, RuntimeException) { @@ -55,10 +50,6 @@ MasterScriptProviderFactory::createScriptProvider( const Any& context ) throw ( return xMsp; } -//############################################################################ -// Helper methods -//############################################################################ - const rtl::Reference< ActiveMSPList > & MasterScriptProviderFactory::getActiveMSPList() const { @@ -71,12 +62,7 @@ MasterScriptProviderFactory::getActiveMSPList() const return m_MSPList; } -//############################################################################ -// Namespace global methods for setting up MasterScriptProviderFactory service -//############################################################################ - -Sequence< OUString > SAL_CALL -mspf_getSupportedServiceNames( ) +Sequence< OUString > SAL_CALL mspf_getSupportedServiceNames( ) SAL_THROW(()) { OUString str_name( @@ -85,8 +71,7 @@ mspf_getSupportedServiceNames( ) return Sequence< OUString >( &str_name, 1 ); } -OUString SAL_CALL -mspf_getImplementationName( ) +OUString SAL_CALL mspf_getImplementationName( ) SAL_THROW(()) { return OUString( @@ -101,19 +86,13 @@ mspf_create( Reference< XComponentContext > const & xComponentContext ) new MasterScriptProviderFactory( xComponentContext ) ); } -//############################################################################ -// Implementation of XServiceInfo -//############################################################################ - -OUString SAL_CALL -MasterScriptProviderFactory::getImplementationName() +OUString SAL_CALL MasterScriptProviderFactory::getImplementationName() throw (RuntimeException) { return mspf_getImplementationName(); } -Sequence< OUString > SAL_CALL -MasterScriptProviderFactory::getSupportedServiceNames() +Sequence< OUString > SAL_CALL MasterScriptProviderFactory::getSupportedServiceNames() throw (RuntimeException) { return mspf_getSupportedServiceNames(); @@ -123,19 +102,7 @@ sal_Bool MasterScriptProviderFactory::supportsService( OUString const & serviceName ) throw (RuntimeException) { -// check(); - - Sequence< OUString > supported_services( - getSupportedServiceNames() ); - - OUString const * ar = supported_services.getConstArray(); - - for ( sal_Int32 pos = supported_services.getLength(); pos--; ) - { - if (ar[ pos ].equals( serviceName )) - return true; - } - return false; + return cppu::supportsService(this, serviceName); } } // namespace browsenodefactory |