summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-03-26 15:34:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-27 07:38:59 +0100
commitac35a51eb5071948ab50fcf0be029a37a1721fad (patch)
tree8fbb6e17fcb51757568ca569884209c5816d0f82
parent9187549836e60a944c61e4e833c4b132c1d615eb (diff)
no need to allocate aEmptyOUString separately
Change-Id: I938f5c022ef07e9ac4cc6eaf60cc7a88deabbda7 Reviewed-on: https://gerrit.libreoffice.org/69747 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/inc/global.hxx4
-rw-r--r--sc/source/core/data/global.cxx10
2 files changed, 3 insertions, 11 deletions
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();
}