Kaydet (Commit) f3f4d9ec authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Simplify css.accessibility.MSAAService and corresponding XMSAAService

Change-Id: I96c69e871aa7b20cdac9751a64faa5e436f31a1f
üst 98357752
......@@ -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;
}; }; }; };
......
......@@ -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.
......
......@@ -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" );
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment