summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-11 17:22:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-12 08:58:58 +0200
commitb4c6ad893011eb2b78892b81cfcc496eda0290ed (patch)
treecb232ef406345642b792149daf4f4420e22d3635 /sc
parent2ad735a9577fd463399e4fd1b0f31549aed7243f (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/global.hxx2
-rw-r--r--sc/source/core/data/global.cxx14
2 files changed, 8 insertions, 8 deletions
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;