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 /sc | |
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 'sc')
-rw-r--r-- | sc/source/ui/view/tabvwshb.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun5.cxx | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index d4e88c791f21..3cd9c496d56e 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -448,7 +448,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) if(pPageView) { svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue()); - SdrObject* pNewDBField = pDrView->CreateFieldControl(aDescriptor); + SdrObjectUniquePtr pNewDBField = pDrView->CreateFieldControl(aDescriptor); if(pNewDBField) { @@ -462,11 +462,11 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) pNewDBField->SetLogicRect(aNewObjectRectangle); // controls must be on control layer, groups on front layer - if ( dynamic_cast<const SdrUnoObj*>( pNewDBField) != nullptr ) + if ( dynamic_cast<const SdrUnoObj*>( pNewDBField.get() ) != nullptr ) pNewDBField->NbcSetLayer(SC_LAYER_CONTROLS); else pNewDBField->NbcSetLayer(SC_LAYER_FRONT); - if (dynamic_cast<const SdrObjGroup*>( pNewDBField) != nullptr) + if (dynamic_cast<const SdrObjGroup*>( pNewDBField.get() ) != nullptr) { SdrObjListIter aIter( *pNewDBField, SdrIterMode::DeepWithGroups ); SdrObject* pSubObj = aIter.Next(); @@ -480,7 +480,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) } } - pView->InsertObjectAtView(pNewDBField, *pPageView); + pView->InsertObjectAtView(pNewDBField.release(), *pPageView); } } } diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index bc44c67a900f..68751d4e148b 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -442,7 +442,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, { MakeDrawLayer(); ScDrawView* pScDrawView = GetScDrawView(); - SdrObject* pObj = pScDrawView->CreateFieldControl( svx::OColumnTransferable::extractColumnDescriptor( aDataHelper ) ); + SdrObjectUniquePtr pObj = pScDrawView->CreateFieldControl( svx::OColumnTransferable::extractColumnDescriptor( aDataHelper ) ); if (pObj) { Point aInsPos = aPos; @@ -454,11 +454,11 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, aRect.SetPos(aInsPos); pObj->SetLogicRect(aRect); - if ( dynamic_cast<const SdrUnoObj*>( pObj) != nullptr ) + if ( dynamic_cast<const SdrUnoObj*>( pObj.get() ) != nullptr ) pObj->NbcSetLayer(SC_LAYER_CONTROLS); else pObj->NbcSetLayer(SC_LAYER_FRONT); - if (dynamic_cast<const SdrObjGroup*>( pObj) != nullptr) + if (dynamic_cast<const SdrObjGroup*>( pObj.get() ) != nullptr) { SdrObjListIter aIter( *pObj, SdrIterMode::DeepWithGroups ); SdrObject* pSubObj = aIter.Next(); @@ -472,7 +472,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, } } - pScDrawView->InsertObjectSafe(pObj, *pScDrawView->GetSdrPageView()); + pScDrawView->InsertObjectSafe(pObj.release(), *pScDrawView->GetSdrPageView()); GetViewData().GetViewShell()->SetDrawShell( true ); bRet = true; |