diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-17 14:41:19 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-17 14:56:49 +0200 |
commit | 7a182026fce922a9f69e8da76d46e87e7188a4e9 (patch) | |
tree | dbfd1d1fb8090cbf5cfe359ce5a069b215a26cfe /sc | |
parent | e6bca122176cdb2b6e822fc933f159dc3e3c8d46 (diff) |
don't use delete with remove_if, related fdo#54498
Change-Id: I508ceb8dfe13fbfe54b4262d26bd215462c90c40
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/rangelst.cxx | 13 |
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; |