summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-03-15 15:49:55 +0100
committerEike Rathke <erack@redhat.com>2021-03-15 17:45:00 +0100
commit3e73d3475711b790cc80b9a286c5d454f3929384 (patch)
treed19045bf58c659e14fbb4757073d01c2dc3bc696 /svl
parent7246c1b4971e780be8d027de5171f42cc0749c16 (diff)
xls save: fix writing inline calendar modifiers as format code, don't
E.g. ja-JP GGGE [~gregorian]YYYY saved as OOXML ended up as [$-411]ggge\ gregorianyyyy which when reloaded became GGGE GREGoRianYYYY displaying 令和3 R033Ro03ian2021 (whatever Xcl might have done with that). Change-Id: If8a7d5b837b69c32afacc7a8d7646fedc84ab87a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112510 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zformat.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index b0dcad070dd2..8787f0977984 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -5309,6 +5309,8 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords,
}
break;
case NF_SYMBOLTYPE_CALDEL :
+ if (j + 1 >= nCnt)
+ break;
if ( rStrArray[j+1] == "gengou" )
{
nCalendarID = 0x0030000;
@@ -5325,9 +5327,10 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords,
{
nCalendarID = 0x0080000;
}
- // other calendars (see tdf#36038) not corresponding between LibO and XL
- if ( nCalendarID > 0 )
- j = j+2;
+ // Other calendars (see tdf#36038) not corresponding between LibO and XL.
+ // However, skip any calendar modifier and don't write
+ // as format code (if not as literal string).
+ j += 2;
break;
case NF_SYMBOLTYPE_CURREXT :
nPosHaveLCID = aStr.getLength();