diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-20 22:34:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-21 09:47:37 +0100 |
commit | 5a0e780d8a4194c812f436a2362098202fcfa29e (patch) | |
tree | d908062273c5e9016387647f59f41d0a0c2eb28c /tools/source/memtools/multisel.cxx | |
parent | fc3db8f01fd2cf9265d663a8ca21bef8e78d1ecb (diff) |
always clear input page vector, but fill in extractable values
Diffstat (limited to 'tools/source/memtools/multisel.cxx')
-rw-r--r-- | tools/source/memtools/multisel.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx index 295b8376d366..93792dcf6980 100644 --- a/tools/source/memtools/multisel.cxx +++ b/tools/source/memtools/multisel.cxx @@ -1155,21 +1155,22 @@ bool StringRangeEnumerator::getRangesFromString( const OUString& i_rPageRange, std::set< sal_Int32 >* i_pPossibleValues ) { + o_rPageVector.clear(); + StringRangeEnumerator aEnum; aEnum.setMin( i_nMinNumber ); aEnum.setMax( i_nMaxNumber ); aEnum.setLogicalOffset( i_nLogicalOffset ); bool bRes = aEnum.setRange( i_rPageRange ); - if( bRes ) + + //Even if the input range wasn't completely valid, return what ranges could + //be extracted from the input. + o_rPageVector.reserve( aEnum.size() ); + for( StringRangeEnumerator::Iterator it = aEnum.begin( i_pPossibleValues ); + it != aEnum.end( i_pPossibleValues ); ++it ) { - o_rPageVector.clear(); - o_rPageVector.reserve( aEnum.size() ); - for( StringRangeEnumerator::Iterator it = aEnum.begin( i_pPossibleValues ); - it != aEnum.end( i_pPossibleValues ); ++it ) - { - o_rPageVector.push_back( *it ); - } + o_rPageVector.push_back( *it ); } return bRes; |