diff options
-rw-r--r-- | offapi/com/sun/star/accessibility/MSAAService.idl | 10 | ||||
-rw-r--r-- | offapi/com/sun/star/accessibility/XMSAAService.idl | 5 | ||||
-rw-r--r-- | vcl/source/app/svdata.cxx | 17 | ||||
-rw-r--r-- | winaccessibility/source/service/msaaservice_impl.cxx | 31 |
4 files changed, 19 insertions, 44 deletions
diff --git a/offapi/com/sun/star/accessibility/MSAAService.idl b/offapi/com/sun/star/accessibility/MSAAService.idl index 3e8840af6ff6..f71854b86e6c 100644 --- a/offapi/com/sun/star/accessibility/MSAAService.idl +++ b/offapi/com/sun/star/accessibility/MSAAService.idl @@ -22,17 +22,11 @@ #ifndef __com_sun_star_accessibility_Accessible_idl__ #define __com_sun_star_accessibility_Accessible_idl__ -#include <com/sun/star/uno/XInterface.idl> -#include <com/sun/star/lang/XInitialization.idl> -#include "XMSAAService.idl" +#include <com/sun/star/accessibility/XMSAAService.idl> module com { module sun { module star { module accessibility { -service MSAAService -{ - interface XMSAAService; - interface com::sun::star::lang::XInitialization; -}; +service MSAAService: XMSAAService; }; }; }; }; diff --git a/offapi/com/sun/star/accessibility/XMSAAService.idl b/offapi/com/sun/star/accessibility/XMSAAService.idl index 3b9773e129b6..d091dec06468 100644 --- a/offapi/com/sun/star/accessibility/XMSAAService.idl +++ b/offapi/com/sun/star/accessibility/XMSAAService.idl @@ -22,15 +22,14 @@ #ifndef __com_sun_star_accessibility_XMSAASERVICE_idl__ #define __com_sun_star_accessibility_XMSAASERVICE_idl__ -#ifndef __com_sun_star_uno_XInterface_idl__ -#include <com/sun/star/uno/XInterface.idl> +#include <com/sun/star/lang/XComponent.idl> #endif module com { module sun { module star { module accessibility { /** The interface must be implemented for a server that can support MSAA com objects and send win32 accessible events */ -interface XMSAAService : ::com::sun::star::uno::XInterface +interface XMSAAService : ::com::sun::star::lang::XComponent { /** Return com object pointer. diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index cb24f027108f..97116d47f9d2 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -46,6 +46,7 @@ #include "svids.hrc" #include "com/sun/star/accessibility/AccessBridge.hpp" +#include "com/sun/star/accessibility/MSAAService.hpp" #include "com/sun/star/awt/XExtendedToolkit.hpp" #include "com/sun/star/java/JavaNotConfiguredException.hpp" #include "com/sun/star/java/JavaVMCreationFailureException.hpp" @@ -328,11 +329,17 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled) if ( bTryIAcc2 ) // Windows only really { - // FIXME: convert to service ... pSVData->mxAccessBridge = css::accessibility::MSAAService::create( xContext ); - pSVData->mxAccessBridge = Reference< XComponent >( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.accessibility.MSAAService", xContext ), UNO_QUERY ); - - SAL_INFO( "vcl", "IAccessible2 bridge is: " << (int)(pSVData->mxAccessBridge.is()) ); - return pSVData->mxAccessBridge.is(); + try { + pSVData->mxAccessBridge + = css::accessibility::MSAAService::create(xContext); + SAL_INFO("vcl", "got IAccessible2 bridge"); + return true; + } catch (css::uno::DeploymentException & e) { + SAL_INFO( + "vcl", + "got no IAccessible2 bridge, \"" << e.Message + << "\", falling back to java"); + } } else SAL_INFO( "vcl", "IAccessible2 disabled, falling back to java" ); diff --git a/winaccessibility/source/service/msaaservice_impl.cxx b/winaccessibility/source/service/msaaservice_impl.cxx index ff3b017fb4cd..578139b011e0 100644 --- a/winaccessibility/source/service/msaaservice_impl.cxx +++ b/winaccessibility/source/service/msaaservice_impl.cxx @@ -18,13 +18,11 @@ */ #include <rtl/ref.hxx> -#include <cppuhelper/implbase4.hxx> +#include <cppuhelper/implbase2.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implementationentry.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/accessibility/XMSAAService.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> @@ -60,21 +58,16 @@ static OUString getImplementationName_MSAAServiceImpl() return OUString( "com.sun.star.accessibility.my_sc_implementation.MSAAService" ); } -class MSAAServiceImpl : public ::cppu::WeakImplHelper4< - XMSAAService, lang::XServiceInfo, - lang::XInitialization, lang::XComponent > +class MSAAServiceImpl : public ::cppu::WeakImplHelper2< + XMSAAService, lang::XServiceInfo > { private: rtl::Reference<AccTopWindowListener> m_pTopWindowListener; - OUString m_arg; public: MSAAServiceImpl (); virtual ~MSAAServiceImpl(); - // XInitialization will be called upon createInstanceWithArguments[AndContext]() - virtual void SAL_CALL initialize( Sequence< Any > const & args ) throw (Exception); - // XComponent - as used by VCL to lifecycle manage this bridge. virtual void SAL_CALL dispose(); virtual void SAL_CALL addEventListener( const ::css::uno::Reference< ::css::lang::XEventListener >& ) { /* dummy */ } @@ -91,24 +84,6 @@ public: virtual Sequence< OUString > SAL_CALL getSupportedServiceNames(); }; -void MSAAServiceImpl::initialize( Sequence< Any > const & args ) throw (Exception) -{ - if (1 != args.getLength()) - { - throw lang::IllegalArgumentException( - OUString( RTL_CONSTASCII_USTRINGPARAM("give a string instanciating this component!") ), - (::cppu::OWeakObject *)this, // resolve to XInterface reference - 0 ); // argument pos - } - if (! (args[ 0 ] >>= m_arg)) - { - throw lang::IllegalArgumentException( - OUString( RTL_CONSTASCII_USTRINGPARAM("no string given as argument!") ), - (::cppu::OWeakObject *)this, // resolve to XInterface reference - 0 ); // argument pos - } -} - /** * Implemention of getAccObjectPtr. * @param |