[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - editeng/source
Aron Budea
aron.budea at collabora.com
Thu Jun 7 07:41:32 UTC 2018
editeng/source/editeng/eerdll.cxx | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
New commits:
commit 03e81df3441a8175770edd522f592f243b5f9082
Author: Aron Budea <aron.budea at collabora.com>
Date: Wed Jun 6 16:50:20 2018 +0200
lokdialog: Allow switching language of editengine ResMgr
Change-Id: I48603cdff916c242dc20fe16fdaffaa9effa6f74
Reviewed-on: https://gerrit.libreoffice.org/55386
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index b9aa26dcc9f4..95758ef7f1e4 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -20,6 +20,7 @@
#include <vcl/wrkwin.hxx>
#include <vcl/dialog.hxx>
+#include <vcl/lazydelete.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
@@ -216,13 +217,14 @@ EditDLL::~EditDLL()
delete pGlobalData;
}
-static ResMgr* pResMgr=nullptr;
-
ResMgr* EditDLL::GetResMgr()
{
- if (!pResMgr)
- pResMgr = ResMgr::CreateResMgr("editeng", Application::GetSettings().GetUILanguageTag());
- return pResMgr;
+ static vcl::DeleteOnDeinit<ResMgr> pResourceManager(nullptr);
+ const LanguageTag& rLocale = Application::GetSettings().GetUILanguageTag();
+ if (!pResourceManager.get() || pResourceManager.get()->GetLocale() != rLocale)
+ pResourceManager.reset(ResMgr::CreateResMgr("editeng", Application::GetSettings().GetUILanguageTag()));
+ OSL_ASSERT(pResourceManager.get());
+ return pResourceManager.get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list