svx/source/dialog/dialmgr.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
New commits: commit 5022038726af951bf6ec06d94219c1d387349e28 Author: Andras Timar <andras.ti...@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 <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@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: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits