summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-08-01 13:50:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-08-02 10:36:07 +0200
commit13fac4894f752e922727c6f22c6303712e06ba12 (patch)
tree5689829e917927bb13461d91988ec99e461f1831 /sfx2
parent13cadf3fe38daa0b4cfddcfa68ec8631bc85f44a (diff)
normalize resource locale ctor construction mechanisms
make them all the same and share std::locales more various OModuleClient, etc, classes go away Change-Id: I7e3ff01a69332eeacd22e3078f66a60318de62d5 Reviewed-on: https://gerrit.libreoffice.org/40634 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appinit.cxx9
-rw-r--r--sfx2/source/appl/appquit.cxx2
-rw-r--r--sfx2/source/appl/shutdownicon.cxx8
-rw-r--r--sfx2/source/bastyp/sfxresid.cxx21
-rw-r--r--sfx2/source/inc/appdata.hxx4
5 files changed, 5 insertions, 39 deletions
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index d163e80226dc..6551c4d3e39b 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -214,16 +214,11 @@ void SfxApplication::Initialize_Impl()
pImpl->m_pToolsErrorHdl = new SfxErrorHandler(
getRID_ERRHDL(), ErrCode(ERRCODE_AREA_IO), ErrCode(ERRCODE_AREA_SVX));
-#if HAVE_FEATURE_SCRIPTING
- pImpl->aBasicResLocale = Translate::Create("sb");
-#endif
- pImpl->aSvtResLocale = Translate::Create("svt");
-
pImpl->m_pSoErrorHdl = new SfxErrorHandler(
- getRID_SO_ERROR_HANDLER(), ErrCode(ERRCODE_AREA_SO), ErrCode(ERRCODE_AREA_SO_END), &(pImpl->aSvtResLocale));
+ getRID_SO_ERROR_HANDLER(), ErrCode(ERRCODE_AREA_SO), ErrCode(ERRCODE_AREA_SO_END), SvtResLocale());
#if HAVE_FEATURE_SCRIPTING
pImpl->m_pSbxErrorHdl = new SfxErrorHandler(
- getRID_BASIC_START(), ErrCode(ERRCODE_AREA_SBX), ErrCode(ERRCODE_AREA_SBX_END), &(pImpl->aBasicResLocale));
+ getRID_BASIC_START(), ErrCode(ERRCODE_AREA_SBX), ErrCode(ERRCODE_AREA_SBX_END), BasResLocale());
#endif
if (!utl::ConfigManager::IsAvoidConfig())
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index 741b5d7287ce..c07016047e57 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -101,8 +101,6 @@ void SfxApplication::Deinitialize()
// free administration managers
DELETEZ(pImpl->pAppDispat);
- SfxResLocale::DeleteResLocale();
- SvtResLocale::DeleteResLocale();
// from here no SvObjects have to exists
DELETEZ(pImpl->pMatcher);
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 80b8c2bf94dd..6d5204809ad3 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -696,13 +696,7 @@ OUString ShutdownIcon::getShortcutName()
#else
#ifdef _WIN32
- OUString aShortcutName( "StarOffice 6.0" );
- std::locale* pResLocale = SfxResLocale::GetResLocale();
- if (pResLocale)
- {
- ::SolarMutexGuard aGuard;
- aShortcutName = SfxResId(STR_QUICKSTART_LNKNAME);
- }
+ OUString aShortcutName(SfxResId(STR_QUICKSTART_LNKNAME));
aShortcutName += ".lnk";
OUString aShortcut(GetAutostartFolderNameW32());
diff --git a/sfx2/source/bastyp/sfxresid.cxx b/sfx2/source/bastyp/sfxresid.cxx
index 3aa36da218f9..9189ec73558e 100644
--- a/sfx2/source/bastyp/sfxresid.cxx
+++ b/sfx2/source/bastyp/sfxresid.cxx
@@ -19,29 +19,12 @@
#include <sfx2/sfxresid.hxx>
-#include <tools/solar.h>
#include "unotools/resmgr.hxx"
-static std::locale* pResLocale = nullptr;
-
-std::locale* SfxResLocale::GetResLocale()
-{
- if (!pResLocale)
- {
- pResLocale = new std::locale(Translate::Create("sfx"));
- }
-
- return pResLocale;
-}
-
-void SfxResLocale::DeleteResLocale()
-{
- DELETEZ(pResLocale);
-}
-
OUString SfxResId(const char* pId)
{
- return Translate::get(pId, *SfxResLocale::GetResLocale());
+ static std::locale loc = Translate::Create("sfx");
+ return Translate::get(pId, loc);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 406888d2ba3e..4c9f16e36a3c 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -82,10 +82,6 @@ public:
// application members
SfxFilterMatcher* pMatcher;
-#if HAVE_FEATURE_SCRIPTING
- std::locale aBasicResLocale;
-#endif
- std::locale aSvtResLocale;
SfxErrorHandler *m_pToolsErrorHdl;
SfxErrorHandler *m_pSoErrorHdl;
#if HAVE_FEATURE_SCRIPTING