summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabvwshb.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/tabvwshb.cxx')
-rw-r--r--sc/source/ui/view/tabvwshb.cxx8
1 files changed, 4 insertions, 4 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);
}
}
}