diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 13:57:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 16:01:28 +0200 |
commit | 673347af7d37f6789855c17732c9980d91ec6240 (patch) | |
tree | 4447a73900c50db2f949755eca64a91ac2d9a385 /scaddins | |
parent | 0bc97adb82f14d6ec22f868422cbfe000afec402 (diff) |
loplugin:useuniqueptr in scaddins..svx
Change-Id: I309f98f6b820103a926e9fe94d67d0aff6eb6476
Reviewed-on: https://gerrit.libreoffice.org/39754
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scaddins')
-rw-r--r-- | scaddins/source/analysis/analysis.cxx | 3 | ||||
-rw-r--r-- | scaddins/source/analysis/analysis.hxx | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index 344d5aa0f54a..14a9b6b89481 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -112,7 +112,6 @@ AnalysisAddIn::~AnalysisAddIn() { delete pResMgr; delete pCDL; - delete[] pFactDoubles; delete pFD; delete[] pDefLocales; } @@ -136,7 +135,7 @@ double AnalysisAddIn::FactDouble( sal_Int32 nNum ) if( !pFactDoubles ) { - pFactDoubles = new double[ MAXFACTDOUBLE + 1 ]; + pFactDoubles.reset( new double[ MAXFACTDOUBLE + 1 ] ); pFactDoubles[ 0 ] = 1.0; // by default diff --git a/scaddins/source/analysis/analysis.hxx b/scaddins/source/analysis/analysis.hxx index 97c671820045..c38c65759148 100644 --- a/scaddins/source/analysis/analysis.hxx +++ b/scaddins/source/analysis/analysis.hxx @@ -35,6 +35,8 @@ #include "analysisdefs.hxx" #include "analysishelper.hxx" +#include <memory> + namespace sca { namespace analysis { class ConvertDataList; } } @@ -55,7 +57,7 @@ private: css::lang::Locale aFuncLoc; css::lang::Locale* pDefLocales; sca::analysis::FuncDataList* pFD; - double* pFactDoubles; + std::unique_ptr<double[]> pFactDoubles; sca::analysis::ConvertDataList* pCDL; ResMgr* pResMgr; |