summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/impex.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/docshell/impex.cxx')
-rw-r--r--sc/source/ui/docshell/impex.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 9128a93f0195..8a36dded1fe2 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -256,13 +256,13 @@ void ScImportExport::EndPaste(bool bAutoRowHeight)
if( pUndoDoc && pDoc->IsUndoEnabled() && pDocSh )
{
- ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
+ ScDocumentUniquePtr pRedoDoc(new ScDocument( SCDOCMODE_UNDO ));
pRedoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
pDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, *pRedoDoc);
ScMarkData aDestMark;
aDestMark.SetMarkArea(aRange);
pDocSh->GetUndoManager()->AddUndoAction(
- new ScUndoPaste(pDocSh, aRange, aDestMark, pUndoDoc.release(), pRedoDoc, InsertDeleteFlags::ALL, nullptr));
+ new ScUndoPaste(pDocSh, aRange, aDestMark, std::move(pUndoDoc), std::move(pRedoDoc), InsertDeleteFlags::ALL, nullptr));
}
pUndoDoc.reset();
if( pDocSh )