diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-11 17:26:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-12 10:16:22 +0200 |
commit | 361c46fdcc18840f673bd65224d1542ea570d73d (patch) | |
tree | 70aa286625eabdec2d47c1351d3c1be366b604e5 /sc | |
parent | df37937018fe8e87dad5dd97689632044ba56de3 (diff) |
use unique_ptr for ScGlobal::pFieldEditEngine
Change-Id: Ic9894f9fb77ee270a3c09c0a3b5a008331016295
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100562
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/global.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/global.cxx | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 95ec2efda5c6..580c9aa8eb56 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -528,7 +528,7 @@ class ScGlobal static std::atomic<::utl::TransliterationWrapper*> pCaseTransliteration; static std::atomic<css::lang::Locale*> pLocale; - static ScFieldEditEngine* pFieldEditEngine; + static std::unique_ptr<ScFieldEditEngine> xFieldEditEngine; static void InitPPT(); diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index ae9606b9c665..0c044fc4aeb5 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -98,7 +98,7 @@ std::unique_ptr<ScFunctionMgr> ScGlobal::xStarCalcFunctionMgr; std::atomic<ScUnitConverter*> ScGlobal::pUnitConverter(nullptr); std::unique_ptr<SvNumberFormatter> ScGlobal::xEnglishFormatter; -ScFieldEditEngine* ScGlobal::pFieldEditEngine = nullptr; +std::unique_ptr<ScFieldEditEngine> ScGlobal::xFieldEditEngine; double ScGlobal::nScreenPPTX = 96.0; double ScGlobal::nScreenPPTY = 96.0; @@ -550,7 +550,7 @@ void ScGlobal::Clear() delete pLocale.load(); pLocale = nullptr; delete pUnitConverter.load(); pUnitConverter = nullptr; - DELETEZ(pFieldEditEngine); + xFieldEditEngine.reset(); xDrawClipDocShellRef.clear(); } @@ -1058,15 +1058,15 @@ css::lang::Locale* ScGlobal::GetLocale() ScFieldEditEngine& ScGlobal::GetStaticFieldEditEngine() { assert(!bThreadedGroupCalcInProgress); - if (!pFieldEditEngine) + if (!xFieldEditEngine) { // Creating a ScFieldEditEngine with pDocument=NULL leads to document // specific fields not being resolvable! See // ScFieldEditEngine::CalcFieldValue(). pEnginePool=NULL lets // EditEngine internally create and delete a default pool. - pFieldEditEngine = new ScFieldEditEngine( nullptr, nullptr); + xFieldEditEngine.reset(new ScFieldEditEngine( nullptr, nullptr)); } - return *pFieldEditEngine; + return *xFieldEditEngine; } OUString ScGlobal::ReplaceOrAppend( const OUString& rString, |