diff options
author | Frank Schönheit <fs@openoffice.org> | 2001-09-05 11:05:22 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2001-09-05 11:05:22 +0000 |
commit | d6fc444e5238836efc662bb79217fbf30614c5d6 (patch) | |
tree | a3a6ff3d0f4520a507695e8a62bc799fdcf43b10 /toolkit/source/controls | |
parent | bad02098f6d0c9f62d609dee9426cb31170a31ea (diff) |
#91833# corrected calculation of default currency symbol
Diffstat (limited to 'toolkit/source/controls')
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 88b413d175db..12d4be5f50bb 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unocontrolmodel.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: fs $ $Date: 2001-08-22 10:05:07 $ + * last change: $Author: fs $ $Date: 2001-09-05 12:05:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -425,19 +425,35 @@ void UnoControlModel::ImplPropertyChanged( sal_uInt16 nPropId ) aLocale.Country = sDefaultCurrency.copy( nSepPos + 1 ); LocaleDataWrapper aLocaleInfo( ::comphelper::getProcessServiceFactory(), aLocale ); + if ( !sBankSymbol.getLength() ) + sBankSymbol = aLocaleInfo.getCurrBankSymbol(); - ::rtl::OUString sCurrencySymbol = aLocaleInfo.getCurrSymbol(); // look for the currency entry (for this language) which has the given bank symbol Sequence< Currency > aAllCurrencies = aLocaleInfo.getAllCurrencies(); const Currency* pAllCurrencies = aAllCurrencies.getConstArray(); const Currency* pAllCurrenciesEnd = pAllCurrencies + aAllCurrencies.getLength(); - for ( ;pAllCurrencies != pAllCurrenciesEnd; ++pAllCurrencies ) - if ( pAllCurrencies->BankSymbol == sBankSymbol ) + + ::rtl::OUString sCurrencySymbol = aLocaleInfo.getCurrSymbol(); + if ( !sBankSymbol.getLength() ) + { + DBG_ASSERT( pAllCurrencies != pAllCurrenciesEnd, "UnoControlModel::ImplGetDefaultValue: no currencies at all!" ); + if ( pAllCurrencies != pAllCurrenciesEnd ) { + sBankSymbol = pAllCurrencies->BankSymbol; sCurrencySymbol = pAllCurrencies->Symbol; - break; } - DBG_ASSERT( pAllCurrencies != pAllCurrenciesEnd, "UnoControlModel::ImplGetDefaultValue: did not find the given bank symbol!" ); + } + + if ( sBankSymbol.getLength() ) + { + for ( ;pAllCurrencies != pAllCurrenciesEnd; ++pAllCurrencies ) + if ( pAllCurrencies->BankSymbol == sBankSymbol ) + { + sCurrencySymbol = pAllCurrencies->Symbol; + break; + } + DBG_ASSERT( pAllCurrencies != pAllCurrenciesEnd, "UnoControlModel::ImplGetDefaultValue: did not find the given bank symbol!" ); + } aDefault <<= sCurrencySymbol; } |