svl/source/numbers/numfmuno.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit a4fa06be4f8cd4d2584a6f3e4c5bd02786e591ad 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 11:21:46 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> diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 4e1ffed5b21f..8743ab578b4b 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -485,6 +485,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)