diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-01 20:11:22 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-01 20:16:53 -0400 |
commit | f978013f9b8d5256aa029a3572d905bebb55c5f4 (patch) | |
tree | e861aa7db4348859e0e896ade57699dd7c500625 /sc | |
parent | 1c2ef32a78e1b59a7cb49218d78cf5abc70c8518 (diff) |
Remove the correct range, or else maItems would end up with invalid pointer.
nStopPos is non-inclusive, and STL's erase() method also expects a
non-inclusive end position (like any other STL methods do). It's wrong
to -1 here which would end up not erasing the last element containing
a pointer to the deleted cell instance.
Change-Id: Ia3ef4469b50695038836ff7b9b48172256032786
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/column.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 14e01f728a90..1321cd23c323 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1537,7 +1537,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) rAddress.SetRow( maItems[i].nRow ); pDocument->AreaBroadcast( aHint ); } - maItems.erase(maItems.begin() + nStartPos, maItems.begin() + nStopPos - 1); + maItems.erase(maItems.begin() + nStartPos, maItems.begin() + nStopPos); } pNoteCell->Delete(); } |