diff options
Diffstat (limited to 'sc/source/ui/app/seltrans.cxx')
-rw-r--r-- | sc/source/ui/app/seltrans.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx index 65b12506d3a7..e2e6004c6154 100644 --- a/sc/source/ui/app/seltrans.cxx +++ b/sc/source/ui/app/seltrans.cxx @@ -273,11 +273,11 @@ void ScSelectionTransferObj::CreateCellData() } ScDrawLayer::SetGlobalDrawPersist( aDragShellRef.get() ); - ScDocument* pClipDoc = new ScDocument( SCDOCMODE_CLIP ); + ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP )); // bApi = sal_True -> no error messages // #i18364# bStopEdit = sal_False -> don't end edit mode // (this may be called from pasting into the edit line) - bool bCopied = rViewData.GetView()->CopyToClip( pClipDoc, false, true, true, false ); + bool bCopied = rViewData.GetView()->CopyToClip( pClipDoc.get(), false, true, true, false ); ScDrawLayer::SetGlobalDrawPersist(nullptr); @@ -288,7 +288,7 @@ void ScSelectionTransferObj::CreateCellData() aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass(); // maSize is set in ScTransferObj ctor - rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( pClipDoc, aObjDesc ); + rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( std::move(pClipDoc), aObjDesc ); // SetDragHandlePos is not used - there is no mouse position //? pTransferObj->SetVisibleTab( nTab ); @@ -300,8 +300,6 @@ void ScSelectionTransferObj::CreateCellData() mxCellData = pTransferObj; } - else - delete pClipDoc; } } OSL_ENSURE( mxCellData.is(), "can't create CellData" ); |