desktop/source/lib/init.cxx                    |    2 +-
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |    2 +-
 sc/source/ui/docshell/docsh4.cxx               |    2 +-
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   18 ++++++++++++++++++
 sw/source/uibase/shells/textsh1.cxx            |   13 +++++++++++++
 5 files changed, 34 insertions(+), 3 deletions(-)

New commits:
commit 7ba1057fb975cef2eb24345a3742ae9aee3610af
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Aug 28 15:22:20 2019 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Aug 29 15:16:16 2019 +0200

    sw lok: extend language status with BCP 47 language tag info in here as well
    
    This brings Writer in sync with Calc, which does this since commit
    47025060e4474d23e3bd97053a77b3943eeae724 (Send Bcp47 codes with region,
    2019-08-28).
    
    (cherry picked from commit f38566826cdd257214298c583a1ce8ae6715713c)
    
    Change-Id: I615af4a0692216f794c78955d337e6b8dbc8db5e
    Reviewed-on: https://gerrit.libreoffice.org/78257
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index d5d5049fb691..a9ca888840eb 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -42,6 +42,7 @@
 #include <vcl/scheduler.hxx>
 #include <vcl/vclevent.hxx>
 #include <vcl/bitmapaccess.hxx>
+#include <svx/svxids.hrc>
 #include <flddat.hxx>
 #include <basesh.hxx>
 
@@ -115,6 +116,7 @@ public:
     void testVisCursorInvalidation();
     void testSemiTransparent();
     void testAnchorTypes();
+    void testLanguageStatus();
 
     CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
     CPPUNIT_TEST(testRegisterCallback);
@@ -173,6 +175,7 @@ public:
     CPPUNIT_TEST(testVisCursorInvalidation);
     CPPUNIT_TEST(testSemiTransparent);
     CPPUNIT_TEST(testAnchorTypes);
+    CPPUNIT_TEST(testLanguageStatus);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -2502,6 +2505,21 @@ void SwTiledRenderingTest::testAnchorTypes()
     CPPUNIT_ASSERT(!aSet.HasItem(FN_TOOL_ANCHOR_PAGE));
 }
 
+void SwTiledRenderingTest::testLanguageStatus()
+{
+    comphelper::LibreOfficeKit::setActive();
+    SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
+    SwView* pView = pXTextDocument->GetDocShell()->GetView();
+    std::unique_ptr<SfxPoolItem> pItem;
+    pView->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, 
pItem);
+    auto pStringListItem = dynamic_cast<SfxStringListItem*>(pItem.get());
+    CPPUNIT_ASSERT(pStringListItem);
+
+    uno::Sequence< OUString > aList;
+    pStringListItem->GetStringList(aList);
+    CPPUNIT_ASSERT_EQUAL(OUString("English (USA);en-US"), aList[0]);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 3a6966bb967f..830a04d86471 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1422,7 +1422,20 @@ void SwTextShell::GetState( SfxItemSet &rSet )
                 OUString aCurrentLang = "*";
                 nLang = SwLangHelper::GetCurrentLanguage( rSh );
                 if (nLang != LANGUAGE_DONTKNOW)
+                {
                     aCurrentLang = SvtLanguageTable::GetLanguageString( nLang 
);
+                    if (comphelper::LibreOfficeKit::isActive())
+                    {
+                        if (nLang == LANGUAGE_NONE)
+                        {
+                            aCurrentLang += ";-";
+                        }
+                        else
+                        {
+                            aCurrentLang += ";" + 
LanguageTag(nLang).getBcp47(false);
+                        }
+                    }
+                }
 
                 // build sequence for status value
                 uno::Sequence< OUString > aSeq( 4 );
commit ed8fd321a7fe200e4f10733afa2fe0867ed1c322
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Wed Aug 28 14:36:42 2019 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Aug 29 15:16:07 2019 +0200

    Send Bcp47 codes with region
    
    Change-Id: I816eddab3d88534bff6c1f1dba81b45107cdb372
    Reviewed-on: https://gerrit.libreoffice.org/78227
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit 47025060e4474d23e3bd97053a77b3943eeae724)
    Reviewed-on: https://gerrit.libreoffice.org/78256
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ba82cfc8e0b4..43e3168a49ad 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3847,7 +3847,7 @@ static char* getLanguages(const char* pCommand)
         if (sLanguage.startsWith("{") && sLanguage.endsWith("}"))
             continue;
 
-        sLanguage += ";" + LanguageTag(aLocales[itLocale]).getLanguage();
+        sLanguage += ";" + LanguageTag(aLocales[itLocale]).getBcp47(false);
         aChild.put("", sLanguage.toUtf8());
         aValues.push_back(std::make_pair("", aChild));
     }
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index aa4744cfbdfc..c23525adbd59 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1492,7 +1492,7 @@ void ScTiledRenderingTest::testLanguageStatus()
     SfxLokHelper::createView();
     SfxViewShell* pView2 = SfxViewShell::Current();
     CPPUNIT_ASSERT(pView1 != pView2);
-    const OUString aLangBolivia("Spanish (Bolivia);es");
+    const OUString aLangBolivia("Spanish (Bolivia);es-BO");
     {
         std::unique_ptr<SfxPoolItem> xItem1;
         std::unique_ptr<SfxPoolItem> xItem2;
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 2127e430cb52..3676e384dde2 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2007,7 +2007,7 @@ void ScDocShell::GetState( SfxItemSet &rSet )
                         if (eLatin == LANGUAGE_NONE)
                             sLanguage += ";-";
                         else
-                            sLanguage += ";" + 
LanguageTag(eLatin).getLanguage();
+                            sLanguage += ";" + 
LanguageTag(eLatin).getBcp47(false);
                     }
                     rSet.Put(SfxStringItem(nWhich, sLanguage));
                 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to