summaryrefslogtreecommitdiff
path: root/sfx2/source/view
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-19 17:23:01 +0100
commite16852cd1bc5d9e0646ae4183bc13a7bce19df7f (patch)
tree07e7ada37599b825459358b5fa89cc5b11b3bf9d /sfx2/source/view
parent193ebf963cf251fd0885b47e59d9db11a97450f2 (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> Reviewed-on: https://gerrit.libreoffice.org/46775 Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sfx2/source/view')
-rw-r--r--sfx2/source/view/lokhelper.cxx17
-rw-r--r--sfx2/source/view/viewsh.cxx1
2 files changed, 18 insertions, 0 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 135c36003192..cd672aaf91e1 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -69,6 +69,9 @@ void SfxLokHelper::setView(int nId)
{
if ((sal_Int32)pViewShell->GetViewShellId() == nViewShellId)
{
+ // update the current LOK language for the dialog tunneling
+ comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
+
if (pViewShell == SfxViewShell::Current())
return;
@@ -120,6 +123,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() == ViewShellId(nId))
+ {
+ pViewShell->SetLOKLanguageTag(rBcp47LanguageTag);
+ return;
+ }
+ }
+}
+
void SfxLokHelper::notifyOtherView(SfxViewShell* pThisView, SfxViewShell const* pOtherView, int nType, const OString& rKey, const OString& rPayload)
{
OString aPayload = OString("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView(pThisView)) +
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 7c3b25eedaa6..8060a330f132 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1059,6 +1059,7 @@ SfxViewShell::SfxViewShell
, pWindow(nullptr)
, bNoNewWindow( nFlags & SfxViewShellFlags::NO_NEWWINDOW )
, mbPrinterSettingsModified(false)
+, maLOKLanguageTag("en-US", true)
{
SetMargin( pViewFrame->GetMargin_Impl() );