diff options
author | Henry Castro <hcastro@collabora.com> | 2024-02-28 15:59:40 -0400 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-29 21:40:54 +0100 |
commit | c6d9cc16dbb5fe0d05ce8ca9c4c18b989596e928 (patch) | |
tree | a6090cea5a518e4b8a383ac5d2d62f217f98b061 /svx/source | |
parent | 2f06b252e187c08ed8a5afe138aecdf5d9ab1729 (diff) |
svx: fix default locale language string
1) Open a spreadsheet
2) Format a cell with a currency. Example USD $ English (USA)
3) Open the sidebar if it's not opened already
4) Click in the currency dropdown
5) Observe: there is $ (Default)
Expected result: USD $ English (USA) Default
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: Idf7f4174557e59cb6f5ffd65c25572322a5794ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164123
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index a07a1b752d5d..4a366730b76d 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -4124,12 +4124,19 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector<OUString>& rList, { rCurrencyList.clear(); + constexpr OUString aTwoSpace = u" "_ustr; const NfCurrencyTable& rCurrencyTable = SvNumberFormatter::GetTheCurrencyTable(); sal_uInt16 nCount = rCurrencyTable.size(); sal_uInt16 nStart = 1; - OUString aString( ApplyLreOrRleEmbedding( rCurrencyTable[0].GetSymbol() ) + " " ); + LanguageTag eLangTag = Application::GetSettings().GetLanguageTag(); + OUString aString(ApplyLreOrRleEmbedding(rCurrencyTable[0].GetBankSymbol())); + aString += aTwoSpace; + aString += ApplyLreOrRleEmbedding(rCurrencyTable[0].GetSymbol()); + aString += aTwoSpace; + aString += ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(eLangTag.getLanguageType())); + aString += aTwoSpace; aString += ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(rCurrencyTable[0].GetLanguage())); rList.push_back( aString ); @@ -4143,9 +4150,7 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector<OUString>& rList, } CollatorWrapper aCollator( ::comphelper::getProcessComponentContext() ); - aCollator.loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0 ); - - static constexpr OUString aTwoSpace(u" "_ustr); + aCollator.loadDefaultCollator(eLangTag.getLocale(), 0); for( sal_uInt16 i = 1; i < nCount; ++i ) { |