svl/source/numbers/numfmuno.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit e5f403b7e6a5d2d99a01a2111224b5277beba0d5 Author: Eike Rathke <er...@redhat.com> AuthorDate: Wed Jun 15 12:23:11 2022 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Thu Jun 16 14:54:12 2022 +0200 Related: tdf#149325 tdf#52602 SvNumberFormatsObj::addNew accept differing ... resulting format code of an existing format as not attempting to add a duplicate. It makes no sense to insist on strictness if the client can't know the rules.. Change-Id: I0c8ca215984bf84487036ccf2b570128b1694d54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135898 Tested-by: Jenkins Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit d19083198f96c75e80904aaa26066e91c9eeacba) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135979 diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 4c3d4abda553..b1e9adef8fc7 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -484,6 +484,14 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNew( const OUString& aFormat, { throw util::MalformedNumberFormatException(); // Invalid Format } + else if (aFormStr != aFormat) + { + // The format exists but with a different format code string, and if it + // was only uppercase vs lowercase keywords; but also syntax extensions + // are possible like resulting embedded LCIDs and what not the client + // doesn't know about. Silently accept instead of throwing an error. + nRet = nKey; + } else throw uno::RuntimeException(); // Other error (e.g. already added)