diff options
author | David Ostrovsky <david@ostrovsky.org> | 2013-11-26 15:05:51 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-12-05 05:31:43 -0600 |
commit | 130833f80e89774269108cf30b2d1155a00354ce (patch) | |
tree | 245267c3cd6664f6afebb7abb15906a4f1837b76 /vcl | |
parent | 059cc67245a4f0a62589a0c877aea85e8859c435 (diff) |
fdo#39956 Delete JAB
JAB has been discontinued in favor of the native IA2 bridge.
Change-Id: I88461f73c620507d3e97b077ea2abdd2229322e1
Reviewed-on: https://gerrit.libreoffice.org/6819
Reviewed-by: David Ostrovsky <David.Ostrovsky@gmx.de>
Tested-by: David Ostrovsky <David.Ostrovsky@gmx.de>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/pch/precompiled_vcl.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/svdata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/svids.hrc | 10 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 3 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 10 | ||||
-rw-r--r-- | vcl/source/app/svdata.cxx | 255 | ||||
-rw-r--r-- | vcl/source/src/stdtext.src | 50 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 4 |
8 files changed, 28 insertions, 307 deletions
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index f1eb6530a497..263a40a67032 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -18,7 +18,6 @@ #include "basegfx/polygon/b2dpolygon.hxx" #include "basegfx/polygon/b2dpolygontools.hxx" #include "basegfx/polygon/b2dpolypolygon.hxx" -#include "com/sun/star/accessibility/AccessBridge.hpp" #include "com/sun/star/accessibility/AccessibleRole.hpp" #include "com/sun/star/accessibility/XAccessible.hpp" #include "com/sun/star/awt/Size.hpp" diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 8648eda56d3a..3f2ad238c84d 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -367,7 +367,7 @@ extern VCL_PLUGIN_PUBLIC ImplSVData* pImplSVData; inline VCL_PLUGIN_PUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; } VCL_PLUGIN_PUBLIC void ImplHideSplash(); -bool ImplInitAccessBridge( bool bAllowCancel, bool &rCancelled ); +bool ImplInitAccessBridge(); FieldUnitStringList* ImplGetFieldUnits(); FieldUnitStringList* ImplGetCleanedFieldUnits(); diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index e9ff357db7fe..eb16740cd38e 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -198,16 +198,6 @@ #define STR_FPICKER_SAVE 10317 #define STR_FPICKER_TYPE 10318 -#define SV_ACCESSERROR_WRONG_VERSION 10500 -#define SV_ACCESSERROR_BRIDGE_MSG 10501 -#define SV_ACCESSERROR_OK_CANCEL_MSG 10502 -#define SV_ACCESSERROR_MISSING_BRIDGE 10503 -#define SV_ACCESSERROR_FAULTY_JAVA 10504 -#define SV_ACCESSERROR_JAVA_MSG 10505 -#define SV_ACCESSERROR_MISSING_JAVA 10506 -#define SV_ACCESSERROR_JAVA_NOT_CONFIGURED 10507 -#define SV_ACCESSERROR_JAVA_DISABLED 10508 -#define SV_ACCESSERROR_TURNAROUND_MSG 10509 #define SV_ACCESSERROR_NO_FONTS 10510 #define SV_SHORTCUT_HELP 10600 diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 4995e6d0570f..8f2d0c17f90f 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -1178,8 +1178,7 @@ void MiscSettings::SetEnableATToolSupport( sal_Bool bEnable ) { if ( bEnable != mpData->mnEnableATT ) { - bool bDummy; - if( bEnable && !ImplInitAccessBridge(false, bDummy) ) + if( bEnable && !ImplInitAccessBridge() ) return; HKEY hkey; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 987db604dce2..4474e2066cc8 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1614,17 +1614,15 @@ void Application::AddToRecentDocumentList(const OUString& rFileUrl, const OUStri pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType, rDocumentService); } -bool InitAccessBridge( bool bShowCancel, bool &rCancelled ) +bool InitAccessBridge() { -// Disable Java bridge on UNIX +// Disable MSAA bridge on UNIX #if defined UNX - (void) bShowCancel; // unused - (void) rCancelled; // unused return true; #else - bool bRet = ImplInitAccessBridge( bShowCancel, rCancelled ); + bool bRet = ImplInitAccessBridge(); - if( !bRet && bShowCancel && !rCancelled ) + if( !bRet ) { // disable accessibility if the user chooses to continue AllSettings aSettings = Application::GetSettings(); diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index aa58484fb872..500e18d90476 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -45,13 +45,7 @@ #include "salsys.hxx" #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" -#include "com/sun/star/java/MissingJavaRuntimeException.hpp" -#include "com/sun/star/java/JavaDisabledException.hpp" #include "officecfg/Office/Common.hxx" @@ -80,14 +74,6 @@ SalSystem* ImplGetSalSystem() return pSVData->mpSalSystem; } - -static OUString ReplaceJavaErrorMessages( const OUString& rString ) -{ - return rString.replaceAll("%OK", Button::GetStandardText(BUTTON_OK)). - replaceAll("%IGNORE", Button::GetStandardText(BUTTON_IGNORE)). - replaceAll("%CANCEL", Button::GetStandardText(BUTTON_CANCEL)); -} - // ======================================================================= void ImplInitSVData() @@ -301,236 +287,37 @@ com::sun::star::uno::Any AccessBridgeCurrentContext::getValueByName( const OUStr bool HasAtHook(); #endif -bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled) +bool ImplInitAccessBridge() { - rCancelled = false; - - bool bErrorMessage = true; - - // Note: - // if bAllowCancel is sal_True we were called from application startup - // where we will disable any Java errorboxes and show our own accessibility dialog if Java throws an exception - // if bAllowCancel is sal_False we were called from Tools->Options - // where we will see Java errorboxes, se we do not show our dialogs in addition to Java's - - try + ImplSVData* pSVData = ImplGetSVData(); + if( ! pSVData->mxAccessBridge.is() ) { - // No error messages when env var is set .. - static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" ); - if( pEnv && *pEnv ) - { - bErrorMessage = false; - } - - ImplSVData* pSVData = ImplGetSVData(); - if( ! pSVData->mxAccessBridge.is() ) - { - css::uno::Reference< XComponentContext > xContext(comphelper::getProcessComponentContext()); + css::uno::Reference< XComponentContext > xContext(comphelper::getProcessComponentContext()); #ifdef _WIN32 - bool bTryIAcc2 = ( officecfg::Office::Common::Misc::ExperimentalMode::get( xContext ) && - !getenv ("SAL_DISABLE_IACCESSIBLE2") ); - - if ( bTryIAcc2 ) // Windows only really - { - if (!HasAtHook() && !getenv("SAL_FORCE_IACCESSIBLE2")) - { - SAL_INFO("vcl", "Apparently no running AT -> " - "not enabling IAccessible2 integration"); - } - else - { - 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" ); -#endif - - 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 - = css::accessibility::AccessBridge::createWithToolkit( - xContext, xToolkit); - } - else - { - pSVData->mxAccessBridge - = css::accessibility::AccessBridge::createWithToolkit( - xContext, xToolkit); - } - } - - return true; - } - catch (const ::com::sun::star::java::JavaNotConfiguredException&) - { - ResMgr *pResMgr = ImplGetResMgr(); - if( bErrorMessage && bAllowCancel && pResMgr ) + if (!HasAtHook() && !getenv("SAL_DISABLE_IACCESSIBLE2")) { - OUString aTitle(ResId(SV_ACCESSERROR_JAVA_NOT_CONFIGURED, *pResMgr).toString()); - OUStringBuffer aMessage((ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr)).toString()); - - aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); - - int ret = ImplGetSalSystem()->ShowNativeMessageBox( - aTitle, - ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), - SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); - - // Do not change the setting in case the user chooses to cancel - if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) - rCancelled = true; + SAL_INFO("vcl", "Apparently no running AT -> " + "not enabling IAccessible2 integration"); } - - return false; - } - catch (const ::com::sun::star::java::JavaVMCreationFailureException&) - { - ResMgr *pResMgr = ImplGetResMgr(); - if( bErrorMessage && bAllowCancel && pResMgr ) + else { - OUString aTitle(ResId(SV_ACCESSERROR_FAULTY_JAVA, *pResMgr).toString()); - OUStringBuffer aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString()); - - aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); - - int ret = ImplGetSalSystem()->ShowNativeMessageBox( - aTitle, - ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), - SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); - - // Do not change the setting in case the user chooses to cancel - if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) - rCancelled = true; - } - - return false; - } - catch (const ::com::sun::star::java::MissingJavaRuntimeException&) - { - ResMgr *pResMgr = ImplGetResMgr(); - if( bErrorMessage && bAllowCancel && pResMgr ) - { - OUString aTitle(ResId(SV_ACCESSERROR_MISSING_JAVA, *pResMgr).toString()); - OUStringBuffer aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString()); - - aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); - - int ret = ImplGetSalSystem()->ShowNativeMessageBox( - aTitle, - ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), - SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); - - // Do not change the setting in case the user chooses to cancel - if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) - rCancelled = true; - } - - return false; - } - catch (const ::com::sun::star::java::JavaDisabledException&) - { - ResMgr *pResMgr = ImplGetResMgr(); - if( bErrorMessage && bAllowCancel && pResMgr ) - { - OUString aTitle(ResId(SV_ACCESSERROR_JAVA_DISABLED, *pResMgr).toString()); - OUStringBuffer aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString()); - - aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); - - int ret = ImplGetSalSystem()->ShowNativeMessageBox( - aTitle, - ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), - SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); - - // Do not change the setting in case the user chooses to cancel - if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) - rCancelled = true; + try { + pSVData->mxAccessBridge + = css::accessibility::MSAAService::create(xContext); + SAL_INFO("vcl", "got IAccessible2 bridge"); + return true; + } catch (css::uno::DeploymentException & e) { + SAL_WARN( + "vcl", + "got no IAccessible2 bridge" << e.Message); + return false; + } } - - return false; +#endif } - catch (const ::com::sun::star::uno::RuntimeException& e) - { - ResMgr *pResMgr = ImplGetResMgr(); - if( bErrorMessage && pResMgr ) - { - OUString aTitle; - OUStringBuffer aMessage(ResId(SV_ACCESSERROR_BRIDGE_MSG, *pResMgr).toString()); - - if( e.Message.startsWith("ClassNotFound") ) - { - aTitle = ResId(SV_ACCESSERROR_MISSING_BRIDGE, *pResMgr).toString(); - } - else if( e.Message.startsWith("NoSuchMethod") ) - { - aTitle = ResId(SV_ACCESSERROR_WRONG_VERSION, *pResMgr).toString(); - } - - if (!aTitle.isEmpty()) - { - if( bAllowCancel ) - { - // Something went wrong initializing the Java AccessBridge (on Windows) during the - // startup. Since the office will be probably unusable for a disabled user, we offer - // to terminate directly. - aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); - - int ret = ImplGetSalSystem()->ShowNativeMessageBox( - aTitle, - ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), - SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); - - // Do not change the setting in case the user chooses to cancel - if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) - rCancelled = sal_True; - } - else - { - // The user tried to activate accessibility support using Tools-Options dialog, - // so we don't offer to terminate here ! - ImplGetSalSystem()->ShowNativeMessageBox( - aTitle, - ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), - SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, true); - } - } - } - return false; - } - catch (...) - { - return false; - } + return true; } // ----------------------------------------------------------------------- diff --git a/vcl/source/src/stdtext.src b/vcl/source/src/stdtext.src index 9a169acafe06..1a33cfa6b9bb 100644 --- a/vcl/source/src/stdtext.src +++ b/vcl/source/src/stdtext.src @@ -34,56 +34,6 @@ String SV_STDTEXT_DONTWARNAGAIN Text [ en-US ] = "Do not show warning again."; }; -String SV_ACCESSERROR_WRONG_VERSION -{ - Text [ en-US ] = "Wrong Version"; -}; - -String SV_ACCESSERROR_BRIDGE_MSG -{ - Text [ en-US ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.0.3 or later version to support accessibility."; -}; - -String SV_ACCESSERROR_OK_CANCEL_MSG -{ - Text [ en-US ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION."; -}; - -String SV_ACCESSERROR_MISSING_BRIDGE -{ - Text [ en-US ] = "No Java Access Bridge"; -}; - -String SV_ACCESSERROR_FAULTY_JAVA -{ - Text [ en-US ] = "Faulty Java Installation"; -}; - -String SV_ACCESSERROR_JAVA_MSG -{ - Text [ en-US ] = "%PRODUCTNAME %PRODUCTVERSION requires Java 1.4.0_02 or later version to support accessibility."; -}; - -String SV_ACCESSERROR_MISSING_JAVA -{ - Text [ en-US ] = "No Java Installation"; -}; - -String SV_ACCESSERROR_JAVA_NOT_CONFIGURED -{ - Text [ en-US ] = "Missing Java Configuration"; -}; - -String SV_ACCESSERROR_JAVA_DISABLED -{ - Text [ en-US ] = "Java Disabled"; -}; - -String SV_ACCESSERROR_TURNAROUND_MSG -{ - Text [ en-US ] = "The Java Access Bridge could not be started."; -}; - String SV_ACCESSERROR_NO_FONTS { Text [ en-US ] = "No fonts could be found on the system."; diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index f7c30865002c..3602c83f0907 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -5503,9 +5503,7 @@ ImplHandleGetObject(HWND hWnd, LPARAM lParam, WPARAM wParam, LRESULT & nRet) // to avoid RFT interrupts regular accessibility processing if ( !pSVData->mxAccessBridge.is() ) { - bool bCancelled = false; - InitAccessBridge( false, bCancelled ); - if( bCancelled ) + if( !InitAccessBridge() ) return false; } |