summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-12-13 19:17:48 +0100
committerMichael Meeks <michael.meeks@collabora.com>2017-12-14 11:31:50 +0100
commiteaccbef4f4f9509152efb7613f2ff48a2d6e7a5e (patch)
tree458e6f8eebde83eb7e9667a3091e5dd1305eb3b2 /svtools
parent689176e9424e617a64edd5e233b750b2269a7275 (diff)
lokdialog: Allow switching language of some of the ResMgr's.
This way, it is possible to have all the strings translated in dialogs even when different users use different languages. [It was already possible to have different languages previously, but not everything in the dialog has switched - like the buttons at the bottom of the dialogs etc.] Change-Id: I29a5ae6d31a370eec60397884200b684ec1bf5b9 Reviewed-on: https://gerrit.libreoffice.org/46417 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/svtresid.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/svtools/source/misc/svtresid.cxx b/svtools/source/misc/svtresid.cxx
index 24906fd8eef5..e727d95ce461 100644
--- a/svtools/source/misc/svtresid.cxx
+++ b/svtools/source/misc/svtresid.cxx
@@ -22,15 +22,16 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
-static ResMgr* pMgr=nullptr;
+static std::unique_ptr<ResMgr> pMgr;
namespace
{
ResMgr* getResMgr(const LanguageTag& aLocale)
{
- if (!pMgr)
- pMgr = ResMgr::CreateResMgr("svt", aLocale );
- return pMgr;
+ if (!pMgr || pMgr->GetLocale() != aLocale)
+ pMgr.reset(ResMgr::CreateResMgr("svt", aLocale));
+
+ return pMgr.get();
}
ResMgr* getResMgr()
@@ -46,7 +47,7 @@ SvtResId::SvtResId(sal_uInt16 nId) :
void SvtResId::DeleteResMgr()
{
- DELETEZ( pMgr );
+ pMgr.reset();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */