diff options
author | Aron Budea <aron.budea@collabora.com> | 2020-09-19 15:58:32 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-09-19 23:24:23 +0200 |
commit | c6b6995004d34cadaec68e2b6e17667d43f9995e (patch) | |
tree | b24af2fa529ae1e94c6efded09b0b9da73c47405 | |
parent | bb369dd4f372f606a9a63ecefbd1c7d3b725cd02 (diff) |
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.kaganski@collabora.com>
-rw-r--r-- | sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
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); |