diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-07-26 15:26:40 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-08-28 18:04:47 +0200 |
commit | 52d7c6be46663d4a28745a0cfa2ced5493637230 (patch) | |
tree | b2edfc49121f4cbe95d00e02032c1945441b13a7 /sd | |
parent | b82489382e18494694530874480774e2bb29830e (diff) |
sd lok: extend language status with BCP 47 language tag info in here as well
This brings Impress in sync with Calc, which does this since commit
47025060e4474d23e3bd97053a77b3943eeae724 (Send Bcp47 codes with region,
2019-08-28).
Change-Id: I04b92c85b6627e145b5271a6f84780257e8f0d55
Reviewed-on: https://gerrit.libreoffice.org/78231
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/docshell/docshell.cxx | 15 |
2 files changed, 19 insertions, 2 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index af443317b94e..e5783a1731b3 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -1891,7 +1891,11 @@ void SdTiledRenderingTest::testLanguageStatus() std::unique_ptr<SfxPoolItem> xItem2; pView1->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, xItem1); pView2->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, xItem2); - CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(xItem1.get())); + auto pStringItem = dynamic_cast<const SfxStringItem*>(xItem1.get()); + CPPUNIT_ASSERT(pStringItem); + + CPPUNIT_ASSERT_EQUAL(OUString("English (USA);en-US"), pStringItem->GetValue()); + CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(xItem2.get())); } } diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index 5b5ddfdce17e..ad0ce701bdfe 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -60,6 +60,7 @@ #include <OutlineView.hxx> #include <ViewShellBase.hxx> #include <sfx2/notebookbar/SfxNotebookBar.hxx> +#include <comphelper/lok.hxx> using namespace sd; #define ShellClass_DrawDocShell @@ -284,7 +285,19 @@ void DrawDocShell::GetState(SfxItemSet &rSet) eLanguage = mpDoc->GetLanguage( EE_CHAR_LANGUAGE ); } - rSet.Put(SfxStringItem(nWhich, SvtLanguageTable::GetLanguageString(eLanguage))); + OUString aLanguage = SvtLanguageTable::GetLanguageString(eLanguage); + if (comphelper::LibreOfficeKit::isActive()) + { + if (eLanguage == LANGUAGE_DONTKNOW) + { + aLanguage += ";-"; + } + else + { + aLanguage += ";" + LanguageTag(eLanguage).getBcp47(false); + } + } + rSet.Put(SfxStringItem(nWhich, aLanguage)); } break; |