summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-17 13:06:50 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-09-10 12:11:52 +0200
commit333b62f36f3cf8feff4fed7cf2e6e1439f7c1d36 (patch)
tree8498e8ea577fa6ec7b2ccc350c365f8653b95469
parenttdf#127932 fix wrong page number in print progress (diff)
downloadcore-333b62f36f3cf8feff4fed7cf2e6e1439f7c1d36.tar.gz
core-333b62f36f3cf8feff4fed7cf2e6e1439f7c1d36.zip
Always display highlighted JRE's location
...when opening the Advanced options page and after adding a new JRE via the "Add..." button, not only after highlighting another JRE line. (I suspect this broke with 1aa246a8e8c7d974ab0f7bdfa16cda36cb700e03 "weld SvxJavaOptionsPage" towards LO 6.4.) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100860 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit f7fe1e93da753d74485a13d46fe15fb198411932) Change-Id: I5f9b63e2d33a351eeef09712969b703f1e99ef7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102286 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--cui/source/options/optjava.cxx19
-rw-r--r--cui/source/options/optjava.hxx1
2 files changed, 15 insertions, 5 deletions
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 37a08f035716..36540800bb62 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <sal/log.hxx>
+#include <cassert>
#include <memory>
#include <vector>
@@ -151,11 +152,7 @@ IMPL_LINK(SvxJavaOptionsPage, CheckHdl_Impl, const row_col&, rRowCol, void)
IMPL_LINK_NOARG(SvxJavaOptionsPage, SelectHdl_Impl, weld::TreeView&, void)
{
- // set installation directory info
- OUString sLocation = m_xJavaList->get_selected_id();
- // tdf#80646 insert LTR mark after label
- OUString sInfo = m_sInstallText + u"\u200E" + sLocation;
- m_xJavaPathText->set_label(sInfo);
+ UpdateJavaPathText();
}
IMPL_LINK_NOARG(SvxJavaOptionsPage, AddHdl_Impl, weld::Button&, void)
@@ -348,6 +345,7 @@ void SvxJavaOptionsPage::LoadJREs()
if ( jfw_areEqualJavaInfo( pCmpInfo.get(), pSelectedJava.get() ) )
{
HandleCheckEntry(i);
+ UpdateJavaPathText();
break;
}
++i;
@@ -391,6 +389,16 @@ void SvxJavaOptionsPage::HandleCheckEntry(int nCheckedRow)
}
}
+void SvxJavaOptionsPage::UpdateJavaPathText()
+{
+ assert(m_xJavaList->get_selected_index() != -1);
+ // set installation directory info
+ OUString sLocation = m_xJavaList->get_selected_id();
+ // tdf#80646 insert LTR mark after label
+ OUString sInfo = m_sInstallText + u"\u200E" + sLocation;
+ m_xJavaPathText->set_label(sInfo);
+}
+
void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
{
#if HAVE_FEATURE_JAVA
@@ -433,6 +441,7 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
}
HandleCheckEntry(nPos);
+ UpdateJavaPathText();
bStartAgain = false;
}
else if ( JFW_E_NOT_RECOGNIZED == eErr )
diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx
index e5537f1e1ff7..f3cbb1e5a1df 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -102,6 +102,7 @@ private:
void LoadJREs();
void AddJRE( JavaInfo const * _pInfo );
void HandleCheckEntry(int nCheckedRow);
+ void UpdateJavaPathText();
void AddFolder( const OUString& _rFolder );
void RequestRestart( svtools::RestartReason eReason );