diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-24 14:55:08 -0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-25 08:07:04 +0000 |
commit | da5449da0c056a3a0da239eff2e2b8b66cfd6224 (patch) | |
tree | 6f6698e676726bd8a07f281a9707e448a711d983 /forms/source/component/FormComponent.cxx | |
parent | 01a13519e2a12e1e9b61bab1437d340e389e44bf (diff) |
fdo#54938: More uses of cppu::supportsService
Change-Id: Id6bed78d92eba52283a17ab3ca66e751c225e48d
Reviewed-on: https://gerrit.libreoffice.org/6423
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 'forms/source/component/FormComponent.cxx')
-rw-r--r-- | forms/source/component/FormComponent.cxx | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 1bd3acd35db6..7a23644b173a 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -44,6 +44,7 @@ #include <comphelper/property.hxx> #include <connectivity/dbtools.hxx> #include <cppuhelper/queryinterface.hxx> +#include <cppuhelper/supportsservice.hxx> #include <toolkit/helper/emptyfontdescriptor.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> @@ -226,7 +227,6 @@ void OControl::initFormControlPeer( const Reference< XWindowPeer >& /*_rxPeer*/ } // OComponentHelper -//------------------------------------------------------------------------------ void OControl::disposing() { OComponentHelper::disposing(); @@ -239,18 +239,11 @@ void OControl::disposing() } // XServiceInfo -//------------------------------------------------------------------------------ sal_Bool SAL_CALL OControl::supportsService(const OUString& _rsServiceName) throw ( RuntimeException) { - Sequence<OUString> aSupported = getSupportedServiceNames(); - const OUString* pSupported = aSupported.getConstArray(); - for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported) - if (pSupported->equals(_rsServiceName)) - return sal_True; - return sal_False; + return cppu::supportsService(this, _rsServiceName); } -//------------------------------------------------------------------------------ Sequence< OUString > OControl::getAggregateServiceNames() { Sequence< OUString > aAggServices; @@ -260,7 +253,6 @@ Sequence< OUString > OControl::getAggregateServiceNames() return aAggServices; } -//------------------------------------------------------------------------------ Sequence<OUString> SAL_CALL OControl::getSupportedServiceNames() throw(RuntimeException) { return ::comphelper::concatSequences( @@ -728,7 +720,6 @@ void SAL_CALL OControlModel::setParent(const Reference< XInterface >& _rxParent) } // XNamed -//------------------------------------------------------------------------------ OUString SAL_CALL OControlModel::getName() throw(RuntimeException) { OUString aReturn; @@ -736,25 +727,17 @@ OUString SAL_CALL OControlModel::getName() throw(RuntimeException) return aReturn; } -//------------------------------------------------------------------------------ void SAL_CALL OControlModel::setName(const OUString& _rName) throw(RuntimeException) { setFastPropertyValue(PROPERTY_ID_NAME, makeAny(_rName)); } // XServiceInfo -//------------------------------------------------------------------------------ sal_Bool SAL_CALL OControlModel::supportsService(const OUString& _rServiceName) throw ( RuntimeException) { - Sequence<OUString> aSupported = getSupportedServiceNames(); - const OUString* pSupported = aSupported.getConstArray(); - for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported) - if (pSupported->equals(_rServiceName)) - return sal_True; - return sal_False; + return cppu::supportsService(this, _rServiceName); } -//------------------------------------------------------------------------------ Sequence< OUString > OControlModel::getAggregateServiceNames() { Sequence< OUString > aAggServices; @@ -764,7 +747,6 @@ Sequence< OUString > OControlModel::getAggregateServiceNames() return aAggServices; } -//------------------------------------------------------------------------------ Sequence<OUString> SAL_CALL OControlModel::getSupportedServiceNames() throw(RuntimeException) { return ::comphelper::concatSequences( @@ -773,7 +755,6 @@ Sequence<OUString> SAL_CALL OControlModel::getSupportedServiceNames() throw(Runt ); } -//------------------------------------------------------------------------------ Sequence< OUString > SAL_CALL OControlModel::getSupportedServiceNames_Static() throw( RuntimeException ) { Sequence< OUString > aServiceNames( 2 ); |