diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-29 11:12:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-05 07:50:38 +0100 |
commit | cb226e26cbdfe29bc97aba101d3d524f13482876 (patch) | |
tree | 38c377ab2beff6e356d78d02ff20a5880240687a /editeng/source/outliner | |
parent | add8b7099394e0754693af5a89d148ddc118182e (diff) |
loplugin:useuniqueptr in Outliner
Change-Id: I68568dd61ef6ba99fcb0ac386170bfe67ab2bbd7
Reviewed-on: https://gerrit.libreoffice.org/49174
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/outliner')
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 9 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index f520239bf148..f83ec948ee52 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -1246,12 +1246,12 @@ Outliner::Outliner(SfxItemPool* pPool, OutlinerMode nMode) , bPasting(false) { - pParaList = new ParagraphList; + pParaList.reset( new ParagraphList ); pParaList->SetVisibleStateChangedHdl( LINK( this, Outliner, ParaVisibleStateChangedHdl ) ); Paragraph* pPara = new Paragraph( 0 ); pParaList->Append(pPara); - pEditEngine = new OutlinerEditEng( this, pPool ); + pEditEngine.reset( new OutlinerEditEng( this, pPool ) ); pEditEngine->SetBeginMovingParagraphsHdl( LINK( this, Outliner, BeginMovingParagraphsHdl ) ); pEditEngine->SetEndMovingParagraphsHdl( LINK( this, Outliner, EndMovingParagraphsHdl ) ); pEditEngine->SetBeginPasteOrDropHdl( LINK( this, Outliner, BeginPasteOrDropHdl ) ); @@ -1262,10 +1262,9 @@ Outliner::Outliner(SfxItemPool* pPool, OutlinerMode nMode) Outliner::~Outliner() { - pParaList->Clear(); - delete pParaList; - delete pEditEngine; + pParaList.reset(); + pEditEngine.reset(); } size_t Outliner::InsertView( OutlinerView* pView, size_t nIndex ) diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 0c380d570604..49db7d25280c 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -52,7 +52,7 @@ using namespace ::com::sun::star; OutlinerView::OutlinerView( Outliner* pOut, vcl::Window* pWin ) { pOwner = pOut; - pEditView.reset( new EditView( pOut->pEditEngine, pWin ) ); + pEditView.reset( new EditView( pOut->pEditEngine.get(), pWin ) ); } OutlinerView::~OutlinerView() |