summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-12-06 16:36:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-01-31 09:12:14 +0100
commitbb9833594b031c6d0ec91422f85968c4b1f2f8bc (patch)
tree0089b8a02fef0debdda2266dff1f527028fd862a /sfx2
parent26a7f378fb07501c8619883793dfd5063212d631 (diff)
Adapt o3tl::span to P1872R0
..."span should have size_type, not index_type" (<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf>), as implemented by libc++ since <https://github.com/llvm/llvm-project/commit/ 1466335cf4b2854a0be1defcf279fe50772bad6f> "[libc++][P1872] span should have size_type, not index_type." All uses of index_type had been added to mitigate the previous std::span change from signed (ptrdiff_t) to unsigned (size_t) index_type, see 6ef8420fdbf8dff16de13147c5ab833bc5e01121 "Adapt o3tl::span to updated C++2a std::span". There is no easy solution to transparently support all three std::span variants currently out there (signed index_type, unsigned index_type, unsigned size_type), without causing compilation failures due to CPPUNIT_ASSERT_EQUAL with arguments of different types, or compiler warnings about mixed signed/unsigned comparisons. So rule out the oldest std::span variant (signed index_type) in configure.ac (so that o3tl::span will use its own hand-rolled code in that case) and simplify the uses of index_type to std::size_t (as had already been mentioned in 6ef8420fdbf8dff16de13147c5ab833bc5e01121). Change-Id: I6ddf424ffb7941da3f69ad66fd29ecd35f09afae Reviewed-on: https://gerrit.libreoffice.org/84652 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 8e6865188242bccb3d8aa857ddc990d72a058d3d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87757 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/dispatch.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 246a10d32ca5..1e491715339f 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -20,6 +20,7 @@
#include <config_feature_desktop.h>
#include <algorithm>
+#include <cstddef>
#include <deque>
#include <vector>
@@ -1546,7 +1547,7 @@ void SfxDispatcher::SetSlotFilter(SfxSlotFilterState nEnable,
{
#ifdef DBG_UTIL
// Check Array
- for ( o3tl::span<sal_uInt16 const>::index_type n = 1; n < pSIDs.size(); ++n )
+ for ( std::size_t n = 1; n < pSIDs.size(); ++n )
DBG_ASSERT( pSIDs[n] > pSIDs[n-1], "SetSlotFilter: SIDs not sorted" );
#endif