summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-11-01 20:36:25 -0400
committerNoel Power <noel.power@suse.com>2012-11-02 10:32:04 +0000
commit4499ed3b610ee9c7762ed5b9c082a37e48d98c8e (patch)
tree5989752c00f8a280589607f73ecf2fb37d3fcf2d /sc
parent1296db324d5962ff904c0ed488a62132dd36a66f (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.cxx2
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();
}