diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-29 16:27:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-30 09:46:37 +0200 |
commit | b99c69784e8bb7b477759f14058a707e9000e56d (patch) | |
tree | 83a87f074a4f6abcecbfa8a5f5965c64893a0454 /sd | |
parent | 5ff20b1c726509ad88058c953406a2bd0c8e194b (diff) |
rename GetMarkedObjModel to CreateMarkedObjModel
and return std::unique_ptr
Not that it helps much, the ownership quickly becomes complex once it
hits the TransferableHelper.
Change-Id: I3c6bd72072e092b71b32e4105fe859fdcea956af
Reviewed-on: https://gerrit.libreoffice.org/59777
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/drawdoc3.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/app/sdxfer.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/sdview2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 186a036eede5..056fb2953f49 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1098,7 +1098,7 @@ bool SdDrawDocument::InsertBookmarkAsObject( if (bOLEObjFound) pBMView->GetDoc().SetAllocDocSh(true); - SdDrawDocument* pTmpDoc = static_cast<SdDrawDocument*>( pBMView->GetMarkedObjModel() ); + SdDrawDocument* pTmpDoc = static_cast<SdDrawDocument*>( pBMView->CreateMarkedObjModel().release() ); bOK = pView->Paste(*pTmpDoc, aObjPos, pPage, SdrInsertFlags::NONE); if (bOLEObjFound) diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 2df04fd50038..1fc338954cae 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -272,7 +272,7 @@ void SdTransferable::CreateData() if( mpSourceDoc ) mpSourceDoc->CreatingDataObj(this); - mpSdDrawDocumentIntern = static_cast<SdDrawDocument*>( mpSdView->GetMarkedObjModel() ); + mpSdDrawDocumentIntern = static_cast<SdDrawDocument*>( mpSdView->CreateMarkedObjModel().release() ); if( mpSourceDoc ) mpSourceDoc->CreatingDataObj(nullptr); @@ -494,7 +494,7 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo { SdDrawDocument& rInternDoc = mpSdViewIntern->GetDoc(); rInternDoc.CreatingDataObj(this); - SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( mpSdViewIntern->GetMarkedObjModel() ); + SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( mpSdViewIntern->CreateMarkedObjModel().release() ); rInternDoc.CreatingDataObj(nullptr); bOK = SetObject( pDoc, SDTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor ); diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 539d69b4dfc4..a714d10cca33 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -92,7 +92,7 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateClipboardDat SD_MOD()->pTransferClip = pTransferable; mrDoc.CreatingDataObj( pTransferable ); - pTransferable->SetWorkDocument( static_cast<SdDrawDocument*>(GetMarkedObjModel()) ); + pTransferable->SetWorkDocument( static_cast<SdDrawDocument*>(CreateMarkedObjModel().release()) ); mrDoc.CreatingDataObj( nullptr ); // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index a710e7325ec4..1245065e6814 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -622,7 +622,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // model is owned by from AllocModel() created DocShell SdDrawDocument* pSourceDoc = static_cast<SdDrawDocument*>( pSourceView->GetModel() ); pSourceDoc->CreatingDataObj( pOwnData ); - SdDrawDocument* pModel = static_cast<SdDrawDocument*>( pSourceView->GetMarkedObjModel() ); + SdDrawDocument* pModel = static_cast<SdDrawDocument*>( pSourceView->CreateMarkedObjModel().release() ); bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions); if( !pPage ) |