From 3935a0bd3bcf747aa9bede59b045d23ab598f2d4 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 21 Oct 2020 10:23:30 +0200 Subject: Properly (un)tick Java checkbox in Java options in direct mode While the Java settings cannot be changed when the direct mode of the Java framework is used (s. Change-ID Ife017f9b5c6c6488f84201dd78b23305c67bec1b, "Gray out Java options when framework's direct mode is used"), it still makes sense to (un)tick the (grayed out) checkbox which indicates whether a JRE is used or not, which depends on whether the JRE that is set (e.g. via env variable 'UNO_JAVA_JFW_JREHOME') is usable or not. Change-Id: I13822bb7535e3f05cbc6ef83b3c82e2739c45ad6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104064 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- cui/source/options/optjava.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cui/source/options') diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 6a54ab6e0fdf..53c10ce1aa80 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -568,6 +568,10 @@ void SvxJavaOptionsPage::Reset( const SfxItemSet* /*rSet*/ ) { // direct mode disregards Java settings made here, so gray them out m_xJavaFrame->set_sensitive(false); + // check whether a usable JRE was set + std::unique_ptr pSelectedJava; + eErr = jfw_getSelectedJRE( &pSelectedJava ); + bEnabled = (eErr == JFW_E_NONE); } else if ( eErr != JFW_E_NONE ) bEnabled = false; -- cgit