diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-30 10:49:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-31 08:22:18 +0200 |
commit | 418e6419219a7ffa61b7400abbbcec6a6a93b91f (patch) | |
tree | 39d6bb1aab1c64e8bd0bf706ab08a552debc0ec2 /sc/source/ui/view/viewfun3.cxx | |
parent | 0cf0847b81ed48de01e66565d794ebbd9c663e79 (diff) |
pass ScDocument by ScDocumentUniquePtr
Change-Id: I6ce82c6f061c7f01a5584230c26e9bf20c7f07ca
Reviewed-on: https://gerrit.libreoffice.org/59788
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/viewfun3.cxx')
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index c633df4e82ee..7ae86f3d0c93 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1957,8 +1957,8 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow , if ( pDoc ) { const bool bRecord( pDoc->IsUndoEnabled()); - ScDocument* pUndoDoc = nullptr; - ScDocument* pRedoDoc = nullptr; + ScDocumentUniquePtr pUndoDoc; + ScDocumentUniquePtr pRedoDoc; std::unique_ptr<ScRefUndoData> pUndoData; SCTAB nTab = GetViewData().GetTabNo(); SCTAB nStartTab = nTab; @@ -1977,7 +1977,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow , if ( bRecord ) { - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); pUndoDoc->InitUndoSelected( pDoc , rMark , bColInfo , bRowInfo ); pDoc->CopyToDocument( aUserRange , InsertDeleteFlags::VALUE , false, *pUndoDoc ); } @@ -1997,7 +1997,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow , SfxUndoAction* pUndo = new ScUndoDataForm( pDocSh, nStartCol, nCurrentRow, nStartTab, nUndoEndCol, nUndoEndRow, nEndTab, rMark, - pUndoDoc, pRedoDoc, + std::move(pUndoDoc), std::move(pRedoDoc), std::move(pUndoData) ); pUndoMgr->AddUndoAction( new ScUndoWrapper( pUndo ), true ); |