diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-15 13:58:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-20 08:00:58 +0200 |
commit | 722cb06e71539e108f663ca1c2dd6baf7f4adc64 (patch) | |
tree | 47141f5957aa91d3d53de45e297a07fc84082f6c /sw | |
parent | 587bd15487f78dc0e973ea811a4200612ceeda5d (diff) |
return by unique_ptr from CreateFieldControl
Change-Id: Ic8bf9829c3320aca452fd1a40e9843fdbdbfa219
Reviewed-on: https://gerrit.libreoffice.org/61906
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 61abefb4ffaa..a67f021e72d4 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2688,10 +2688,10 @@ bool SwTransferable::PasteDBData( TransferableDataHelper& rData, if (pFmView && pDragPt) { const OXFormsDescriptor &rDesc = OXFormsTransferable::extractDescriptor(rData); - SdrObject* pObj = pFmView->CreateXFormsControl(rDesc); - if(nullptr != pObj) + SdrObjectUniquePtr pObj = pFmView->CreateXFormsControl(rDesc); + if(pObj) { - rSh.SwFEShell::InsertDrawObj( *pObj, *pDragPt ); + rSh.SwFEShell::InsertDrawObj( *(pObj.release()), *pDragPt ); } } } @@ -2745,9 +2745,9 @@ bool SwTransferable::PasteDBData( TransferableDataHelper& rData, FmFormView* pFmView = dynamic_cast<FmFormView*>( rSh.GetDrawView() ); if (pFmView && bHaveColumnDescriptor && pDragPt) { - SdrObject* pObj = pFmView->CreateFieldControl( OColumnTransferable::extractColumnDescriptor(rData) ); - if ( nullptr != pObj) - rSh.SwFEShell::InsertDrawObj( *pObj, *pDragPt ); + SdrObjectUniquePtr pObj = pFmView->CreateFieldControl( OColumnTransferable::extractColumnDescriptor(rData) ); + if (pObj) + rSh.SwFEShell::InsertDrawObj( *(pObj.release()), *pDragPt ); } } bRet = true; diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 8a94bb84f346..974add36a258 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -115,7 +115,7 @@ void SwView::ExecDraw(SfxRequest& rReq) if( pDescriptorItem ) { svx::ODataAccessDescriptor aDescriptor( pDescriptorItem->GetValue() ); - SdrObject* pObj = pFormView->CreateFieldControl( aDescriptor ); + SdrObjectUniquePtr pObj = pFormView->CreateFieldControl( aDescriptor ); if ( pObj ) { @@ -130,14 +130,14 @@ void SwView::ExecDraw(SfxRequest& rReq) //determine the size of the object if(pObj->IsGroupObject()) { - const tools::Rectangle& rBoundRect = static_cast<SdrObjGroup*>(pObj)->GetCurrentBoundRect(); + const tools::Rectangle& rBoundRect = static_cast<SdrObjGroup*>(pObj.get())->GetCurrentBoundRect(); aStartPos.AdjustX( -(rBoundRect.GetWidth()/2) ); aStartPos.AdjustY( -(rBoundRect.GetHeight()/2) ); } // TODO: unmark all other m_pWrtShell->EnterStdMode(); - m_pWrtShell->SwFEShell::InsertDrawObj( *pObj, aStartPos ); + m_pWrtShell->SwFEShell::InsertDrawObj( *(pObj.release()), aStartPos ); } } } |