summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-08-11 00:34:54 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-08-11 20:16:58 +0000
commit553f61ccf4cd9ea062c40ccd6de86b76b5497aeb (patch)
treeedfeaaea3fbcb82a271ed271902f60ed28a6cf53
parent282e9a69c92d4c616e3e8f71ffe1149e19ae1655 (diff)
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 (cherry picked from commit a97e6990435bbc47be4a4f6f349404f438e2c315) Reviewed-on: https://gerrit.libreoffice.org/28040 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index ea8bacfd79b7..524892f1ed88 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -2691,6 +2691,15 @@ bool ScXMLImport::IsCurrencySymbol(const sal_Int32 nNumberFormat, const OUString
{
if (sCurrentCurrency.equals(sTemp))
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.
if (SvNumberFormatter::GetLegacyOnlyCurrencyEntry( sCurrentCurrency, sBankSymbol) != nullptr)
return true;