From 2489000d3fd66319a8355fd4e37cfdfda47296d0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 31 Jan 2017 14:46:38 +0200 Subject: 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 Reviewed-by: Noel Grandin --- svtools/source/contnr/svtabbx.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'svtools') diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index e114d651d326..be8b00b8315f 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -322,9 +322,8 @@ void SvTabListBox::SetEntryText(const OUString& rStr, SvTreeListEntry* pEntry, s } GetModel()->InvalidateEntry( pEntry ); - TabListBoxEventData* pData = new TabListBoxEventData( pEntry, nTextColumn, sOldText ); - CallEventListeners( VclEventId::TableCellNameChanged, pData ); - delete pData; + std::unique_ptr pData( new TabListBoxEventData( pEntry, nTextColumn, sOldText ) ); + CallEventListeners( VclEventId::TableCellNameChanged, pData.get() ); } OUString SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const -- cgit