summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-24 14:55:08 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-25 08:07:04 +0000
commitda5449da0c056a3a0da239eff2e2b8b66cfd6224 (patch)
tree6f6698e676726bd8a07f281a9707e448a711d983 /svx
parent01a13519e2a12e1e9b61bab1437d340e389e44bf (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 'svx')
-rw-r--r--svx/source/accessibility/svxrectctaccessiblecontext.cxx17
-rw-r--r--svx/source/form/legacyformcontroller.cxx13
2 files changed, 4 insertions, 26 deletions
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index 6c9fa05354e8..da7239296197 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <cppuhelper/typeprovider.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <toolkit/helper/convert.hxx>
#include <vcl/svapp.hxx>
@@ -500,7 +501,6 @@ sal_Int32 SvxRectCtlAccessibleContext::getBackground( )
}
//===== XServiceInfo ========================================================
-
OUString SAL_CALL SvxRectCtlAccessibleContext::getImplementationName( void ) throw( RuntimeException )
{
return OUString( "com.sun.star.comp.ui.SvxRectCtlAccessibleContext" );
@@ -508,20 +508,7 @@ OUString SAL_CALL SvxRectCtlAccessibleContext::getImplementationName( void ) thr
sal_Bool SAL_CALL SvxRectCtlAccessibleContext::supportsService( const OUString& sServiceName ) throw( RuntimeException )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- // Iterate over all supported service names and return true if on of them
- // matches the given name.
- Sequence< OUString > aSupportedServices( getSupportedServiceNames() );
- int nLength = aSupportedServices.getLength();
- const OUString* pStr = aSupportedServices.getConstArray();
-
- for( int i = nLength ; i ; --i, ++pStr )
- {
- if( sServiceName == *pStr )
- return sal_True;
- }
-
- return sal_False;
+ return cppu::supportsService(this, sServiceName);
}
Sequence< OUString > SAL_CALL SvxRectCtlAccessibleContext::getSupportedServiceNames( void ) throw( RuntimeException )
diff --git a/svx/source/form/legacyformcontroller.cxx b/svx/source/form/legacyformcontroller.cxx
index ac6279ea72b3..df97d8fe57d7 100644
--- a/svx/source/form/legacyformcontroller.cxx
+++ b/svx/source/form/legacyformcontroller.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/processfactory.hxx>
//........................................................................
@@ -183,18 +184,11 @@ namespace svxform
return OUString( "org.openoffice.comp.svx.LegacyFormController" );
}
- //--------------------------------------------------------------------
::sal_Bool SAL_CALL LegacyFormController::supportsService( const OUString& _serviceName ) throw (RuntimeException)
{
- Sequence< OUString > aServices( getSupportedServiceNames() );
- const OUString* pServices = aServices.getConstArray();
- for ( sal_Int32 i = 0; i < aServices.getLength(); ++i, ++pServices )
- if( pServices->equals( _serviceName ) )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, _serviceName);
}
- //--------------------------------------------------------------------
Sequence< OUString > SAL_CALL LegacyFormController::getSupportedServiceNames( ) throw (RuntimeException)
{
Sequence< OUString > aServices(2);
@@ -203,11 +197,8 @@ namespace svxform
return aServices;
}
-//........................................................................
} // namespace svxform
-//........................................................................
-//------------------------------------------------------------------
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
LegacyFormController_NewInstance_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _rxORB )
{