diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-01 20:36:25 -0400 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-11-05 20:02:02 +0100 |
commit | 5092fa14656ba9712f30cea9bce1e49978bbead9 (patch) | |
tree | 288dec5693e1eade44dc860fa9e3804a05e3d098 /sc | |
parent | 66748cbf3beed21d62e7a05ed9e4400b165377d1 (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: Ic09ab4a6bb03d0f56bb854a91bf93a99be867116
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 eebb17ae649f..79bf31f1c157 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1555,7 +1555,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(); } |