diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 09:46:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 09:22:46 +0000 |
commit | aa09b0c27a6d925da428d6267daadc7338829869 (patch) | |
tree | b0fa576ff64820061d9fb876bebacd23e58ddc56 /accessibility/source/extended | |
parent | 0c82dff153d92150729815b919854a9a350aa031 (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'accessibility/source/extended')
-rw-r--r-- | accessibility/source/extended/textwindowaccessibility.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
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<sal_Int32[]> 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; } |