diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-10 13:36:34 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-11 07:16:20 +0000 |
commit | db17d3c17c40d6b0e92392cf3c6e343d1d17b771 (patch) | |
tree | 9d562fcf764e7717df9585ef0e735a12ea4aaa16 /sc/qa | |
parent | 2ce9e4be4a438203382cb9cca824ce3e90647f3a (diff) |
new loplugin: memoryvar
detect when we can convert a new/delete sequence on a local variable to
use std::unique_ptr
Change-Id: Iecae4e4197eccdfacfce2eed39aa4a69e4a660bc
Reviewed-on: https://gerrit.libreoffice.org/19884
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 81bc4152b9dc..f5871f7aa339 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -5989,7 +5989,7 @@ void testDataBarLengthImpl(ScDocument* pDoc, ScDataBarLengthData* pData, const S double nMaxVal, ScColorScaleEntryType eMaxType, double nZeroPos, databar::ScAxisPosition eAxisPos) { - ScConditionalFormat* pFormat = new ScConditionalFormat(1, pDoc); + std::unique_ptr<ScConditionalFormat> pFormat(new ScConditionalFormat(1, pDoc)); ScRangeList aRangeList(rRange); pFormat->SetRange(aRangeList); @@ -6021,7 +6021,6 @@ void testDataBarLengthImpl(ScDocument* pDoc, ScDataBarLengthData* pData, const S ASSERT_DOUBLES_EQUAL(pData[i].nLength, xInfo->mnLength); ASSERT_DOUBLES_EQUAL(nZeroPos, xInfo->mnZero); } - delete pFormat; } } |