diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-30 12:25:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-31 13:27:11 +0200 |
commit | b0d94ba8efe46c3ff7e90fa98f9a8708f48c5e66 (patch) | |
tree | 5a2dbd8cbbbca92f0c2120e5e85e861e5fab801a /sc/source/ui/unoobj | |
parent | 64cb57c82d9e7f7069821b2e2ef92574ec73ebe2 (diff) |
use std::unique_ptr in various sc undo code
Change-Id: I7906f4e78336d3b738ea3409838ce3404e7f5c30
Reviewed-on: https://gerrit.libreoffice.org/59796
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 40386f297348..6b6985cdd5b4 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1057,9 +1057,9 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r { ScDocument& rDoc = pDocShell->GetDocument(); bool bUndo(rDoc.IsUndoEnabled()); - ScDocument* pUndoDoc = nullptr; + ScDocumentUniquePtr pUndoDoc; if (bUndo) - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); size_t nCount = rRanges.size(); for (size_t i = 0; i < nCount; ++i) { @@ -1086,7 +1086,7 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r if (bUndo) { pDocShell->GetUndoManager()->AddUndoAction( - new ScUndoBorder( pDocShell, rRanges, pUndoDoc, rOuter, rInner ) ); + new ScUndoBorder( pDocShell, rRanges, std::move(pUndoDoc), rOuter, rInner ) ); } for (size_t i = 0; i < nCount; ++i ) @@ -7023,11 +7023,11 @@ void SAL_CALL ScTableSheetObj::removeAllManualPageBreaks() if (bUndo) { - ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + ScDocumentUniquePtr pUndoDoc(new ScDocument( SCDOCMODE_UNDO )); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); pDocSh->GetUndoManager()->AddUndoAction( - new ScUndoRemoveBreaks( pDocSh, nTab, pUndoDoc ) ); + new ScUndoRemoveBreaks( pDocSh, nTab, std::move(pUndoDoc) ) ); } rDoc.RemoveManualBreaks(nTab); |