svl/source/numbers/zforlist.cxx | 5 ++++- xmloff/source/style/xmlnumfe.cxx | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-)
New commits: commit 68809ffde7d50a5f47afa5a1235025513762df8c Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Dec 16 11:29:56 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Dec 18 10:41:30 2022 +0000 crashtesting: assert seen with forum-mso-en4-747641.xlsx with LCID F6E0B see on export to ods input .xlsx contains a LCID of F6E0B <numFmt numFmtId="169" formatCode="_-[$£-F6E0B]* #,##0.00_-;\-[$£-F6E0B]* #,##0.00_-;_-[$£-F6E0B]* "-"??_-;_-@_-"/> Change-Id: I543164dba4cc8b1c86508a3e3e39b43900c06484 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144321 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index c43e124bbadd..cee75fc9265e 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -3991,7 +3991,10 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( bool & bFoundBank, } else { - eExtLang = LanguageType((nExtLang < 0) ? -nExtLang : nExtLang); + if (nExtLang < 0) + nExtLang = -nExtLang; + SAL_WARN_IF(nExtLang > 0xFFFF, "svl.numbers", "Out of range Lang Id: " << nExtLang << " from input string: " << OUString(rExtension)); + eExtLang = LanguageType(nExtLang & 0xFFFF); } } else diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index a2938b1d998d..01367fe12e55 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -362,7 +362,8 @@ void SvXMLNumFmtExport::WriteCurrencyElement_Impl( const OUString& rString, sal_Int32 nLang = o3tl::toInt32(rExt, 16); if ( nLang < 0 ) nLang = -nLang; - AddLanguageAttr_Impl( LanguageType(nLang) ); // adds to pAttrList + SAL_WARN_IF(nLang > 0xFFFF, "xmloff.style", "Out of range Lang Id: " << nLang << " from input string: " << OUString(rExt)); + AddLanguageAttr_Impl( LanguageType(nLang & 0xFFFF) ); // adds to pAttrList } SvXMLElementExport aElem( rExport,