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

Make use of new-style AccessBridge ctor

Change-Id: I9239fb1c8b139ee2bdb27cdf55222d54e488f6d5
üst f6c8220f
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "xconnection.hxx" #include "xconnection.hxx"
#include "com/sun/star/lang/XComponent.hpp"
#include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/Reference.hxx"
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
...@@ -339,7 +340,7 @@ struct ImplSVData ...@@ -339,7 +340,7 @@ struct ImplSVData
oslThreadIdentifier mnMainThreadId; oslThreadIdentifier mnMainThreadId;
rtl::Reference< vcl::DisplayConnection > mxDisplayConnection; 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; ::vcl::SettingsConfigItem* mpSettingsConfigItem;
std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList; std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList;
boost::unordered_map< int, rtl::OUString >* mpPaperNames; boost::unordered_map< int, rtl::OUString >* mpPaperNames;
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "salsys.hxx" #include "salsys.hxx"
#include "svids.hrc" #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/awt/XExtendedToolkit.hpp"
#include "com/sun/star/java/JavaNotConfiguredException.hpp" #include "com/sun/star/java/JavaNotConfiguredException.hpp"
#include "com/sun/star/java/JavaVMCreationFailureException.hpp" #include "com/sun/star/java/JavaVMCreationFailureException.hpp"
...@@ -303,8 +303,6 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled) ...@@ -303,8 +303,6 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled)
try try
{ {
bool bSuccess = true;
// No error messages when env var is set .. // No error messages when env var is set ..
static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" ); static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
if( pEnv && *pEnv ) if( pEnv && *pEnv )
...@@ -315,45 +313,34 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled) ...@@ -315,45 +313,34 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled)
ImplSVData* pSVData = ImplGetSVData(); ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->mxAccessBridge.is() ) if( ! pSVData->mxAccessBridge.is() )
{ {
css::uno::Reference< XMultiServiceFactory > xFactory(comphelper::getProcessServiceFactory()); css::uno::Reference< XComponentContext > xContext(comphelper::getProcessComponentContext());
if( xFactory.is() )
{
css::uno::Reference< XExtendedToolkit > xToolkit =
css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
Sequence< Any > arguments(1); css::uno::Reference< XExtendedToolkit > xToolkit =
arguments[0] = makeAny(xToolkit); css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
// Disable default java error messages on startup, because they were probably unreadable // 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. // 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 .. // No need to do this when activated by Tools-Options dialog ..
if( bAllowCancel ) if( bAllowCancel )
{ {
// customize the java-not-available-interaction-handler entry within the // customize the java-not-available-interaction-handler entry within the
// current context when called at startup. // current context when called at startup.
com::sun::star::uno::ContextLayer layer( com::sun::star::uno::ContextLayer layer(
new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) ); new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) );
pSVData->mxAccessBridge = xFactory->createInstanceWithArguments( pSVData->mxAccessBridge
OUString("com.sun.star.accessibility.AccessBridge"), = css::accessibility::AccessBridge::createWithToolkit(
arguments xContext, xToolkit);
); }
} else
else {
{ pSVData->mxAccessBridge
pSVData->mxAccessBridge = xFactory->createInstanceWithArguments( = css::accessibility::AccessBridge::createWithToolkit(
OUString("com.sun.star.accessibility.AccessBridge"), xContext, xToolkit);
arguments
);
}
if( !pSVData->mxAccessBridge.is() )
bSuccess = false;
} }
} }
return bSuccess; return true;
} }
catch (const ::com::sun::star::java::JavaNotConfiguredException&) catch (const ::com::sun::star::java::JavaNotConfiguredException&)
{ {
......
...@@ -175,11 +175,10 @@ int ImplSVMain() ...@@ -175,11 +175,10 @@ int ImplSVMain()
// be some events in the AWT EventQueue, which need the SolarMutex which // be some events in the AWT EventQueue, which need the SolarMutex which
// - on the other hand - is destroyed in DeInitVCL(). So empty the queue // - on the other hand - is destroyed in DeInitVCL(). So empty the queue
// here .. // here ..
uno::Reference< lang::XComponent > xComponent(pSVData->mxAccessBridge, uno::UNO_QUERY); if( pSVData->mxAccessBridge.is() )
if( xComponent.is() )
{ {
sal_uLong nCount = Application::ReleaseSolarMutex(); sal_uLong nCount = Application::ReleaseSolarMutex();
xComponent->dispose(); pSVData->mxAccessBridge->dispose();
Application::AcquireSolarMutex(nCount); Application::AcquireSolarMutex(nCount);
pSVData->mxAccessBridge.clear(); pSVData->mxAccessBridge.clear();
} }
......
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