summaryrefslogtreecommitdiff
path: root/include/tools/multisel.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-16 08:28:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-16 10:42:01 +0200
commit0973e1f4e727a3204c843398bcb0e6a411b1a02d (patch)
tree954d190ad385f5bb9a3ab2d763403468f0f66b62 /include/tools/multisel.hxx
parent914f6385d98f8c898102c971a4d5b0eb9f075ef0 (diff)
follow on for tdf#116981
the previous commit 235d61890512894e27f4f81e38a325eee3c67b30, fixed just exactly the problem reported in tdf#116981. This commit fixes similar issues that may exist elsewhere. To recap, this started as a regression from commit 433fc2214c980abd82fa6240f45e634a53a3c61c (patch) sal_uIntPtr->sal_Int32 in MultiSelection Previously, MultiSelection stored it's values internally as sal_uIntPtr, but returned them as long in FirstSelected(), NextSelected(), and SFX_ENDOFSELECTION was defined to be ULONG_MAX. On 64-bit Linux, sal_uIntPtr is typedefed to sal_uInt64, and ULONG_MAX is 2^64, which means that previously, the SFX_ENDOFSELECTION value was being converted from 2^64 to -2^63 when it was returned, which was why these loop worked. So convert SFX_ENDOFSELECTION to SAL_MIN_INT32, so we get a large negative value which can never be a valid index, and which works more like it did before the regression. Also fix as many loops as I can find, to check against SFX_ENDOFSELECTION explicitly. Change-Id: I947d43dbe23a08105be3d849e33d7e774a8a19fa Reviewed-on: https://gerrit.libreoffice.org/52934 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/tools/multisel.hxx')
-rw-r--r--include/tools/multisel.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/tools/multisel.hxx b/include/tools/multisel.hxx
index adb6a998fe98..323ab4b355ee 100644
--- a/include/tools/multisel.hxx
+++ b/include/tools/multisel.hxx
@@ -26,7 +26,7 @@
#include <vector>
#include <set>
-#define SFX_ENDOFSELECTION SAL_MAX_INT32
+#define SFX_ENDOFSELECTION SAL_MIN_INT32
class SAL_WARN_UNUSED TOOLS_DLLPUBLIC MultiSelection
{