diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-31 14:46:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-01 12:15:22 +0000 |
commit | 2489000d3fd66319a8355fd4e37cfdfda47296d0 (patch) | |
tree | caad79e7b5bec3863604b20190b682c0d73d2b25 /sw/source/uibase/dialog | |
parent | 595848c85acc2609fcc48a40c7a9f216a2722cd8 (diff) |
loplugin:useuniqueptr extend to check local vars
just the simple and obvious case for now, of a local var being allocated
and deleted inside a single local block, and the delete happening at the
end of the block
Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625
Reviewed-on: https://gerrit.libreoffice.org/33749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/dialog')
-rw-r--r-- | sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx index 99f26ebd23c2..a2b4f6c8d20a 100644 --- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx @@ -772,9 +772,9 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh) aTmpOutliner.SetPaperSize( pTextObj->GetLogicRect().GetSize() ); aTmpOutliner.SetSpeller( xSpell ); - OutlinerView* pOutlView = new OutlinerView( &aTmpOutliner, &(rView.GetEditWin()) ); + std::unique_ptr<OutlinerView> pOutlView( new OutlinerView( &aTmpOutliner, &(rView.GetEditWin()) ) ); pOutlView->GetOutliner()->SetRefDevice( rSh.getIDocumentDeviceAccess().getPrinter( false ) ); - aTmpOutliner.InsertView( pOutlView ); + aTmpOutliner.InsertView( pOutlView.get() ); Point aPt; Size aSize(1,1); Rectangle aRect( aPt, aSize ); @@ -782,8 +782,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh) aTmpOutliner.SetText( *pParaObj ); aTmpOutliner.ClearModifyFlag(); bHasSpellError = EE_SPELL_OK != aTmpOutliner.HasSpellErrors(); - aTmpOutliner.RemoveView( pOutlView ); - delete pOutlView; + aTmpOutliner.RemoveView( pOutlView.get() ); } if(bHasSpellError) { |