diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-16 08:28:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-16 10:42:01 +0200 |
commit | 0973e1f4e727a3204c843398bcb0e6a411b1a02d (patch) | |
tree | 954d190ad385f5bb9a3ab2d763403468f0f66b62 /reportdesign/source | |
parent | 914f6385d98f8c898102c971a4d5b0eb9f075ef0 (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 'reportdesign/source')
-rw-r--r-- | reportdesign/source/ui/dlg/GroupsSorting.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index abf80c764880..afd90c6d54be 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -231,7 +231,7 @@ uno::Sequence<uno::Any> OFieldExpressionControl::fillSelectedGroups() sal_Int32 nCount = xGroups->getCount(); if ( nCount >= 1 ) { - for( long nIndex=FirstSelectedRow(); nIndex >= 0 ; nIndex=NextSelectedRow() ) + for( long nIndex=FirstSelectedRow(); nIndex != SFX_ENDOFSELECTION; nIndex=NextSelectedRow() ) { try { @@ -701,7 +701,7 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt) { bool bEnable = false; long nIndex = FirstSelectedRow(); - while( nIndex >= 0 && !bEnable ) + while( nIndex != SFX_ENDOFSELECTION && !bEnable ) { if ( m_aGroupPositions[nIndex] != NO_GROUP ) bEnable = true; @@ -734,7 +734,7 @@ void OFieldExpressionControl::DeleteRows() DeactivateCell(); } long nIndex = FirstSelectedRow(); - if (nIndex == -1) + if (nIndex == SFX_ENDOFSELECTION) { nIndex = GetCurRow(); } |