[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - svx/source

Andras Timar andras.timar at collabora.com
Tue Jan 2 14:33:02 UTC 2018


 svx/source/dialog/dialmgr.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 5022038726af951bf6ec06d94219c1d387349e28
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu Dec 28 15:55:44 2017 +0100

    lokdialog: Allow switching language of svx ResMgr
    
    Change-Id: I4409abcaa592fd4ac7bb69e8f70d5b2c227c087d
    Reviewed-on: https://gerrit.libreoffice.org/47142
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/svx/source/dialog/dialmgr.cxx b/svx/source/dialog/dialmgr.cxx
index e683a72fab3c..150022b6ecce 100644
--- a/svx/source/dialog/dialmgr.cxx
+++ b/svx/source/dialog/dialmgr.cxx
@@ -22,13 +22,15 @@
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
 
-static ResMgr* pResMgr=nullptr;
+static std::unique_ptr<ResMgr> pResMgr;
 
 ResMgr* DialogsResMgr::GetResMgr()
 {
-    if (!pResMgr)
-        pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag());
-    return pResMgr;
+    const LanguageTag& rLocale = Application::GetSettings().GetUILanguageTag();
+
+    if (!pResMgr || pResMgr->GetLocale() != rLocale)
+        pResMgr.reset(ResMgr::CreateResMgr("svx", rLocale));
+    return pResMgr.get();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list