sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit c6b6995004d34cadaec68e2b6e17667d43f9995e
Author:     Aron Budea <aron.bu...@collabora.com>
AuthorDate: Sat Sep 19 15:58:32 2020 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Sep 19 23:24:23 2020 +0200

    tdf#136596: show document language (char locale) in the inspector
    
    Change-Id: I80c6df216c5a6725f57c16fc134c3124ead76dfd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103035
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index 589cec4a967c..d7b3990aa5e3 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -350,6 +350,20 @@ static svx::sidebar::TreeNode BorderToTreeNode(const 
OUString& rName, const css:
     return aCurNode;
 }
 
+static svx::sidebar::TreeNode LocaleToTreeNode(const OUString& rName, const 
css::uno::Any& rVal)
+{
+    svx::sidebar::TreeNode aCurNode;
+    aCurNode.sNodeName = PropertyNametoRID(rName);
+    lang::Locale aLocale;
+    rVal >>= aLocale;
+    OUString aLocaleText(aLocale.Language + "-" + aLocale.Country);
+    if (!aLocale.Variant.isEmpty())
+        aLocaleText += " (" + aLocale.Variant + ")";
+    aCurNode.aValue <<= aLocaleText;
+
+    return aCurNode;
+}
+
 static svx::sidebar::TreeNode
 PropertyToTreeNode(const css::beans::Property& rProperty,
                    const uno::Reference<beans::XPropertySet>& xPropertiesSet, 
const bool& rIsGrey)
@@ -367,6 +381,10 @@ PropertyToTreeNode(const css::beans::Property& rProperty,
     {
         aCurNode = BorderToTreeNode(rPropName, aAny);
     }
+    else if (rPropName == "CharLocale")
+    {
+        aCurNode = LocaleToTreeNode(rPropName, aAny);
+    }
     else
         aCurNode = SimplePropToTreeNode(rPropName, aAny);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to