diff options
author | Ian <ian.gilham@gmail.com> | 2015-08-12 15:39:21 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-08-13 11:57:20 +0000 |
commit | 12761ab70553bb0d2746d7d95958dc6fbc7082e0 (patch) | |
tree | 92b28b8271af58ea1038a3f298ff06b804542726 /scaddins/source/datefunc/datefunc.cxx | |
parent | e5ba9090f4809906ffa1c1dea352161cb988b97f (diff) |
migrated some raw pointers to unique_ptr's
Change-Id: Ibbe088e73bdf987bf3784b61aa8b38a86d6654e3
Reviewed-on: https://gerrit.libreoffice.org/17679
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'scaddins/source/datefunc/datefunc.cxx')
-rw-r--r-- | scaddins/source/datefunc/datefunc.cxx | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index cbba443d9246..68683c9ae3aa 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -143,26 +143,19 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL date_component_getFactory( // "normal" service implementation ScaDateAddIn::ScaDateAddIn() : - pDefLocales( NULL ), - pResMgr( NULL ), - pFuncDataList( NULL ) + pDefLocales( nullptr ), + pResMgr( nullptr ), + pFuncDataList( nullptr ) { } -ScaDateAddIn::~ScaDateAddIn() -{ - delete pFuncDataList; - delete pResMgr; - delete[] pDefLocales; -} - static const sal_Char* pLang[] = { "de", "en" }; static const sal_Char* pCoun[] = { "DE", "US" }; static const sal_uInt32 nNumOfLoc = SAL_N_ELEMENTS( pLang ); void ScaDateAddIn::InitDefLocales() { - pDefLocales = new lang::Locale[ nNumOfLoc ]; + pDefLocales.reset(new lang::Locale[ nNumOfLoc ]); for( sal_uInt32 nIndex = 0; nIndex < nNumOfLoc; nIndex++ ) { @@ -192,24 +185,18 @@ ResMgr& ScaDateAddIn::GetResMgr() throw( uno::RuntimeException, std::exception ) void ScaDateAddIn::InitData() { - delete pResMgr; - pResMgr = ResMgr::CreateResMgr("date", LanguageTag(aFuncLoc)); - delete pFuncDataList; + pResMgr.reset(ResMgr::CreateResMgr("date", LanguageTag(aFuncLoc))); + pFuncDataList.reset(); if ( pResMgr ) { - pFuncDataList = new ScaFuncDataList; + pFuncDataList.reset(new ScaFuncDataList); InitScaFuncDataList( *pFuncDataList, *pResMgr ); } - else - { - pFuncDataList = nullptr; - } if( pDefLocales ) { - delete pDefLocales; - pDefLocales = NULL; + pDefLocales.reset(); } } |