diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-01-03 14:08:55 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-01-05 09:51:23 +0100 |
commit | 028fd03cdf4d3d8072289a5c4d476435c18f90d0 (patch) | |
tree | ee455db401fc6a9cfca565c9496bfe49dfa3d780 /sfx2 | |
parent | f1d1854ffe2c1bc456855573b3ed4ad9852f4571 (diff) |
lokdialog: Allow language switching in SfxModule(s).
Change-Id: Icef0b3610c3bfa858cdd61de6ef3f5edc1e3c96b
Reviewed-on: https://gerrit.libreoffice.org/47385
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/module.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index ef37f8e41ada..3fb4376cc7a1 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -48,6 +48,7 @@ public: SfxTbxCtrlFactArr_Impl* pTbxCtrlFac; SfxStbCtrlFactArr_Impl* pStbCtrlFac; SfxChildWinFactArr_Impl* pFactArr; + OString maResName; SfxModule_Impl(); ~SfxModule_Impl(); @@ -68,11 +69,10 @@ SfxModule_Impl::~SfxModule_Impl() SFX_IMPL_SUPERCLASS_INTERFACE(SfxModule, SfxShell) -SfxModule::SfxModule(const std::locale& rLocale, std::initializer_list<SfxObjectFactory*> pFactoryList) - : m_aResLocale(rLocale) - , pImpl(nullptr) +SfxModule::SfxModule(const OString& rResName, std::initializer_list<SfxObjectFactory*> pFactoryList) + : pImpl(nullptr) { - Construct_Impl(); + Construct_Impl(rResName); for (auto pFactory : pFactoryList) { if (pFactory) @@ -80,7 +80,7 @@ SfxModule::SfxModule(const std::locale& rLocale, std::initializer_list<SfxObject } } -void SfxModule::Construct_Impl() +void SfxModule::Construct_Impl(const OString& rResName) { SfxApplication *pApp = SfxApplication::GetOrCreate(); pImpl = new SfxModule_Impl; @@ -89,6 +89,7 @@ void SfxModule::Construct_Impl() pImpl->pTbxCtrlFac=nullptr; pImpl->pStbCtrlFac=nullptr; pImpl->pFactArr=nullptr; + pImpl->maResName = rResName; SetPool( &pApp->GetPool() ); } @@ -102,6 +103,11 @@ SfxModule::~SfxModule() } } +std::locale SfxModule::GetResLocale() const +{ + return Translate::Create(pImpl->maResName.getStr()); +} + SfxSlotPool* SfxModule::GetSlotPool() const { return pImpl->pSlotPool; |