summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-11-03 15:51:34 +0100
committerStephan Bergmann <sbergman@redhat.com>2021-11-03 18:17:51 +0100
commit8d95452f66c01187c4b05a30061300125042cf46 (patch)
treeeb9400b337a1c5f823dd9e144dfdc890ad70ab5e /svx
parent95e7a57df68c9d631bfce0460b44b9ed966cd5bd (diff)
Avoid false -Werror=array-bounds
...with recent GCC 12 trunk, > svx/source/unodraw/unoprov.cxx:904:28: error: array subscript 25 is above array bounds of ‘const SfxItemPropertyMapEntry* [25]’ [-Werror=array-bounds] > 904 | if(!aMapArr[nPropertyId]) { > | ~~~~~~~~~~~~~~~~~~~^ > In file included from svx/source/unodraw/shapeimpl.hxx:22, > from svx/source/unodraw/unoprov.cxx:45: > include/svx/unoprov.hxx:86:37: note: while referencing ‘SvxUnoPropertyMapProvider::aMapArr’ > 86 | SfxItemPropertyMapEntry const * aMapArr[SVXMAP_END]; > | ^~~~~~~ Change-Id: I60e5352aff0d0aed3056bc484fb1491626761051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124655 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unoprov.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index a421268cdd4a..39369d880448 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cassert>
+
#include <sal/macros.h>
#include <com/sun/star/table/XTable.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
@@ -900,7 +904,7 @@ SvxUnoPropertyMapProvider::~SvxUnoPropertyMapProvider()
const SfxItemPropertyMapEntry* SvxUnoPropertyMapProvider::GetMap(sal_uInt16 nPropertyId)
{
- DBG_ASSERT(nPropertyId < SVXMAP_END, "Id ?" );
+ assert(nPropertyId < SVXMAP_END);
if(!aMapArr[nPropertyId]) {
switch(nPropertyId) {
case SVXMAP_SHAPE: aMapArr[SVXMAP_SHAPE]=ImplGetSvxShapePropertyMap(); break;