summaryrefslogtreecommitdiff
path: root/sfx2/source/view/lokhelper.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-12-12 18:13:03 +0100
committerMichael Meeks <michael.meeks@collabora.com>2017-12-12 18:26:49 +0100
commitf01e4365be66e666b1671279b8605f0113dfd8fa (patch)
treec4baf2ff02995eb2e22d7bfef3304a053cf1cfe1 /sfx2/source/view/lokhelper.cxx
parent789c68003818fa1a5cb17d234d80035006c7e585 (diff)
lokdialog: Allow windows / dialogs in different languages.
Change-Id: I9f32161981aed73e6d97696e5f976af276d1625a Reviewed-on: https://gerrit.libreoffice.org/46327 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sfx2/source/view/lokhelper.cxx')
-rw-r--r--sfx2/source/view/lokhelper.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 73e7a170412c..f91d757697a2 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -61,6 +61,9 @@ void SfxLokHelper::setView(int nId)
{
if (pViewShell->GetViewShellId() == nViewShellId)
{
+ // update the current LOK language for the dialog tunneling
+ comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
+
if (pViewShell == SfxViewShell::Current())
return;
@@ -108,6 +111,20 @@ bool SfxLokHelper::getViewIds(int* pArray, size_t nSize)
return true;
}
+void SfxLokHelper::setViewLanguage(int nId, const OUString& rBcp47LanguageTag)
+{
+ SfxViewShellArr_Impl& rViewArr = SfxGetpApp()->GetViewShells_Impl();
+
+ for (SfxViewShell* pViewShell : rViewArr)
+ {
+ if (pViewShell->GetViewShellId() == static_cast<unsigned>(nId))
+ {
+ pViewShell->SetLOKLanguageTag(rBcp47LanguageTag);
+ return;
+ }
+ }
+}
+
void SfxLokHelper::notifyOtherView(SfxViewShell* pThisView, SfxViewShell* pOtherView, int nType, const OString& rKey, const OString& rPayload)
{
OString aPayload = OString("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView(pThisView)) +