[Libreoffice-commits] core.git: svx/inc svx/source sw/qa

2021-03-07 Thread shivam-51 (via logerrit)
 svx/inc/inspectorvalues.hrc |4 
 svx/source/sidebar/inspector/InspectorTextPanel.cxx |6 ++
 sw/qa/uitest/styleInspector/styleInspector.py   |8 
 sw/qa/uitest/styleInspector/tdf137513.py|6 +++---
 4 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 8dfad592b4ab0497c140a921b8f56977a383f1d1
Author: shivam-51 
AuthorDate: Fri Feb 5 18:21:50 2021 +0530
Commit: Mike Kaganski 
CommitDate: Sun Mar 7 09:33:49 2021 +0100

tdf#140051 SI property values like "Bold" are now localisable

This patch now allows "Bold", "Italic" and "Normal" to
be localisable.

Change-Id: Icd8102ce84db9a3c68ab69f5f9eadf0cf04755b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110475
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git a/svx/inc/inspectorvalues.hrc b/svx/inc/inspectorvalues.hrc
index 2a6c0d8cb03c..863b13b899e8 100644
--- a/svx/inc/inspectorvalues.hrc
+++ b/svx/inc/inspectorvalues.hrc
@@ -18,6 +18,10 @@
  */
 
 // Node names
+#define RID_NORMAL  
NC_("RID_ATTRIBUTE_NAMES_MAP", "Normal")
+#define RID_BOLD
NC_("RID_ATTRIBUTE_NAMES_MAP", "Bold")
+#define RID_ITALIC  
NC_("RID_ATTRIBUTE_NAMES_MAP", "Italic")
+
 #define RID_FALSE   
NC_("RID_ATTRIBUTE_NAMES_MAP", "False")
 #define RID_TRUE
NC_("RID_ATTRIBUTE_NAMES_MAP", "True")
 
diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx 
b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
index 7b07be9997c4..493c4e37451f 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -79,8 +79,7 @@ static bool GetPropertyValues(const OUString& rPropName, 
const uno::Any& rAny, O
 }
 else if (awt::FontSlant eValue; rAny >>= eValue)
 {
-rString = (eValue == awt::FontSlant_ITALIC) ? 
OUStringLiteral(u"italic")
-: 
OUStringLiteral(u"normal");
+rString = SvxResId(eValue == awt::FontSlant_ITALIC ? RID_ITALIC : 
RID_NORMAL);
 }
 else if (tools::Long nValueLong; rAny >>= nValueLong)
 {
@@ -92,8 +91,7 @@ static bool GetPropertyValues(const OUString& rPropName, 
const uno::Any& rAny, O
 else if (double fValue; rAny >>= fValue)
 {
 if (rPropName.indexOf("Weight") != -1)
-rString
-= (fValue > 100) ? std::u16string_view(u"bold") : 
std::u16string_view(u"normal");
+rString = SvxResId(fValue > 100 ? RID_BOLD : RID_NORMAL);
 else
 rString = OUString::number((round(fValue * 100)) / 100.00);
 }
diff --git a/sw/qa/uitest/styleInspector/styleInspector.py 
b/sw/qa/uitest/styleInspector/styleInspector.py
index 0ab0c0a22719..1b8cc0c68d90 100644
--- a/sw/qa/uitest/styleInspector/styleInspector.py
+++ b/sw/qa/uitest/styleInspector/styleInspector.py
@@ -88,9 +88,9 @@ class styleNavigator(UITestCase):
 self.assertEqual("Char Property Height\t100", 
get_state_as_dict(xTitleStyle.getChild('6'))['Text'])
 self.assertEqual("Char Property Height Asian\t100", 
get_state_as_dict(xTitleStyle.getChild('7'))['Text'])
 self.assertEqual("Char Property Height Complex\t100", 
get_state_as_dict(xTitleStyle.getChild('8'))['Text'])
-self.assertEqual("Char Weight\tbold", 
get_state_as_dict(xTitleStyle.getChild('9'))['Text'])
-self.assertEqual("Char Weight Asian\tbold", 
get_state_as_dict(xTitleStyle.getChild('10'))['Text'])
-self.assertEqual("Char Weight Complex\tbold", 
get_state_as_dict(xTitleStyle.getChild('11'))['Text'])
+self.assertEqual("Char Weight\tBold", 
get_state_as_dict(xTitleStyle.getChild('9'))['Text'])
+self.assertEqual("Char Weight Asian\tBold", 
get_state_as_dict(xTitleStyle.getChild('10'))['Text'])
+self.assertEqual("Char Weight Complex\tBold", 
get_state_as_dict(xTitleStyle.getChild('11'))['Text'])
 self.assertEqual("Follow Style\tText body", 
get_state_as_dict(xTitleStyle.getChild('12'))['Text'])
 self.assertEqual("Para Adjust\t3", 
get_state_as_dict(xTitleStyle.getChild('13'))['Text'])
 self.assertEqual("Para Expand Single Word\tFalse", 
get_state_as_dict(xTitleStyle.getChild('14'))['Text'])
@@ -118,7 +118,7 @@ class styleNavigator(UITestCase):
 self.assertEqual("Char Height\t20", 
get_state_as_dict(xCustomStyle.getChild('2'))['Text'])
 self.assertEqual("Char Property Height\t100", 
get_state_as_dict(xCustomStyle.getChild('3'))['Text'])
 self.assertEqual("Char Transparence\t0", 
get_state_as_dict(xCustomStyle.getChild('4'))['Text'])
-self.assertEqual("Char Weight\tbold", 

[Libreoffice-commits] core.git: svx/inc svx/source sw/qa

2021-01-24 Thread shivam-51 (via logerrit)
 svx/inc/inspectorvalues.hrc |   25 
 svx/source/sidebar/inspector/InspectorTextPanel.cxx |4 ++-
 sw/qa/uitest/styleInspector/styleInspector.py   |8 +++---
 3 files changed, 32 insertions(+), 5 deletions(-)

New commits:
commit 6b6b6f011c313e1a3419bdbe3e50ce09a0fb7d9a
Author: shivam-51 
AuthorDate: Wed Jan 20 17:45:41 2021 +0530
Commit: Mike Kaganski 
CommitDate: Sun Jan 24 20:36:59 2021 +0100

tdf#139136 Style Inspector: "true" and "false" now localizable

Change-Id: Ib223e941ca4285a0eeae9127edc161311f56aa36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109709
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/svx/inc/inspectorvalues.hrc b/svx/inc/inspectorvalues.hrc
new file mode 100644
index ..2a6c0d8cb03c
--- /dev/null
+++ b/svx/inc/inspectorvalues.hrc
@@ -0,0 +1,25 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#define NC_(Context, String) reinterpret_cast(Context "\004" 
u8##String)
+#define NNC_(Context, StringSingular, StringPlural) reinterpret_cast(Context "\004" u8##StringSingular "\004" u8##StringPlural)
+
+/*
+Description: API names for Paragraph, Character
+and Text cursor values
+ */
+
+// Node names
+#define RID_FALSE   
NC_("RID_ATTRIBUTE_NAMES_MAP", "False")
+#define RID_TRUE
NC_("RID_ATTRIBUTE_NAMES_MAP", "True")
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx 
b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
index 4eb4a4889f8c..7c713696320a 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -20,12 +20,14 @@
 #include 
 
 #include 
+#include 
 
 #include 
 
 #include 
 #include 
 #include 
+#include 
 
 using namespace css;
 
@@ -68,7 +70,7 @@ static bool GetPropertyValues(const OUString& rPropName, 
const uno::Any& rAny, O
 
 if (bool bValue; rAny >>= bValue)
 {
-rString = OUString::boolean(bValue);
+rString = SvxResId(bValue ? RID_TRUE : RID_FALSE); // tdf#139136
 }
 else if (OUString aValue; (rAny >>= aValue) && !(aValue.isEmpty()))
 {
diff --git a/sw/qa/uitest/styleInspector/styleInspector.py 
b/sw/qa/uitest/styleInspector/styleInspector.py
index 49337ee61761..0ab0c0a22719 100644
--- a/sw/qa/uitest/styleInspector/styleInspector.py
+++ b/sw/qa/uitest/styleInspector/styleInspector.py
@@ -40,7 +40,7 @@ class styleNavigator(UITestCase):
 xDirFormatting = xListBox.getChild('3')
 self.assertEqual(5, len(xDirFormatting.getChildren()))
 self.assertEqual("Char Back Color\t0x00", 
get_state_as_dict(xDirFormatting.getChild('0'))['Text'])
-self.assertEqual("Char Back Transparent\tfalse", 
get_state_as_dict(xDirFormatting.getChild('1'))['Text'])
+self.assertEqual("Char Back Transparent\tFalse", 
get_state_as_dict(xDirFormatting.getChild('1'))['Text'])
 self.assertEqual("Char Color\t0xc9211e", 
get_state_as_dict(xDirFormatting.getChild('2'))['Text'])
 self.assertEqual("Char Shading Value\t0", 
get_state_as_dict(xDirFormatting.getChild('3'))['Text'])
 self.assertEqual("Char Transparence\t0", 
get_state_as_dict(xDirFormatting.getChild('4'))['Text'])
@@ -57,9 +57,9 @@ class styleNavigator(UITestCase):
 self.assertEqual(7, len(xParDirFormatting.getChildren()))
 self.assertEqual("Fill Color\t0xff", 
get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
 self.assertEqual("Para Back Color\t0xff", 
get_state_as_dict(xParDirFormatting.getChild('1'))['Text'])
-self.assertEqual("Para Back Transparent\tfalse", 
get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
+self.assertEqual("Para Back Transparent\tFalse", 
get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
 self.assertEqual("Para First Line Indent\t0", 
get_state_as_dict(xParDirFormatting.getChild('3'))['Text'])
-self.assertEqual("Para is Auto First Line Indent\tfalse", 
get_state_as_dict(xParDirFormatting.getChild('4'))['Text'])
+self.assertEqual("Para is Auto First Line Indent\tFalse", 
get_state_as_dict(xParDirFormatting.getChild('4'))['Text'])
 self.assertEqual("Para Left Margin\t1482", 
get_state_as_dict(xParDirFormatting.getChild('5'))['Text'])
 self.assertEqual("Para Right Margin\t0",