diff options
-rw-r--r-- | include/svl/zforlist.hxx | 4 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 18 |
2 files changed, 19 insertions, 3 deletions
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index 9836f5047542..251b8212a3cd 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -323,6 +323,7 @@ public: NfCurrencyEntry( const css::i18n::Currency & rCurr, const LocaleDataWrapper& rLocaleData, LanguageType eLang ); + NfCurrencyEntry( const NfCurrencyEntry& ) = default; /// Symbols and language identical bool operator==( const NfCurrencyEntry& r ) const; @@ -334,6 +335,9 @@ public: sal_uInt16 GetNegativeFormat() const { return nNegativeFormat; } sal_uInt16 GetDigits() const { return nDigits; } + /** Only to resolve system locale for currency list. */ + void SetLanguage( LanguageType nLang ) { eLanguage = nLang; } + /** [$DM-407] (bBank==false) or [$DEM] (bBank==true) is returned. If bBank==false and bWithoutExtension==true only [$DM] */ diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 6dd380b31883..1c816097b3ff 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -3642,11 +3642,23 @@ namespace if (rItem.getLength() > sLongestString.getLength()) sLongestString = rItem; - const NfCurrencyEntry& aCurrencyEntry = rCurrencyTable[ rCurrencyIndex ]; - bIsSymbol = nPos >= nLen; - sal_uInt16 nDefaultFormat = aFormatter.GetCurrencyFormatStrings( aStringsDtor, aCurrencyEntry, bIsSymbol ); + sal_uInt16 nDefaultFormat; + const NfCurrencyEntry& rCurrencyEntry = rCurrencyTable[ rCurrencyIndex ]; + if (rCurrencyIndex == 0) + { + // Stored with system locale, but we want the resolved + // full LCID format string. For example + // "[$$-409]#,##0.00" instead of "[$$]#,##0.00". + NfCurrencyEntry aCurrencyEntry( rCurrencyEntry); + aCurrencyEntry.SetLanguage( LanguageTag( aCurrencyEntry.GetLanguage()).getLanguageType()); + nDefaultFormat = aFormatter.GetCurrencyFormatStrings( aStringsDtor, aCurrencyEntry, bIsSymbol); + } + else + { + nDefaultFormat = aFormatter.GetCurrencyFormatStrings( aStringsDtor, rCurrencyEntry, bIsSymbol); + } const OUString& rFormatStr = aStringsDtor[ nDefaultFormat ]; m_aFormatEntries.push_back( rFormatStr ); if( rFormatStr == m_rSelectedFormat ) |