diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-26 13:11:42 -0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-30 18:17:11 +0100 |
commit | 2b01553fa5982ed50fd37f346a150d1aac8dcd6f (patch) | |
tree | 1daf00bf4b69950c5b75e98571d2b839d5b83327 /svx/source/accessibility | |
parent | 9ab844c7fa907e2d1119a316c695198ef888a059 (diff) |
fdo#54938: Convert svx to use cppu::supportsService
Change-Id: I3ab178924cb1c4240511f08625f244dac54e3913
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx/source/accessibility')
-rw-r--r-- | svx/source/accessibility/AccessibleFrameSelector.cxx | 25 | ||||
-rw-r--r-- | svx/source/accessibility/GraphCtlAccessibleContext.cxx | 21 | ||||
-rw-r--r-- | svx/source/accessibility/svxrectctaccessiblecontext.cxx | 15 |
3 files changed, 8 insertions, 53 deletions
diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx index 1a21e7cfd5dd..64dd1d1b497d 100644 --- a/svx/source/accessibility/AccessibleFrameSelector.cxx +++ b/svx/source/accessibility/AccessibleFrameSelector.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/awt/FocusChangeReason.hpp> +#include <cppuhelper/supportsservice.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <osl/mutex.hxx> @@ -552,50 +553,34 @@ void AccFrameSelector::removeAccessibleEventListener( const Reference< XAccessib } } -// ---------------------------------------------------------------------------- - OUString AccFrameSelector::getImplementationName( ) throw (RuntimeException) { return OUString("AccFrameSelector"); } -// ---------------------------------------------------------------------------- - -const sal_Char sAccessible[] = "Accessible"; -const sal_Char sAccessibleContext[] = "AccessibleContext"; -const sal_Char sAccessibleComponent[] = "AccessibleComponent"; - sal_Bool AccFrameSelector::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return rServiceName.equalsAsciiL( sAccessible , sizeof(sAccessible )-1 ) || - rServiceName.equalsAsciiL( sAccessibleContext , sizeof(sAccessibleContext )-1 ) || - rServiceName.equalsAsciiL( sAccessibleComponent, sizeof(sAccessibleComponent)-1 ); + return cppu::supportsService(this, rServiceName); } -// ---------------------------------------------------------------------------- - Sequence< OUString > AccFrameSelector::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< OUString > aRet(3); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( sAccessible ); - pArray[1] = OUString( sAccessibleContext ); - pArray[2] = OUString( sAccessibleComponent ); + pArray[0] = OUString( "Accessible" ); + pArray[1] = OUString( "AccessibleContext" ); + pArray[2] = OUString( "AccessibleComponent" ); return aRet; } -// ---------------------------------------------------------------------------- - void AccFrameSelector::IsValid() throw (RuntimeException) { if(!mpFrameSel) throw RuntimeException(); } -// ---------------------------------------------------------------------------- - void AccFrameSelector::NotifyFocusListeners(sal_Bool bGetFocus) { SolarMutexGuard aGuard; diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index df0d9f8104a7..0b230a6faf61 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/beans/PropertyChangeEvent.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <unotools/accessiblestatesethelper.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> @@ -555,33 +556,16 @@ sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getBackground (void) //===== XServiceInfo ======================================================== - OUString SAL_CALL SvxGraphCtrlAccessibleContext::getImplementationName( void ) throw( RuntimeException ) { return OUString( "com.sun.star.comp.ui.SvxGraphCtrlAccessibleContext" ); } -//----------------------------------------------------------------------------- - sal_Bool SAL_CALL SvxGraphCtrlAccessibleContext::supportsService( const OUString& sServiceName ) throw( RuntimeException ) { - ::SolarMutexGuard aGuard; - // Iterate over all supported service names and return true if on of them - // matches the given name. - Sequence< OUString > aSupportedServices( getSupportedServiceNames() ); - int nLenght = aSupportedServices.getLength(); - - for( int i = 0 ; i < nLenght ; ++i ) - { - if( sServiceName == aSupportedServices[ i ] ) - return sal_True; - } - - return sal_False; + return cppu::supportsService(this, sServiceName); } -//----------------------------------------------------------------------------- - Sequence< OUString > SAL_CALL SvxGraphCtrlAccessibleContext::getSupportedServiceNames( void ) throw( RuntimeException ) { Sequence< OUString > aSNs( 3 ); @@ -594,7 +578,6 @@ Sequence< OUString > SAL_CALL SvxGraphCtrlAccessibleContext::getSupportedService } //===== XTypeProvider ======================================================= - Sequence<sal_Int8> SAL_CALL SvxGraphCtrlAccessibleContext::getImplementationId( void ) throw( RuntimeException ) { ::SolarMutexGuard aGuard; diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index da7239296197..66812ff0ac68 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -1019,7 +1019,6 @@ Any SAL_CALL SvxRectCtlChildAccessibleContext::getMinimumValue() throw( RuntimeE } //===== XServiceInfo ======================================================== - OUString SAL_CALL SvxRectCtlChildAccessibleContext::getImplementationName( void ) throw( RuntimeException ) { return OUString( "com.sun.star.comp.ui.SvxRectCtlChildAccessibleContext" ); @@ -1027,18 +1026,7 @@ OUString SAL_CALL SvxRectCtlChildAccessibleContext::getImplementationName( void sal_Bool SAL_CALL SvxRectCtlChildAccessibleContext::supportsService( const OUString& sServiceName ) throw( RuntimeException ) { - // Iterate over all supported service names and return true if on of them - // matches the given name. - ::osl::MutexGuard aGuard( maMutex ); - Sequence< OUString > aSupportedServices ( getSupportedServiceNames() ); - int nLength = aSupportedServices.getLength(); - for( int i = 0 ; i < nLength; ++i ) - { - if( sServiceName == aSupportedServices[ i ] ) - return sal_True; - } - - return sal_False; + return cppu::supportsService(this, sServiceName); } Sequence< OUString > SAL_CALL SvxRectCtlChildAccessibleContext::getSupportedServiceNames( void ) throw( RuntimeException ) @@ -1048,7 +1036,6 @@ Sequence< OUString > SAL_CALL SvxRectCtlChildAccessibleContext::getSupportedServ } //===== XTypeProvider ======================================================= - Sequence< sal_Int8 > SAL_CALL SvxRectCtlChildAccessibleContext::getImplementationId( void ) throw( RuntimeException ) { static OImplementationId* pId = 0; |