diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-06-16 11:28:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-06-18 09:03:30 +0200 |
commit | 37ec4442d70339dc8ec5fb8e4ec8984420b6e14d (patch) | |
tree | 4175e83124d5fbcb79208966e29b2156093e5106 /oox/source/drawingml | |
parent | 20b8c7f38ae1c03dc0405a2da006ab6b2dbf3627 (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 'oox/source/drawingml')
-rw-r--r-- | oox/source/drawingml/chart/objectformatter.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index 44b3d3a3f0ea..24094db5234a 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -450,7 +450,8 @@ const ShapePropertyIds spnCommonPropIds = PROP_FillStyle, PROP_FillColor, PROP_FillTransparence, PROP_FillTransparenceGradientName, PROP_FillGradientName, PROP_FillBitmapName, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY, PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint, - PROP_FillHatchName, PROP_FillBackground + PROP_FillHatchName, PROP_FillBackground, + PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID }; const ShapePropertyIds spnLinearPropIds = @@ -460,7 +461,8 @@ const ShapePropertyIds spnLinearPropIds = PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, - PROP_INVALID, PROP_INVALID + PROP_INVALID, PROP_INVALID, + PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID }; const ShapePropertyIds spnFilledPropIds = @@ -491,7 +493,8 @@ const ShapePropertyIds spnFilledPropIds = PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint, PROP_HatchName, - PROP_FillBackground + PROP_FillBackground, + PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID }; /** Property info for common chart objects, to be used in ShapePropertyMap. */ |