From aec792c1a429bd96a172d529521247a2b3391987 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 18 Dec 2013 21:37:57 +0100 Subject: resolved fdo#51961 let "Default ..." currency entry follow selected locale Change-Id: I69b13d1009638451fa6c2bc9336cdac0bab6ec32 --- cui/source/options/optgdlg.cxx | 20 +++++++++++--------- cui/source/options/optgdlg.hxx | 3 ++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 9904688772a7..f4599e117e3a 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1025,9 +1025,9 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe // initialize user interface language selection SvtLanguageTable* pLanguageTable = new SvtLanguageTable; - const OUString aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) ); + m_sSystemDefaultString = pLanguageTable->GetString( LANGUAGE_SYSTEM ); - OUString aUILang = aStr + + OUString aUILang = m_sSystemDefaultString + " - " + pLanguageTable->GetString( Application::GetSettings().GetUILanguageTag().getLanguageType(), true ); @@ -1100,7 +1100,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable(); const NfCurrencyEntry& rCurr = SvNumberFormatter::GetCurrencyEntry( LANGUAGE_SYSTEM ); // insert SYSTEM entry - OUString aDefaultCurr = aStr + " - " + rCurr.GetBankSymbol(); + OUString aDefaultCurr = m_sSystemDefaultString + " - " + rCurr.GetBankSymbol(); m_pCurrencyLB->InsertEntry( aDefaultCurr ); // all currencies OUString aTwoSpace( " " ); @@ -1633,13 +1633,15 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox ) SupportHdl( m_pAsianSupportCB ); } - sal_uInt16 nPos; - if ( eLang == LANGUAGE_USER_SYSTEM_CONFIG ) - nPos = m_pCurrencyLB->GetEntryPos( (void*) NULL ); - else + const NfCurrencyEntry* pCurr = &SvNumberFormatter::GetCurrencyEntry( + ((eLang == LANGUAGE_USER_SYSTEM_CONFIG) ? MsLangId::getSystemLanguage() : eLang)); + sal_uInt16 nPos = m_pCurrencyLB->GetEntryPos( (void*) NULL ); + if (pCurr) { - const NfCurrencyEntry* pCurr = &SvNumberFormatter::GetCurrencyEntry( eLang ); - nPos = m_pCurrencyLB->GetEntryPos( (void*) pCurr ); + // Update the "Default ..." currency. + m_pCurrencyLB->RemoveEntry( nPos ); + OUString aDefaultCurr = m_sSystemDefaultString + " - " + pCurr->GetBankSymbol(); + nPos = m_pCurrencyLB->InsertEntry( aDefaultCurr ); } m_pCurrencyLB->SelectEntryPos( nPos ); diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index c82e0011dbe8..3b5799fda5be 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -152,7 +152,8 @@ class OfaLanguagesTabPage : public SfxTabPage sal_Bool m_bOldCtl; LanguageConfig_Impl* pLangConfig; - OUString m_sUserLocaleValue; + OUString m_sUserLocaleValue; + OUString m_sSystemDefaultString; DECL_LINK( SupportHdl, CheckBox* ) ; DECL_LINK( LocaleSettingHdl, SvxLanguageBox* ) ; -- cgit v1.2.3