diff options
-rw-r--r-- | include/svx/fmview.hxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshb.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun5.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/view/drviewse.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/fmview.cxx | 6 | ||||
-rw-r--r-- | svx/source/form/fmvwimp.cxx | 14 | ||||
-rw-r--r-- | svx/source/inc/fmvwimp.hxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 6 |
10 files changed, 36 insertions, 36 deletions
diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx index 106e83131733..853a6bccfe39 100644 --- a/include/svx/fmview.hxx +++ b/include/svx/fmview.hxx @@ -72,15 +72,15 @@ public: @deprecated This method is deprecated. Use the version with a ODataAccessDescriptor instead. */ - SdrObject* CreateFieldControl(const OUString& rFieldDesc) const; + SdrObjectUniquePtr CreateFieldControl(const OUString& rFieldDesc) const; /** create a control pair (label/bound control) for the database field description given. */ - SdrObject* CreateFieldControl( const svx::ODataAccessDescriptor& _rColumnDescriptor ); + SdrObjectUniquePtr CreateFieldControl( const svx::ODataAccessDescriptor& _rColumnDescriptor ); /** create a control pair (label/bound control) for the xforms description given. */ - SdrObject* CreateXFormsControl( const svx::OXFormsDescriptor &_rDesc ); + SdrObjectUniquePtr CreateXFormsControl( const svx::OXFormsDescriptor &_rDesc ); virtual void MarkListHasChanged() override; virtual void AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow) override; 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; diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 91a10f0aa275..05f8b041be60 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -272,7 +272,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) if(pPageView) { svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue()); - SdrObject* pNewDBField = pFormView->CreateFieldControl(aDescriptor); + SdrObjectUniquePtr pNewDBField = pFormView->CreateFieldControl(aDescriptor); if(pNewDBField) { @@ -285,7 +285,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) pNewDBField->SetLogicRect(aNewObjectRectangle); - GetView()->InsertObjectAtView(pNewDBField, *pPageView); + GetView()->InsertObjectAtView(pNewDBField.release(), *pPageView); } } } diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 06d66260dd7a..e15e67a860de 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -842,7 +842,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( aDataHelper.GetString( SotClipboardFormatId::SBA_FIELDDATAEXCHANGE, aOUString ) ) { - SdrObject* pObj = CreateFieldControl( aOUString ); + SdrObjectUniquePtr pObj = CreateFieldControl( aOUString ); if( pObj ) { @@ -854,7 +854,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, aRect.SetPos( maDropPos ); pObj->SetLogicRect( aRect ); - InsertObjectAtView( pObj, *GetSdrPageView(), SdrInsertFlags::SETDEFLAYER ); + InsertObjectAtView( pObj.release(), *GetSdrPageView(), SdrInsertFlags::SETDEFLAYER ); bReturn = true; } } diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index 5f93b1750b85..025ceff9d991 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -387,19 +387,19 @@ void FmFormView::DeactivateControls(SdrPageView const * pPageView) } -SdrObject* FmFormView::CreateFieldControl( const ODataAccessDescriptor& _rColumnDescriptor ) +SdrObjectUniquePtr FmFormView::CreateFieldControl( const ODataAccessDescriptor& _rColumnDescriptor ) { return pImpl->implCreateFieldControl( _rColumnDescriptor ); } -SdrObject* FmFormView::CreateXFormsControl( const OXFormsDescriptor &_rDesc ) +SdrObjectUniquePtr FmFormView::CreateXFormsControl( const OXFormsDescriptor &_rDesc ) { return pImpl->implCreateXFormsControl(_rDesc); } -SdrObject* FmFormView::CreateFieldControl(const OUString& rFieldDesc) const +SdrObjectUniquePtr FmFormView::CreateFieldControl(const OUString& rFieldDesc) const { OUString sDataSource = rFieldDesc.getToken(0,u'\x000B'); OUString sObjectName = rFieldDesc.getToken(1,u'\x000B'); diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 7c2311948a8a..48f0b2220bec 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1146,7 +1146,7 @@ namespace } -SdrObject* FmXFormView::implCreateFieldControl( const svx::ODataAccessDescriptor& _rColumnDescriptor ) +SdrObjectUniquePtr FmXFormView::implCreateFieldControl( const svx::ODataAccessDescriptor& _rColumnDescriptor ) { // not if we're in design mode if ( !m_pView->IsDesignMode() ) @@ -1347,7 +1347,7 @@ SdrObject* FmXFormView::implCreateFieldControl( const svx::ODataAccessDescriptor bool bCheckbox = ( OBJ_FM_CHECKBOX == nOBJID ); OSL_ENSURE( !bCheckbox || !pLabel, "FmXFormView::implCreateFieldControl: why was there a label created for a check box?" ); if ( bCheckbox ) - return pControl.release(); + return SdrObjectUniquePtr(pControl.release()); SdrObjGroup* pGroup = new SdrObjGroup(getView()->getSdrModelFromSdrView()); SdrObjList* pObjList = pGroup->GetSubList(); @@ -1366,7 +1366,7 @@ SdrObject* FmXFormView::implCreateFieldControl( const svx::ODataAccessDescriptor } } - return pGroup; // and done + return SdrObjectUniquePtr(pGroup); // and done } catch (const Exception&) { @@ -1378,7 +1378,7 @@ SdrObject* FmXFormView::implCreateFieldControl( const svx::ODataAccessDescriptor } -SdrObject* FmXFormView::implCreateXFormsControl( const svx::OXFormsDescriptor &_rDesc ) +SdrObjectUniquePtr FmXFormView::implCreateXFormsControl( const svx::OXFormsDescriptor &_rDesc ) { // not if we're in design mode if ( !m_pView->IsDesignMode() ) @@ -1456,7 +1456,7 @@ SdrObject* FmXFormView::implCreateXFormsControl( const svx::OXFormsDescriptor &_ bool bCheckbox = ( OBJ_FM_CHECKBOX == nOBJID ); OSL_ENSURE( !bCheckbox || !pLabel, "FmXFormView::implCreateXFormsControl: why was there a label created for a check box?" ); if ( bCheckbox ) - return pControl.release(); + return SdrObjectUniquePtr(pControl.release()); // group objects @@ -1465,7 +1465,7 @@ SdrObject* FmXFormView::implCreateXFormsControl( const svx::OXFormsDescriptor &_ pObjList->InsertObject(pLabel.release()); pObjList->InsertObject(pControl.release()); - return pGroup; + return SdrObjectUniquePtr(pGroup); } else { @@ -1495,7 +1495,7 @@ SdrObject* FmXFormView::implCreateXFormsControl( const svx::OXFormsDescriptor &_ Reference< css::form::submission::XSubmissionSupplier > xSubmissionSupplier(pControl->GetUnoControlModel(), UNO_QUERY); xSubmissionSupplier->setSubmission(xSubmission); - return pControl; + return SdrObjectUniquePtr(pControl); } } catch (const Exception&) diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx index 13749dedf391..f10068daee90 100644 --- a/svx/source/inc/fmvwimp.hxx +++ b/svx/source/inc/fmvwimp.hxx @@ -247,8 +247,8 @@ private: void Activate(bool bSync = false); void Deactivate(bool bDeactivateController = true); - SdrObject* implCreateFieldControl( const svx::ODataAccessDescriptor& _rColumnDescriptor ); - SdrObject* implCreateXFormsControl( const svx::OXFormsDescriptor &_rDesc ); + SdrObjectUniquePtr implCreateFieldControl( const svx::ODataAccessDescriptor& _rColumnDescriptor ); + SdrObjectUniquePtr implCreateXFormsControl( const svx::OXFormsDescriptor &_rDesc ); static bool createControlLabelPair( OutputDevice const & _rOutDev, 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 ); } } } |