diff options
Diffstat (limited to 'sc/source/ui/unoobj/cellsuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 645c6bc4aefd..e957cb22faef 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1126,10 +1126,10 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, return false; } - ScDocument* pUndoDoc = nullptr; + ScDocumentUniquePtr pUndoDoc; if ( bUndo ) { - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); pUndoDoc->InitUndo( &rDoc, nTab, nTab ); rDoc.CopyToDocument(rRange, InsertDeleteFlags::CONTENTS|InsertDeleteFlags::NOCAPTIONS, false, *pUndoDoc); } @@ -1224,7 +1224,7 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, rDocShell.GetUndoManager()->AddUndoAction( new ScUndoPaste( &rDocShell, ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab), - aDestMark, pUndoDoc, nullptr, InsertDeleteFlags::CONTENTS, nullptr, false)); + aDestMark, std::move(pUndoDoc), nullptr, InsertDeleteFlags::CONTENTS, nullptr, false)); } if (!bHeight) @@ -1265,10 +1265,10 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange, return false; } - ScDocument* pUndoDoc = nullptr; + ScDocumentUniquePtr pUndoDoc; if ( bUndo ) { - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); pUndoDoc->InitUndo( &rDoc, nTab, nTab ); rDoc.CopyToDocument(rRange, InsertDeleteFlags::CONTENTS, false, *pUndoDoc); } @@ -1325,7 +1325,7 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange, rDocShell.GetUndoManager()->AddUndoAction( new ScUndoPaste( &rDocShell, ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab), aDestMark, - pUndoDoc, nullptr, InsertDeleteFlags::CONTENTS, nullptr, false)); + std::move(pUndoDoc), nullptr, InsertDeleteFlags::CONTENTS, nullptr, false)); } if (!bHeight) |