tools/source/memtools/multisel.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
New commits: commit 86a939d5fd93173949447337738fa0625803ec92 Author: Mike Kaganski <[email protected]> Date: Mon Dec 25 03:37:45 2017 +0300 tdf#114684: don't print pages for ranges completely outside ... ... of possible pages range. Change-Id: Ibe50f116aecdad8c7cba7f9844bc04c15716d127 Reviewed-on: https://gerrit.libreoffice.org/47052 Tested-by: Jenkins <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx index dfd2fcfaceb5..ae26b2e3cf38 100644 --- a/tools/source/memtools/multisel.cxx +++ b/tools/source/memtools/multisel.cxx @@ -553,6 +553,10 @@ bool StringRangeEnumerator::insertRange( sal_Int32 i_nFirst, sal_Int32 i_nLast, bool bSuccess = true; if( bSequence ) { + // Check if the range is completely outside of possible pages range + if ((i_nFirst < mnMin && i_nLast < mnMin) || + (i_nFirst > mnMax && i_nLast > mnMax)) + return false; if( i_nFirst < mnMin ) i_nFirst = mnMin; if( i_nFirst > mnMax ) @@ -640,12 +644,18 @@ bool StringRangeEnumerator::setRange( const OUString& i_rNewRange ) { bSequence = true; if( aNumbers.empty() ) - aNumbers.push_back( mnMin ); + { + // push out-of-range small value, to exclude ranges totally outside of possible range + aNumbers.push_back( mnMin-1 ); + } } else if( *pInput == ',' || *pInput == ';' ) { if( bSequence && !aNumbers.empty() ) - aNumbers.push_back( mnMax ); + { + // push out-of-range large value, to exclude ranges totally outside of possible range + aNumbers.push_back( mnMax+1 ); + } insertJoinedRanges( aNumbers ); aNumbers.clear(); @@ -659,7 +669,10 @@ bool StringRangeEnumerator::setRange( const OUString& i_rNewRange ) } // insert last entries if( bSequence && !aNumbers.empty() ) - aNumbers.push_back( mnMax ); + { + // push out-of-range large value, to exclude ranges totally outside of possible range + aNumbers.push_back( mnMax+1 ); + } insertJoinedRanges( aNumbers ); return true; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
