diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index b5231e773804..95ec2efda5c6 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -518,7 +518,7 @@ class ScGlobal static std::atomic pUnitConverter; - static SvNumberFormatter* pEnglishFormatter; // for UNO / XML export + static std::unique_ptr xEnglishFormatter; // for UNO / XML export static css::uno::Reference< css::i18n::XOrdinalSuffix> xOrdinalSuffix; static std::unique_ptr xCalendar; diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 3d0ce48eb4c4..ae9606b9c665 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -97,7 +97,7 @@ std::unique_ptr ScGlobal::xStarCalcFunctionList; std::unique_ptr ScGlobal::xStarCalcFunctionMgr; std::atomic ScGlobal::pUnitConverter(nullptr); -SvNumberFormatter* ScGlobal::pEnglishFormatter = nullptr; +std::unique_ptr ScGlobal::xEnglishFormatter; ScFieldEditEngine* ScGlobal::pFieldEditEngine = nullptr; double ScGlobal::nScreenPPTX = 96.0; @@ -167,13 +167,13 @@ sal_uInt16 ScGlobal::GetStandardRowHeight() SvNumberFormatter* ScGlobal::GetEnglishFormatter() { assert(!bThreadedGroupCalcInProgress); - if ( !pEnglishFormatter ) + if ( !xEnglishFormatter ) { - pEnglishFormatter = new SvNumberFormatter( - ::comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US ); - pEnglishFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_INTL_FORMAT ); + xEnglishFormatter.reset( new SvNumberFormatter( + ::comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US ) ); + xEnglishFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_INTL_FORMAT ); } - return pEnglishFormatter; + return xEnglishFormatter.get(); } bool ScGlobal::CheckWidthInvalidate( bool& bNumFormatChanged, @@ -540,7 +540,7 @@ void ScGlobal::Clear() xEmptyBrushItem.reset(); xButtonBrushItem.reset(); xEmbeddedBrushItem.reset(); - DELETEZ(pEnglishFormatter); + xEnglishFormatter.reset(); delete pCaseTransliteration.load(); pCaseTransliteration = nullptr; delete pTransliteration.load(); pTransliteration = nullptr; delete pCaseCollator.load(); pCaseCollator = nullptr;