diff options
Diffstat (limited to 'sc/source/ui/view')
-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; |