summaryrefslogtreecommitdiff
path: root/include/oox/helper
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-07 14:43:34 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-07 18:06:03 +0200
commitf0fdee8abf7d46f9afb90e5d7c78037fff5b34b1 (patch)
tree598fcde86b4669f7eca70ff2703d93ec24f76e45 /include/oox/helper
parenteffb5781dd0414b04dda4358605519e88a8ed3ac (diff)
oox: replace redundant STATIC_ARRAY_SIZE macro with SAL_N_ELEMENTS
Change-Id: I8cf274902bb5fda9fa70ab2af9e399db82d85d1d
Diffstat (limited to 'include/oox/helper')
-rw-r--r--include/oox/helper/helper.hxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx
index a5563f40ac35..1f5942b80cb1 100644
--- a/include/oox/helper/helper.hxx
+++ b/include/oox/helper/helper.hxx
@@ -23,6 +23,7 @@
#include <algorithm>
#include <limits>
#include <boost/static_assert.hpp>
+#include <sal/macros.h>
#include <osl/endian.h>
#include <rtl/math.hxx>
#include <rtl/string.hxx>
@@ -33,19 +34,15 @@ namespace oox {
// Helper macros ==============================================================
-/** Expands to the number of elements in a STATIC data array. */
-#define STATIC_ARRAY_SIZE( array ) \
- (sizeof(array)/sizeof(*(array)))
-
/** Expands to a pointer behind the last element of a STATIC data array (like
STL end()). */
#define STATIC_ARRAY_END( array ) \
- ((array)+STATIC_ARRAY_SIZE(array))
+ ((array)+SAL_N_ELEMENTS(array))
/** Expands to the 'index'-th element of a STATIC data array, or to 'def', if
'index' is out of the array limits. */
#define STATIC_ARRAY_SELECT( array, index, def ) \
- ((static_cast<size_t>(index) < STATIC_ARRAY_SIZE(array)) ? ((array)[static_cast<size_t>(index)]) : (def))
+ ((static_cast<size_t>(index) < SAL_N_ELEMENTS(array)) ? ((array)[static_cast<size_t>(index)]) : (def))
/** Expands to a temporary OString, created from a literal(!) character
array. */