sc/inc/global.hxx | 4 ++-- sc/source/core/data/global.cxx | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-)
New commits: commit ac35a51eb5071948ab50fcf0be029a37a1721fad Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Mar 26 15:34:27 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Mar 27 07:38:59 2019 +0100 no need to allocate aEmptyOUString separately Change-Id: I938f5c022ef07e9ac4cc6eaf60cc7a88deabbda7 Reviewed-on: https://gerrit.libreoffice.org/69747 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 75d4ef24ca91..989671621484 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -509,7 +509,7 @@ class ScGlobal static ScUserList* pUserList; static std::map<const char*, OUString>* pRscString; static OUString* pStrScDoc; - static OUString* pEmptyOUString; + static SC_DLLPUBLIC const OUString aEmptyOUString; static OUString* pStrClipDocName; static SvxBrushItem* pEmptyBrushItem; static SvxBrushItem* pButtonBrushItem; @@ -592,7 +592,7 @@ public: static void InitTextHeight(const SfxItemPool* pPool); static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; } static SvxBrushItem* GetButtonBrushItem(); - SC_DLLPUBLIC static const OUString& GetEmptyOUString(); + static const OUString& GetEmptyOUString() { return aEmptyOUString; } static bool HasStarCalcFunctionList(); static ScFunctionList* GetStarCalcFunctionList(); diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 22b96ec9b45c..bb784e589cbd 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -83,7 +83,7 @@ std::atomic<CollatorWrapper*> ScGlobal::pCaseCollator(nullptr); std::atomic<::utl::TransliterationWrapper*> ScGlobal::pTransliteration(nullptr); std::atomic<::utl::TransliterationWrapper*> ScGlobal::pCaseTransliteration(nullptr); css::uno::Reference< css::i18n::XOrdinalSuffix> ScGlobal::xOrdinalSuffix; -OUString* ScGlobal::pEmptyOUString = nullptr; +const OUString ScGlobal::aEmptyOUString; OUString* ScGlobal::pStrClipDocName = nullptr; SvxBrushItem* ScGlobal::pEmptyBrushItem = nullptr; @@ -431,15 +431,8 @@ SvxBrushItem* ScGlobal::GetButtonBrushItem() return pButtonBrushItem; } -const OUString& ScGlobal::GetEmptyOUString() -{ - return *pEmptyOUString; -} - void ScGlobal::Init() { - pEmptyOUString = new OUString; - // The default language for number formats (ScGlobal::eLnge) must // always be LANGUAGE_SYSTEM // FIXME: So remove this variable? @@ -567,7 +560,6 @@ void ScGlobal::Clear() delete pUnitConverter.load(); pUnitConverter = nullptr; DELETEZ(pFieldEditEngine); - DELETEZ(pEmptyOUString); xDrawClipDocShellRef.clear(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits