summaryrefslogtreecommitdiff
path: root/sc/source/ui/undo
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r--sc/source/ui/undo/undocell.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 321cf789bf68..114964220a19 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -1028,10 +1028,10 @@ void ScUndoDetective::Undo()
ScDetOpList* pList = pDoc->GetDetOpList();
if (pList && pList->Count())
{
- sal_uInt16 nPos = pList->Count() - 1;
- ScDetOpData* pData = pList->GetObject(nPos);
- if ( pData->GetOperation() == (ScDetOpType) nAction && pData->GetPos() == aPos )
- pList->DeleteAndDestroy( nPos );
+ ScDetOpDataVector& rVec = pList->GetDataVector();
+ ScDetOpDataVector::iterator it = rVec.begin() + rVec.size() - 1;
+ if ( it->GetOperation() == (ScDetOpType) nAction && it->GetPos() == aPos )
+ rVec.erase( it);
else
{
OSL_FAIL("Detektiv-Eintrag in der Liste nicht gefunden");