summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-06-16 11:28:05 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-06-18 09:03:30 +0200
commit37ec4442d70339dc8ec5fb8e4ec8984420b6e14d (patch)
tree4175e83124d5fbcb79208966e29b2156093e5106 /tools
parent20b8c7f38ae1c03dc0405a2da006ab6b2dbf3627 (diff)
o3tl: ensure that the initializer of enumarray contains enough elements
Currently this silently succeeds. Turns out oox already contains some too-short initializers, let's guess the missing properties are all invalid. One downside of the templated parameter pack approach in the enumarray ctor, as witnessed in vcl/win/window/salframe.cxx, is that argument types can no longer be implicitly deduced and thus need to be spelled explicitly now in certain cases. There were also three uses of enumarry with V being unsigned short (aka sal_uInt16) that started to cause narrowing conversion errors now and needed to be adapted: In editeng/source/uno/unonrule.cxx the obvious fix was to use the proper type for V. In sw/source/core/unocore/unosett.cxx with its odd mix of saL_Int16 and USHRT_MAX, lets keep things that way for now (probably awaiting later clean up) and use casts to avoid the implicit narrowing. And in sw/source/filter/ww8/wrtw8esh.cxx the ESCHER_Prop_* values, while presumably conceptionally of type sal_uInt16, are plain #defines (thus of type int), so rather than changing V to int it looked more consistent to explicitly cast the ESCHER_Prop_* vlaues to sal_uInt16. (And in tools/source/fsys/urlobj.cxx the poor loplugin:redundantfcast started to unhelpfully kick in for (only) the first argument now.) Change-Id: If06c29e673ec7e565e283c6f447889cf1f777cb7 Co-authored-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135970 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/fsys/urlobj.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 00e3207b2d3b..12a1a797fba0 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -348,6 +348,7 @@ INetURLObject::getSchemeInfo(INetProtocol eTheScheme)
static constexpr OUStringLiteral VND_CMIS = u"vnd.libreoffice.cmis";
static o3tl::enumarray<INetProtocol, SchemeInfo> const map = {
+ // [-loplugin:redundantfcast]:
SchemeInfo{
EMPTY, "", false, false, false, false, false, false, false, false},
SchemeInfo{