summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-06-15 12:23:11 +0200
committerEike Rathke <erack@redhat.com>2022-06-16 11:21:46 +0200
commita4fa06be4f8cd4d2584a6f3e4c5bd02786e591ad (patch)
treed8519152a159050cc2449a86794cee1d2c27215c /svl/source
parent79c7c66157b75cfbf2171ad2cf87542aa75bad7c (diff)
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 <erack@redhat.com>
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/numbers/numfmuno.cxx8
1 files changed, 8 insertions, 0 deletions
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)