diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-10-21 10:23:30 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2020-10-22 07:40:45 +0200 |
commit | 2976590ed9f727c24064c97d80a51e9891253119 (patch) | |
tree | 46ba14b5b70f70f4aee67ca9ee824dc4f185e0ab | |
parent | 903a5aca86b41cd6c3d814af8bdd60b6885d300b (diff) |
Gray out Java options when framework's direct mode is used
The 'javasettings_${_OS}_${_ARCH}.xml' files are only
meant to be used when the application mode of the
Java framework is used, not in direct mode.
From ure/source/README:
> You can also use the
> UNO_JAVA_JFW_JREHOME deployment variable to specify the location of a JDK/JRE
> installation. For more information on this variable, see
> http://udk.openoffice.org/common/man/spec/javavendorextension.sxw.
From that http://udk.openoffice.org/common/man/spec/javavendorextension.sxw :
> The direct mode of the framework is used within the build environment.
> Java is needed there in order to register Java UNO components with the
> regcomp tool. Direct mode means that no settings are written or read.
> That is the parameters UNO_JAVA_JFW_USER_DATA and
> UNO_JAVA_JFW_SHARED_DATA are not used.
> [...]
> Another example for using the direct mode is the SDK. The SDK uses the
> libraries from the office installation. When an SDK is configured then
> one specifies what Java is to be used. This Java shall then be used for
> all task which require Java including registration of UNO components. In
> order to override the java settings of the office the script which
> prepares the SDK environment sets these environment variables:
> UNO_JAVA_JFW_JREHOME=<file_URL_to_selected_Java>
> UNO_JAVA_JFW_ENV_CLASSPATH=true
> UNO_JAVA_JFW_VENDOR_SETTINGS=<file_URL_to_javavendors.xml_from_OOo>
> By setting UNO_JAVA_JFW_JREHOME the framework is switched into direct mode
> and the office settings are disregarded.
Therefore, gray out the Java options in the "Advanced" page in "Tools"
-> "Options" to not give the user the wrong impression that settings
made there actually have any effect when using direct mode, e.g. by
starting LibreOffice like this
UNO_JAVA_JFW_JREHOME=file:///usr/lib/jvm/java-11-openjdk-amd64/ ./instdir/program/soffice --writer
and then realizing on restart that all manually made settings
were discarded (e.g. newly added Java installation does not
show up,...).
Change-Id: Ife017f9b5c6c6488f84201dd78b23305c67bec1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104002
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r-- | cui/source/options/optjava.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 3cfb0e535b12..6a54ab6e0fdf 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -564,7 +564,12 @@ void SvxJavaOptionsPage::Reset( const SfxItemSet* /*rSet*/ ) #if HAVE_FEATURE_JAVA bool bEnabled = false; javaFrameworkError eErr = jfw_getEnabled( &bEnabled ); - if ( eErr != JFW_E_NONE ) + if (eErr == JFW_E_DIRECT_MODE) + { + // direct mode disregards Java settings made here, so gray them out + m_xJavaFrame->set_sensitive(false); + } + else if ( eErr != JFW_E_NONE ) bEnabled = false; m_xJavaEnableCB->set_active(bEnabled); EnableHdl_Impl(*m_xJavaEnableCB); |