summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/rangelst.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool/rangelst.cxx')
-rw-r--r--sc/source/core/tool/rangelst.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 2f90f39f6123..49b61620adf0 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -705,9 +705,16 @@ void ScRangeList::DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2 )
{
ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
- iterator itrDel = std::remove_if(maRanges.begin(), maRanges.end(), FindRangeIn<ScRange>(aRange));
- for_each(itrDel, maRanges.end(), ScDeleteObjectByPtr<ScRange>());
- maRanges.erase(itrDel, maRanges.end());
+ for(size_t i = 0; i < maRanges.size();)
+ {
+ if(FindRangeIn(aRange)(maRanges[i]))
+ {
+ ScRange* pRange = Remove(i);
+ delete pRange;
+ }
+ else
+ ++i;
+ }
std::vector<ScRange> aNewRanges;