resolved fdo#51961 let "Default ..." currency entry follow selected locale

Change-Id: I69b13d1009638451fa6c2bc9336cdac0bab6ec32
(cherry picked from commit aec792c1a429bd96a172d529521247a2b3391987)
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 9904688..f4599e11 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 c82e001..3b5799f 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* ) ;