sw/source/ui/dbui/dbinsdlg.cxx | 23 ++++++++++------------- sw/source/ui/dbui/mmoutputtypepage.cxx | 2 +- sw/source/ui/inc/mmresultdialogs.hxx | 2 +- sw/source/uibase/inc/dbinsdlg.hxx | 4 ++-- 4 files changed, 14 insertions(+), 17 deletions(-)
New commits: commit fe7bea05bb5ddcb0eacddc72fdb0f8689d01ed75 Author: Noel Grandin <[email protected]> AuthorDate: Fri Jul 27 09:38:24 2018 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Jul 30 08:22:30 2018 +0200 loplugin:useuniqueptr in SwSendMailDialog Change-Id: I653066c25fd627d98e63f7ae94a56954c9c01583 Reviewed-on: https://gerrit.libreoffice.org/58248 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index d66ba8126a94..9bf6e97400f8 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -309,7 +309,7 @@ void SwSendMailDialog::dispose() { } } - delete m_pImpl; + m_pImpl.reset(); m_pStatus.disposeAndClear(); m_pTransferStatus.clear(); m_pPaused.clear(); diff --git a/sw/source/ui/inc/mmresultdialogs.hxx b/sw/source/ui/inc/mmresultdialogs.hxx index d391f34a50f9..b23705100f41 100644 --- a/sw/source/ui/inc/mmresultdialogs.hxx +++ b/sw/source/ui/inc/mmresultdialogs.hxx @@ -179,7 +179,7 @@ class SwSendMailDialog : public Dialog bool m_bCancel; bool m_bDestructionEnabled; - SwSendMailDialog_Impl* m_pImpl; + std::unique_ptr<SwSendMailDialog_Impl> m_pImpl; SwMailMergeConfigItem* m_pConfigItem; sal_Int32 m_nExpectedCount; sal_Int32 m_nSendCount; commit 818b837790c0807e508fc1246df3d2e07520529f Author: Noel Grandin <[email protected]> AuthorDate: Fri Jul 27 09:37:11 2018 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Jul 30 08:22:26 2018 +0200 loplugin:useuniqueptr in SwInsertDBColAutoPilot Change-Id: Ida2be4abdeb6788ec9074a81c927e99e633ce394 Reviewed-on: https://gerrit.libreoffice.org/58247 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 42d6728c880c..33ab1ede2128 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -416,8 +416,8 @@ SwInsertDBColAutoPilot::~SwInsertDBColAutoPilot() void SwInsertDBColAutoPilot::dispose() { - delete pTableSet; - delete pRep; + pTableSet.reset(); + pRep.reset(); m_xTAutoFormat.reset(); m_pRbAsTable.clear(); @@ -659,7 +659,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void ) if( !pTableSet ) { bNewSet = true; - pTableSet = new SfxItemSet( rSh.GetAttrPool(), SwuiGetUITableAttrRange() ); + pTableSet.reset(new SfxItemSet( rSh.GetAttrPool(), SwuiGetUITableAttrRange() )); // At first acquire the simple attributes pTableSet->Put( SfxStringItem( FN_PARAM_TABLE_NAME, rSh.GetUniqueTableName() )); @@ -721,12 +721,12 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void ) SwTabCols aTabCols; aTabCols.SetRight( nWidth ); aTabCols.SetRightMax( nWidth ); - pRep = new SwTableRep( aTabCols ); + pRep.reset(new SwTableRep( aTabCols )); pRep->SetAlign( text::HoriOrientation::NONE ); pRep->SetSpace( nWidth ); pRep->SetWidth( nWidth ); pRep->SetWidthPercent( 100 ); - pTableSet->Put( SwPtrItem( FN_TABLE_REP, pRep )); + pTableSet->Put( SwPtrItem( FN_TABLE_REP, pRep.get() )); pTableSet->Put( SfxUInt16Item( SID_HTML_MODE, ::GetHtmlMode( pView->GetDocShell() ))); @@ -749,27 +749,24 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void ) aTabCols.Insert( nStep*(n+1), false, n ); } } - delete pRep; - pRep = new SwTableRep( aTabCols ); + pRep.reset(new SwTableRep( aTabCols )); pRep->SetAlign( text::HoriOrientation::NONE ); pRep->SetSpace( nWidth ); pRep->SetWidth( nWidth ); pRep->SetWidthPercent( 100 ); - pTableSet->Put( SwPtrItem( FN_TABLE_REP, pRep )); + pTableSet->Put( SwPtrItem( FN_TABLE_REP, pRep.get() )); } SwAbstractDialogFactory* pFact = swui::GetFactory(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(pButton, pTableSet, &rSh)); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(pButton, pTableSet.get(), &rSh)); if( RET_OK == pDlg->Execute() ) pTableSet->Put( *pDlg->GetOutputItemSet() ); else if( bNewSet ) { - delete pTableSet; - pTableSet = nullptr; - delete pRep; - pRep = nullptr; + pTableSet.reset(); + pRep.reset(); } } diff --git a/sw/source/uibase/inc/dbinsdlg.hxx b/sw/source/uibase/inc/dbinsdlg.hxx index 2ed40956a68d..c3362a52686c 100644 --- a/sw/source/uibase/inc/dbinsdlg.hxx +++ b/sw/source/uibase/inc/dbinsdlg.hxx @@ -128,8 +128,8 @@ class SwInsertDBColAutoPilot : public SfxModalDialog, public utl::ConfigItem SwView* pView; std::unique_ptr<SwTableAutoFormat> m_xTAutoFormat; - SfxItemSet* pTableSet; - SwTableRep* pRep; + std::unique_ptr<SfxItemSet> pTableSet; + std::unique_ptr<SwTableRep> pRep; sal_Int32 nGBFormatLen; DECL_LINK( PageHdl, Button*, void ); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
