sc/inc/global.hxx | 3 +-- sc/source/core/data/global.cxx | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-)
New commits: commit b4c6ad893011eb2b78892b81cfcc496eda0290ed Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Aug 11 17:22:21 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 12 08:58:58 2020 +0200 use unique_ptr for ScGlobal::pEnglishFormatter Change-Id: Ic570f78fadaa42efc3a61a414dbdec4dd52d3aed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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<ScUnitConverter*> pUnitConverter; - static SvNumberFormatter* pEnglishFormatter; // for UNO / XML export + static std::unique_ptr<SvNumberFormatter> xEnglishFormatter; // for UNO / XML export static css::uno::Reference< css::i18n::XOrdinalSuffix> xOrdinalSuffix; static std::unique_ptr<CalendarWrapper> 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<ScFunctionList> ScGlobal::xStarCalcFunctionList; std::unique_ptr<ScFunctionMgr> ScGlobal::xStarCalcFunctionMgr; std::atomic<ScUnitConverter*> ScGlobal::pUnitConverter(nullptr); -SvNumberFormatter* ScGlobal::pEnglishFormatter = nullptr; +std::unique_ptr<SvNumberFormatter> 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; commit 2ad735a9577fd463399e4fd1b0f31549aed7243f Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Aug 11 17:18:47 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 12 08:58:36 2020 +0200 remove unused pScIntlWrapper field from ScGlobal Change-Id: I687f4d5bb485724ca93cd7402c7c05743705d633 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100560 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 9250a27c3608..b5231e773804 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -526,7 +526,6 @@ class ScGlobal static std::atomic<CollatorWrapper*> pCollator; static std::atomic<::utl::TransliterationWrapper*> pTransliteration; static std::atomic<::utl::TransliterationWrapper*> pCaseTransliteration; - static IntlWrapper* pScIntlWrapper; static std::atomic<css::lang::Locale*> pLocale; static ScFieldEditEngine* pFieldEditEngine; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits