summaryrefslogtreecommitdiffstats
path: root/svl/source/numbers/zformat.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/numbers/zformat.cxx')
-rw-r--r--svl/source/numbers/zformat.cxx34
1 files changed, 22 insertions, 12 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index c90c8479657c..6c5a08f520cc 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -5248,6 +5248,7 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords,
{
aStr.append( aPrefix );
}
+ sal_Int32 nPosHaveLCID = -1;
sal_Int32 nPosInsertLCID = aStr.getLength();
sal_uInt32 nCalendarID = 0x0000000; // Excel ID of calendar used in sub-format see tdf#36038
if ( nCnt )
@@ -5327,6 +5328,10 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords,
if ( nCalendarID > 0 )
j = j+2;
break;
+ case NF_SYMBOLTYPE_CURREXT :
+ nPosHaveLCID = aStr.getLength();
+ aStr.append( rStrArray[j] );
+ break;
default:
aStr.append( rStrArray[j] );
}
@@ -5437,19 +5442,24 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords,
if ( aNatNum.GetDBNum() > 0 && nLanguageID == LANGUAGE_SYSTEM )
nLanguageID = MsLangId::getRealLanguage( aNatNum.GetLang());
}
- else if (!bSystemLanguage && nOriginalLang != LANGUAGE_DONTKNOW)
+ else if (nPosHaveLCID < 0)
{
- // Explicit locale, write only to the first subformat.
- if (n == 0)
- nLanguageID = MsLangId::getRealLanguage( nOriginalLang);
- }
- else if (bSystemLanguage && maLocale.meLanguageWithoutLocaleData != LANGUAGE_DONTKNOW)
- {
- // Explicit locale but no locale data thus assigned to system
- // locale, preserve for roundtrip, write only to the first
- // subformat.
- if (n == 0)
- nLanguageID = maLocale.meLanguageWithoutLocaleData;
+ // Do not insert a duplicated LCID that was already given with a
+ // currency format as [$R-1C09]
+ if (!bSystemLanguage && nOriginalLang != LANGUAGE_DONTKNOW)
+ {
+ // Explicit locale, write only to the first subformat.
+ if (n == 0)
+ nLanguageID = MsLangId::getRealLanguage( nOriginalLang);
+ }
+ else if (bSystemLanguage && maLocale.meLanguageWithoutLocaleData != LANGUAGE_DONTKNOW)
+ {
+ // Explicit locale but no locale data thus assigned to system
+ // locale, preserve for roundtrip, write only to the first
+ // subformat.
+ if (n == 0)
+ nLanguageID = maLocale.meLanguageWithoutLocaleData;
+ }
}
if ( nCalendarID > 0 )
{ // Add alphabet and language to calendar