summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-01-03 14:08:55 +0100
committerAndras Timar <andras.timar@collabora.com>2018-03-20 15:50:30 +0100
commit23b811466e53a30efde898a6fd9b3a55aff33a38 (patch)
tree5220e6f51276c4a48e2b0c9d2cf78197ab59b0b2 /sfx2
parent5eca99187e576389a33e73e3053a29dfd2b417e0 (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> (cherry picked from commit 028fd03cdf4d3d8072289a5c4d476435c18f90d0)
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/module.cxx16
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;