summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-04-16 16:28:33 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-04-16 16:28:33 +0200
commitd59395617411f3dcccbcec29f0fe74985d6cf2ad (patch)
treec45322f8eef86fe4fc52e6d91d48b5f4edd1344f /sc
parent7a8146e080ef13e066d29e4bff354b732980c2a8 (diff)
SfxItemPool(..., ATTR_STARTINDEX, ATTR_ENDINDEX, aItemInfos, ...) off by one
...since d9ef61fb546af443736057557552e3a95c569c11 "API CHANGE: roll back the XStyle changes to add a new Hidden property on Style" bumped ATTR_ENDINDEX for ATTR_HIDDEN but didn't adapt aItemInfos, and mstahl suggests its better to adapt aItemInfos than to use ATTR_ENDINDEX-1 in the SfxItemPool ctor call. Change-Id: Iafdf595091ac300793bad1bcd87d58abba4fda6d
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/docpool.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 880f02d273d4..7027e56babac 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -19,6 +19,8 @@
#include "scitems.hxx"
+
+#include <boost/static_assert.hpp>
#include <comphelper/string.hxx>
#include <i18nutil/unicode.hxx>
#include <tools/shl.hxx>
@@ -182,8 +184,11 @@ static SfxItemInfo const aItemInfos[] =
{ SID_ATTR_PAGE_FOOTERSET, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERSET
{ SID_SCATTR_PAGE_FORMULAS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FORMULAS
{ SID_SCATTR_PAGE_NULLVALS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_NULLVALS
- { SID_SCATTR_PAGE_SCALETO, SFX_ITEM_POOLABLE } // ATTR_PAGE_SCALETO
+ { SID_SCATTR_PAGE_SCALETO, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SCALETO
+ { 0, SFX_ITEM_POOLABLE } // ATTR_HIDDEN
};
+BOOST_STATIC_ASSERT(
+ SAL_N_ELEMENTS(aItemInfos) == ATTR_ENDINDEX - ATTR_STARTINDEX + 1);
ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool)