summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx16
-rw-r--r--jvmfwk/source/fwkutil.cxx22
2 files changed, 18 insertions, 20 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 75c34129a4c7..832616f42e6c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -364,6 +364,12 @@ void AsynchReader::execute()
}
}
+static bool isEnvVarSetToOne(const OUString &aVar)
+{
+ OUString aValue;
+ getBootstrap()->getFrom(aVar, aValue);
+ return aValue == "1";
+}
bool getJavaProps(const OUString & exePath,
#ifdef JVM_ONE_PATH_CHECK
@@ -393,8 +399,7 @@ bool getJavaProps(const OUString & exePath,
//If the bootstrap variable is "1" then we pass the argument
//"noaccessibility" to JREProperties.class. This will prevent
//that it calls java.awt.Toolkit.getDefaultToolkit();
- OUString sValue;
- getBootstrap()->getFrom("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY", sValue);
+ bool bNoAccessibility = isEnvVarSetToOne("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY");
//prepare the arguments
sal_Int32 cArgs = 3;
@@ -404,8 +409,13 @@ bool getJavaProps(const OUString & exePath,
OUString arg4 = "noaccessibility";
rtl_uString *args[4] = {arg1.pData, arg2.pData, arg3.pData};
+#ifdef UNX
+ // Java is no longer required for a11y - we use atk directly.
+ bNoAccessibility = !isEnvVarSetToOne("JFW_PLUGIN_FORCE_ACCESSIBILITY");
+#endif
+
// Only add the fourth param if the bootstrap parameter is set.
- if (sValue.equals(OUString::number( 1)))
+ if (bNoAccessibility)
{
args[3] = arg4.pData;
cArgs = 4;
diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx
index 299869526d09..993ddb3cf729 100644
--- a/jvmfwk/source/fwkutil.cxx
+++ b/jvmfwk/source/fwkutil.cxx
@@ -56,9 +56,8 @@ namespace jfw
bool isAccessibilitySupportDesired()
{
OUString sValue;
- if ((sal_True == ::rtl::Bootstrap::get(
- OUString("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY"), sValue)) && sValue == "1"
- )
+ if (::rtl::Bootstrap::get( "JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY", sValue) &&
+ sValue == "1" )
return false;
bool retVal = false;
@@ -103,24 +102,13 @@ bool isAccessibilitySupportDesired()
RegCloseKey(hKey);
#elif defined UNX
- char buf[16];
- // use 2 shells to suppress the eventual "gcontool-2 not found" message
- // of the shell trying to execute the command
- FILE* fp = popen( "/bin/sh 2>/dev/null -c \"gconftool-2 -g /desktop/gnome/interface/accessibility\"", "r" );
- if( fp )
- {
- if( fgets( buf, sizeof(buf), fp ) )
- {
- int nCompare = strncasecmp( buf, "true", 4 );
- retVal = (nCompare == 0 ? true : false);
- }
- pclose( fp );
- }
+ // Java is no longer required for a11y - we use atk directly.
+ retVal = ::rtl::Bootstrap::get( "JFW_PLUGIN_FORCE_ACCESSIBILITY", sValue) && sValue == "1";
#endif
+
return retVal;
}
-
rtl::ByteSequence encodeBase16(const rtl::ByteSequence& rawData)
{
static const char EncodingTable[] =