[Libreoffice-commits] core.git: Branch 'libreoffice-7-0-1' - cui/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 20 15:43:12 UTC 2020


 cui/source/options/optjava.cxx |   19 ++++++++++++++-----
 cui/source/options/optjava.hxx |    1 +
 2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 8edb94bdff70597b1fa776c326394b6004c81b11
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Aug 17 13:06:50 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Aug 20 17:42:40 2020 +0200

    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.)
    
    Change-Id: I5f9b63e2d33a351eeef09712969b703f1e99ef7e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100860
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit f7fe1e93da753d74485a13d46fe15fb198411932)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100798
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit 5fb474293af0b2ed2a68be6141941736a27bf34b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100800
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 0eeaec393c6d..f3c9dcfee4a8 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>
 
@@ -148,11 +149,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)
@@ -340,6 +337,7 @@ void SvxJavaOptionsPage::LoadJREs()
         if ( jfw_areEqualJavaInfo( pCmpInfo.get(), pSelectedJava.get() ) )
         {
             HandleCheckEntry(i);
+            UpdateJavaPathText();
             break;
         }
         ++i;
@@ -378,6 +376,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
@@ -420,6 +428,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 f117746ebeec..df90e2824bdc 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -99,6 +99,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 );
 


More information about the Libreoffice-commits mailing list