diff options
-rw-r--r-- | sc/source/core/tool/rangeutl.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index 3c5014304..e80031f26 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -557,12 +557,19 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString( while( nOffset >= 0 ) { ScRange* pRange = new ScRange; - if ( GetRangeFromString( *pRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote ) - && (nOffset >= 0) + if ( + GetRangeFromString( *pRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && + (nOffset >= 0) ) + { rRangeList.push_back( pRange ); + pRange = NULL; + } else if (nOffset > -1) bRet = false; + //if ownership transferred to rRangeList pRange was NULLed, otherwwise + //delete it + delete pRange; } return bRet; } |