diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-29 14:43:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-29 17:37:31 +0200 |
commit | 52b8697a1f6af99061984140ecbca36808ae4a55 (patch) | |
tree | 423905bd18653ec3301ffb06833caa0af40ffddd /svx | |
parent | 962b6307da5d1248481bf9efa534a7bbd37f3a41 (diff) |
rtl::Static -> static local
Change-Id: Ib8d9a24659a37e6b94237d98f030cd2be00bcb39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119665
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/lookupcolorname.cxx | 10 | ||||
-rw-r--r-- | svx/source/sidebar/nbdtmg.cxx | 27 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbunosearchcontrollers.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 12 |
4 files changed, 15 insertions, 44 deletions
diff --git a/svx/source/accessibility/lookupcolorname.cxx b/svx/source/accessibility/lookupcolorname.cxx index 520843c26caa..373dae4693fa 100644 --- a/svx/source/accessibility/lookupcolorname.cxx +++ b/svx/source/accessibility/lookupcolorname.cxx @@ -107,15 +107,15 @@ OUString ColorNameMap::lookUp(tools::Long color) const // Did not find the given color; return its RGB tuple representation: return "#" + OUString::number(color, 16); } - -struct theColorNameMap : public rtl::Static<ColorNameMap, theColorNameMap> -{ -}; } namespace accessibility { -OUString lookUpColorName(tools::Long color) { return theColorNameMap::get().lookUp(color); } +OUString lookUpColorName(tools::Long color) +{ + static ColorNameMap theColorNameMap; + return theColorNameMap.lookUp(color); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 3c744fbf97b4..fbbc3b3da03a 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -248,15 +248,10 @@ BulletsTypeMgr::BulletsTypeMgr() Init(); } -namespace { - -class theBulletsTypeMgr : public rtl::Static<BulletsTypeMgr, theBulletsTypeMgr> {}; - -} - BulletsTypeMgr& BulletsTypeMgr::GetInstance() { - return theBulletsTypeMgr::get(); + static BulletsTypeMgr theBulletsTypeMgr; + return theBulletsTypeMgr; } void BulletsTypeMgr::Init() @@ -397,15 +392,10 @@ static const char* RID_SVXSTR_SINGLENUM_DESCRIPTIONS[] = RID_SVXSTR_SINGLENUM_DESCRIPTION_7 }; -namespace { - -class theNumberingTypeMgr : public rtl::Static<NumberingTypeMgr, theNumberingTypeMgr> {}; - -} - NumberingTypeMgr& NumberingTypeMgr::GetInstance() { - return theNumberingTypeMgr::get(); + static NumberingTypeMgr theNumberingTypeMgr; + return theNumberingTypeMgr; } void NumberingTypeMgr::Init() @@ -572,15 +562,10 @@ OutlineTypeMgr::OutlineTypeMgr() ImplLoad(u"standard.syc"); } -namespace { - -class theOutlineTypeMgr : public rtl::Static<OutlineTypeMgr, theOutlineTypeMgr> {}; - -} - OutlineTypeMgr& OutlineTypeMgr::GetInstance() { - return theOutlineTypeMgr::get(); + static OutlineTypeMgr theOutlineTypeMgr; + return theOutlineTypeMgr; } void OutlineTypeMgr::Init() diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index eebb536d6c1b..ecaaab2cd5d1 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -55,7 +55,6 @@ #include <toolkit/helper/vclunohelper.hxx> #include <vcl/toolbox.hxx> #include <vcl/svapp.hxx> -#include <rtl/instance.hxx> #include <svx/labelitemwindow.hxx> #include <svx/srchdlg.hxx> #include <vcl/event.hxx> @@ -437,15 +436,10 @@ SearchToolbarControllersManager::SearchToolbarControllersManager() { } -class theSearchToolbarControllersManager - : public rtl::Static<SearchToolbarControllersManager, - theSearchToolbarControllersManager> -{ -}; - SearchToolbarControllersManager& SearchToolbarControllersManager::createControllersManager() { - return theSearchToolbarControllersManager::get(); + static SearchToolbarControllersManager theSearchToolbarControllersManager; + return theSearchToolbarControllersManager; } void SearchToolbarControllersManager::saveSearchHistory(const FindTextFieldControl* pFindTextFieldControl) diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index e90d980ebd89..9cc61bcea7ae 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -877,18 +877,10 @@ sal_uInt32 UHashMap::getId( const OUString& rCompareString ) return it->second; } -namespace { - -struct theSvxMapProvider : - public rtl::Static<SvxUnoPropertyMapProvider, theSvxMapProvider> -{ -}; - -} - SvxUnoPropertyMapProvider& getSvxMapProvider() { - return theSvxMapProvider::get(); + static SvxUnoPropertyMapProvider theSvxMapProvider; + return theSvxMapProvider; } |