[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sd/qa sd/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 29 15:00:13 UTC 2019


 sd/qa/unit/tiledrendering/tiledrendering.cxx |    6 +++++-
 sd/source/ui/docshell/docshell.cxx           |   15 ++++++++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 14b8204c253490625c8f84015c5879e9bd639934
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Fri Jul 26 15:26:40 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Aug 29 16:59:33 2019 +0200

    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).
    
    (cherry picked from commit 52d7c6be46663d4a28745a0cfa2ced5493637230)
    
    Change-Id: I04b92c85b6627e145b5271a6f84780257e8f0d55
    Reviewed-on: https://gerrit.libreoffice.org/78258
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 506609618450..6ce5916612b1 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1903,7 +1903,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 ef981118f6d3..13e9dcd72771 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -73,6 +73,7 @@
 #include <OutlineView.hxx>
 #include <ViewShellBase.hxx>
 #include <sfx2/notebookbar/SfxNotebookBar.hxx>
+#include <comphelper/lok.hxx>
 
 using namespace sd;
 #define ShellClass_DrawDocShell
@@ -298,7 +299,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;
 


More information about the Libreoffice-commits mailing list