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 <mike.kaganski@collabora.com>
Tested-by: Jenkins
diff --git a/svx/inc/inspectorvalues.hrc b/svx/inc/inspectorvalues.hrc
index 2a6c0d8..863b13b 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 7b07be9..493c4e3 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -79,8 +79,7 @@
}
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 @@
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 0ab0c0a..1b8cc0c 100644
--- a/sw/qa/uitest/styleInspector/styleInspector.py
+++ b/sw/qa/uitest/styleInspector/styleInspector.py
@@ -88,9 +88,9 @@
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 @@
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", get_state_as_dict(xCustomStyle.getChild('5'))['Text'])
self.assertEqual("Char Weight\tBold", get_state_as_dict(xCustomStyle.getChild('5'))['Text'])
self.assertEqual("Follow Style\tCustom_Style", get_state_as_dict(xCustomStyle.getChild('6'))['Text'])
self.assertEqual(7, len(xListBox.getChild('0').getChild('2').getChildren()))
diff --git a/sw/qa/uitest/styleInspector/tdf137513.py b/sw/qa/uitest/styleInspector/tdf137513.py
index 2d4fb4d..b3884e0 100644
--- a/sw/qa/uitest/styleInspector/tdf137513.py
+++ b/sw/qa/uitest/styleInspector/tdf137513.py
@@ -45,9 +45,9 @@
# Without the fix in place, this test would have failed here with
# AssertionError: 3 != 0
self.assertEqual(3, len(xParDirFormatting.getChildren()))
self.assertEqual("Char Weight\tbold", get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
self.assertEqual("Char Weight Asian\tbold", get_state_as_dict(xParDirFormatting.getChild('1'))['Text'])
self.assertEqual("Char Weight Complex\tbold", get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
self.assertEqual("Char Weight\tBold", get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
self.assertEqual("Char Weight Asian\tBold", get_state_as_dict(xParDirFormatting.getChild('1'))['Text'])
self.assertEqual("Char Weight Complex\tBold", get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
self.assertEqual(0, len(xListBox.getChild('3').getChildren()))