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>
This commit is contained in:
Noel Grandin
2020-08-11 17:26:26 +02:00
parent df37937018
commit 361c46fdcc
3 changed files with 7 additions and 7 deletions

View File

@@ -176,7 +176,7 @@ public:
|| name == "g_pSpellIter" // SwEditShell::SpellEnd()
|| name == "g_pConvIter" // SwEditShell::SpellEnd()
|| name == "g_pHyphIter" // SwEditShell::HyphEnd()
|| name == "pFieldEditEngine" // ScGlobal::Clear()
|| name == "xFieldEditEngine" // ScGlobal::Clear()
|| name == "xDrawClipDocShellRef" // ScGlobal::Clear()
|| name == "s_ImageTree"
// ImageTree::get(), ImageTree::shutDown()

View File

@@ -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();

View File

@@ -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,