diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-03-08 15:37:56 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-03-08 15:43:57 +0100 |
commit | c78f40a6d837a5d84bd8c2ef9e4916fa64ec58c3 (patch) | |
tree | feb03088ef15acbb3ea555d14eb8f49b7cccc042 /vcl | |
parent | f6c8220f5c14be8ebacd146d2775b4594efea043 (diff) |
Make use of new-style AccessBridge ctor
Change-Id: I9239fb1c8b139ee2bdb27cdf55222d54e488f6d5
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/svdata.hxx | 3 | ||||
-rw-r--r-- | vcl/source/app/svdata.cxx | 61 | ||||
-rw-r--r-- | vcl/source/app/svmain.cxx | 5 |
3 files changed, 28 insertions, 41 deletions
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 7f89f9fe0082..fe6b7e17a932 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -41,6 +41,7 @@ #include "xconnection.hxx" +#include "com/sun/star/lang/XComponent.hpp" #include "com/sun/star/uno/Reference.hxx" #include <boost/unordered_map.hpp> @@ -339,7 +340,7 @@ struct ImplSVData oslThreadIdentifier mnMainThreadId; rtl::Reference< vcl::DisplayConnection > mxDisplayConnection; - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxAccessBridge; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxAccessBridge; ::vcl::SettingsConfigItem* mpSettingsConfigItem; std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList; boost::unordered_map< int, rtl::OUString >* mpPaperNames; diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 8aa8d7043e43..95405290238b 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -45,7 +45,7 @@ #include "salsys.hxx" #include "svids.hrc" -#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/accessibility/AccessBridge.hpp" #include "com/sun/star/awt/XExtendedToolkit.hpp" #include "com/sun/star/java/JavaNotConfiguredException.hpp" #include "com/sun/star/java/JavaVMCreationFailureException.hpp" @@ -303,8 +303,6 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled) try { - bool bSuccess = true; - // No error messages when env var is set .. static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" ); if( pEnv && *pEnv ) @@ -315,45 +313,34 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled) ImplSVData* pSVData = ImplGetSVData(); if( ! pSVData->mxAccessBridge.is() ) { - css::uno::Reference< XMultiServiceFactory > xFactory(comphelper::getProcessServiceFactory()); - - if( xFactory.is() ) - { - css::uno::Reference< XExtendedToolkit > xToolkit = - css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); + css::uno::Reference< XComponentContext > xContext(comphelper::getProcessComponentContext()); - Sequence< Any > arguments(1); - arguments[0] = makeAny(xToolkit); + css::uno::Reference< XExtendedToolkit > xToolkit = + css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); - // Disable default java error messages on startup, because they were probably unreadable - // for a disabled user. Use native message boxes which are accessible without java support. - // No need to do this when activated by Tools-Options dialog .. - if( bAllowCancel ) - { - // customize the java-not-available-interaction-handler entry within the - // current context when called at startup. - com::sun::star::uno::ContextLayer layer( - new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) ); - - pSVData->mxAccessBridge = xFactory->createInstanceWithArguments( - OUString("com.sun.star.accessibility.AccessBridge"), - arguments - ); - } - else - { - pSVData->mxAccessBridge = xFactory->createInstanceWithArguments( - OUString("com.sun.star.accessibility.AccessBridge"), - arguments - ); - } - - if( !pSVData->mxAccessBridge.is() ) - bSuccess = false; + // Disable default java error messages on startup, because they were probably unreadable + // for a disabled user. Use native message boxes which are accessible without java support. + // No need to do this when activated by Tools-Options dialog .. + if( bAllowCancel ) + { + // customize the java-not-available-interaction-handler entry within the + // current context when called at startup. + com::sun::star::uno::ContextLayer layer( + new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) ); + + pSVData->mxAccessBridge + = css::accessibility::AccessBridge::createWithToolkit( + xContext, xToolkit); + } + else + { + pSVData->mxAccessBridge + = css::accessibility::AccessBridge::createWithToolkit( + xContext, xToolkit); } } - return bSuccess; + return true; } catch (const ::com::sun::star::java::JavaNotConfiguredException&) { diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 2f0109481ccb..303c0999d5f8 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -175,11 +175,10 @@ int ImplSVMain() // be some events in the AWT EventQueue, which need the SolarMutex which // - on the other hand - is destroyed in DeInitVCL(). So empty the queue // here .. - uno::Reference< lang::XComponent > xComponent(pSVData->mxAccessBridge, uno::UNO_QUERY); - if( xComponent.is() ) + if( pSVData->mxAccessBridge.is() ) { sal_uLong nCount = Application::ReleaseSolarMutex(); - xComponent->dispose(); + pSVData->mxAccessBridge->dispose(); Application::AcquireSolarMutex(nCount); pSVData->mxAccessBridge.clear(); } |