summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewfun5.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-15 13:58:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-20 08:00:58 +0200
commit722cb06e71539e108f663ca1c2dd6baf7f4adc64 (patch)
tree47141f5957aa91d3d53de45e297a07fc84082f6c /sc/source/ui/view/viewfun5.cxx
parent587bd15487f78dc0e973ea811a4200612ceeda5d (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/source/ui/view/viewfun5.cxx')
-rw-r--r--sc/source/ui/view/viewfun5.cxx8
1 files changed, 4 insertions, 4 deletions
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;