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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 16 | ||||
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdxcgv.cxx | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index e976aab5962d..eecae287517a 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -333,7 +333,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const // override get model, since in some 3D objects an additional scene // must be pushed in -SdrModel* E3dView::GetMarkedObjModel() const +std::unique_ptr<SdrModel> E3dView::CreateMarkedObjModel() const { // Does 3D objects exist which scenes are not selected? bool bSpecialHandling(false); @@ -371,10 +371,10 @@ SdrModel* E3dView::GetMarkedObjModel() const if(!bSpecialHandling) { // call parent - return SdrView::GetMarkedObjModel(); + return SdrView::CreateMarkedObjModel(); } - SdrModel* pNewModelel = nullptr; + std::unique_ptr<SdrModel> pNewModel; tools::Rectangle aSelectedSnapRect; // set 3d selection flags at all directly selected objects @@ -415,13 +415,13 @@ SdrModel* E3dView::GetMarkedObjModel() const // call parent. This will copy all scenes and the selection flags at the 3D objects. So // it will be possible to delete all non-selected 3d objects from the cloned 3d scenes - pNewModelel = SdrView::GetMarkedObjModel(); + pNewModel = SdrView::CreateMarkedObjModel(); - if(pNewModelel) + if(pNewModel) { - for(sal_uInt16 nPg(0); nPg < pNewModelel->GetPageCount(); nPg++) + for(sal_uInt16 nPg(0); nPg < pNewModel->GetPageCount(); nPg++) { - const SdrPage* pSrcPg=pNewModelel->GetPage(nPg); + const SdrPage* pSrcPg=pNewModel->GetPage(nPg); const size_t nObjCount(pSrcPg->GetObjCount()); for(size_t nOb = 0; nOb < nObjCount; ++nOb) @@ -446,7 +446,7 @@ SdrModel* E3dView::GetMarkedObjModel() const // restore old selection rCurrentMarkList = aOldML; - return pNewModelel; + return pNewModel; } // When pasting objects have to integrated if a scene is inserted, but diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index aefd4955a680..369c66c315ff 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -191,7 +191,7 @@ void SdrObjList::CopyObjects(const SdrObjList& rSrcList) // and then the object connections are made. // Similar implementation are setup as the following: // void SdrObjList::CopyObjects(const SdrObjList& rSrcList) - // SdrModel* SdrExchangeView::GetMarkedObjModel() const + // SdrModel* SdrExchangeView::CreateMarkedObjModel() const // BOOL SdrExchangeView::Paste(const SdrModel& rMod,...) // void SdrEditView::CopyMarked() if (nCloneErrCnt==0) { diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index f549df42426e..c722484602aa 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -709,12 +709,12 @@ void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const } } -SdrModel* SdrExchangeView::GetMarkedObjModel() const +std::unique_ptr<SdrModel> SdrExchangeView::CreateMarkedObjModel() const { // Sorting the MarkList here might be problematic in the future, so // use a copy. SortMarkedObjects(); - SdrModel* pNewModel(mpModel->AllocModel()); + std::unique_ptr<SdrModel> pNewModel(mpModel->AllocModel()); SdrPage* pNewPage(pNewModel->AllocPage(false)); pNewModel->InsertPage(pNewPage); ::std::vector< SdrObject* > aSdrObjects(GetMarkedObjects()); |