From 5092fa14656ba9712f30cea9bce1e49978bbead9 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 1 Nov 2012 20:36:25 -0400 Subject: 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 --- sc/source/core/data/column.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); } -- cgit v1.2.3