always explicitly handle empty string of ranges
This commit is contained in:
@@ -1584,13 +1584,15 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
|
|||||||
rValidPagesSet.clear();
|
rValidPagesSet.clear();
|
||||||
rValidStartFrms.clear();
|
rValidStartFrms.clear();
|
||||||
|
|
||||||
rtl::OUString aPageRange = rOptions.getStringValue( "PageRange", rtl::OUString() );
|
rtl::OUString aPageRange;
|
||||||
// PageContent :
|
// PageContent :
|
||||||
// 0 -> print all pages (default if aPageRange is empty)
|
// 0 -> print all pages (default if aPageRange is empty)
|
||||||
// 1 -> print range according to PageRange
|
// 1 -> print range according to PageRange
|
||||||
// 2 -> print selection
|
// 2 -> print selection
|
||||||
const sal_Int32 nContent = rOptions.getIntValue( "PrintContent", 0 );
|
const sal_Int32 nContent = rOptions.getIntValue( "PrintContent", 0 );
|
||||||
if (0 == nContent)
|
if (nContent == 1)
|
||||||
|
aPageRange = rOptions.getStringValue( "PageRange", rtl::OUString() );
|
||||||
|
if (aPageRange.getLength() == 0) // empty string -> print all
|
||||||
{
|
{
|
||||||
// set page range to print to 'all pages'
|
// set page range to print to 'all pages'
|
||||||
aPageRange = OUString::valueOf( (sal_Int32)1 );
|
aPageRange = OUString::valueOf( (sal_Int32)1 );
|
||||||
|
@@ -191,8 +191,6 @@ public:
|
|||||||
- the string "-" means the sequence i_nMinNumber to i_nMaxNumber
|
- the string "-" means the sequence i_nMinNumber to i_nMaxNumber
|
||||||
- single number that doesn't fit in [i_nMinNumber,i_nMaxNumber] will be ignored
|
- single number that doesn't fit in [i_nMinNumber,i_nMaxNumber] will be ignored
|
||||||
- range that doesn't fit in [i_nMinNumber,i_nMaxNumber] will be adjusted
|
- range that doesn't fit in [i_nMinNumber,i_nMaxNumber] will be adjusted
|
||||||
- an empty string as input is valid and will result in the range [min,max] if given
|
|
||||||
or an empty vector, if not
|
|
||||||
*/
|
*/
|
||||||
static bool getRangesFromString( const rtl::OUString& i_rPageRange,
|
static bool getRangesFromString( const rtl::OUString& i_rPageRange,
|
||||||
std::vector< sal_Int32 >& o_rPageVector,
|
std::vector< sal_Int32 >& o_rPageVector,
|
||||||
|
@@ -831,16 +831,6 @@ bool StringRangeEnumerator::setRange( const rtl::OUString& i_rNewRange, bool i_b
|
|||||||
mnCount = 0;
|
mnCount = 0;
|
||||||
maSequence.clear();
|
maSequence.clear();
|
||||||
|
|
||||||
// we love special cases
|
|
||||||
if( i_rNewRange.getLength() == 0 )
|
|
||||||
{
|
|
||||||
if( mnMin >= 0 && mnMax >= 0 )
|
|
||||||
{
|
|
||||||
insertRange( mnMin, mnMax, mnMin != mnMax, ! i_bStrict );
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const sal_Unicode* pInput = i_rNewRange.getStr();
|
const sal_Unicode* pInput = i_rNewRange.getStr();
|
||||||
rtl::OUStringBuffer aNumberBuf( 16 );
|
rtl::OUStringBuffer aNumberBuf( 16 );
|
||||||
std::vector< sal_Int32 > aNumbers;
|
std::vector< sal_Int32 > aNumbers;
|
||||||
|
Reference in New Issue
Block a user