From aa09b0c27a6d925da428d6267daadc7338829869 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 Apr 2017 09:46:06 +0200 Subject: loplugin:useuniqueptr extend to catch more localvar cases i.e. where the code looks like { foo * p = new foo; ... delete p; return ...; } Change-Id: Id5f2e55d0363fc62c72535a23faeaaf1f0ac6aee Reviewed-on: https://gerrit.libreoffice.org/36190 Tested-by: Jenkins Reviewed-by: Noel Grandin --- accessibility/source/extended/textwindowaccessibility.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'accessibility') diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 754526db7b75..741712b40c4b 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1043,7 +1043,7 @@ Document::retrieveCharacterAttributes( // sort the attributes sal_Int32 nLength = aRes.getLength(); const css::beans::PropertyValue* pPairs = aRes.getConstArray(); - sal_Int32* pIndices = new sal_Int32[nLength]; + std::unique_ptr pIndices( new sal_Int32[nLength] ); for( i = 0; i < nLength; i++ ) pIndices[i] = i; std::sort( &pIndices[0], &pIndices[nLength], IndexCompare(pPairs) ); @@ -1054,7 +1054,6 @@ Document::retrieveCharacterAttributes( { pNewValues[i] = pPairs[pIndices[i]]; } - delete[] pIndices; return aNewValues; } -- cgit