summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-12-18 21:37:57 +0100
committerEike Rathke <erack@redhat.com>2013-12-18 21:39:45 +0100
commit68a9ac8623b6b80544e9ab117804cc19c7794f44 (patch)
tree79f2580f61b6f6f26236bc7ba2afc9e93a401176
parent57bf54e1691691c606cd04baa60b677b9376c2ae (diff)
resolved fdo#51961 let "Default ..." currency entry follow selected locale
Change-Id: I69b13d1009638451fa6c2bc9336cdac0bab6ec32 (cherry picked from commit aec792c1a429bd96a172d529521247a2b3391987)
-rw-r--r--cui/source/options/optgdlg.cxx20
-rw-r--r--cui/source/options/optgdlg.hxx3
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* ) ;