cui/source/options/optgdlg.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 619cf83879143e59dc767f69394cc72a5a6a8d11
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Jul 2 10:26:38 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Jul 2 17:55:06 2020 +0200

    currency combobox doesn't have a selected entry
    
    possibly since...
    
    commit 5326d238d7f98b11886eb4be01f19db73f8eda39
    Date:   Tue Feb 4 00:14:17 2020 +0300
    
        tdf#114694: Make default value in language settings the first element
    
    Change-Id: I6a543ee6bf59d6dfcaee47252cf8008e840e47e5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97769
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index b48a0e3675f8..927840640dbf 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1482,7 +1482,8 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
 
     // Configured currency, for example, USD-en-US or EUR-de-DE, or empty for 
locale default.
     OUString sOldCurr = 
pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
-    const NfCurrencyEntry* pCurr = reinterpret_cast<const 
NfCurrencyEntry*>(m_xCurrencyLB->get_active_id().toInt64());
+    OUString sId = m_xCurrencyLB->get_active_id();
+    const NfCurrencyEntry* pCurr = sId == "default" ? nullptr : 
reinterpret_cast<const NfCurrencyEntry*>(sId.toInt64());
     OUString sNewCurr;
     if ( pCurr )
         sNewCurr = SvtSysLocaleOptions::CreateCurrencyConfigString(
@@ -1642,7 +1643,8 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
         pCurr = SvNumberFormatter::GetCurrencyEntry( aAbbrev, eLang );
     }
     // if pCurr==nullptr the SYSTEM entry is selected
-    
m_xCurrencyLB->set_active_id(OUString::number(reinterpret_cast<sal_Int64>(pCurr)));
+    OUString sId = !pCurr ? OUString("default") : 
OUString::number(reinterpret_cast<sal_Int64>(pCurr));
+    m_xCurrencyLB->set_active_id(sId);
     bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::Currency);
     m_xCurrencyLB->set_sensitive(!bReadonly);
     m_xCurrencyFT->set_sensitive(!bReadonly);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to