summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-02 10:26:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-02 18:21:00 +0200
commit44d6c0f1e024ce2477d027b07069998eea044eb2 (patch)
tree45a85e403852322eb90d04e280cc918d8afbcc15 /cui
parenteb4806aaf3ec63ba9260a57315cc2ee442150e12 (diff)
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/+/97682 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optgdlg.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 4959c58f4bef..b9122d3d00e2 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);