Kaydet (Commit) a97e6990 authored tarafından Eike Rathke's avatar Eike Rathke

recognize another release's unknown currency saved as symbol we know

This may happen when saving a currency with a changed symbol in the
current release, load it in an older release, save it there and load it
again in the newer release.

For example DKK
[$kr.-406] #.##0,00;[RED][$kr.-406] -#.##0,00
new in master/5.3 (changed symbol from 'kr' to 'kr.')
loaded and saved in earlier releases writes currency 'kr.' instead of 'DKK'
reloaded in master since there was no match as currency lead to number format
 #.##0,00 [$kr.]

Change-Id: I5c8f165a2f420d77f5a2c0921c33a57797f92526
üst 554dc4c3
...@@ -2689,6 +2689,15 @@ bool ScXMLImport::IsCurrencySymbol(const sal_Int32 nNumberFormat, const OUString ...@@ -2689,6 +2689,15 @@ bool ScXMLImport::IsCurrencySymbol(const sal_Int32 nNumberFormat, const OUString
{ {
if (sCurrentCurrency.equals(sTemp)) if (sCurrentCurrency.equals(sTemp))
return true; return true;
// A release that saved an unknown currency may have
// saved the currency symbol of the number format
// instead of an ISO code bank symbol. In another
// release we may have a match for that. In this case
// sCurrentCurrency is the ISO code obtained through
// XMLNumberFormatAttributesExportHelper::GetCellType()
// and sBankSymbol is the currency symbol.
if (sCurrentCurrency.getLength() == 3 && sBankSymbol.equals(sTemp))
return true;
// #i61657# This may be a legacy currency symbol that changed in the meantime. // #i61657# This may be a legacy currency symbol that changed in the meantime.
if (SvNumberFormatter::GetLegacyOnlyCurrencyEntry( sCurrentCurrency, sBankSymbol) != nullptr) if (SvNumberFormatter::GetLegacyOnlyCurrencyEntry( sCurrentCurrency, sBankSymbol) != nullptr)
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment