summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 7c2738dfbff8..3cfb0e535b12 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 <config_java.h>
@@ -145,11 +146,7 @@ IMPL_LINK(SvxJavaOptionsPage, CheckHdl_Impl, const weld::TreeView::iter_col&, rR
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)
@@ -337,6 +334,7 @@ void SvxJavaOptionsPage::LoadJREs()
if ( jfw_areEqualJavaInfo( pCmpInfo.get(), pSelectedJava.get() ) )
{
HandleCheckEntry(i);
+ UpdateJavaPathText();
break;
}
++i;
@@ -375,6 +373,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
@@ -417,6 +425,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 0bfae107948f..d850986a45b0 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -98,6 +98,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 );