summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-01-25 10:24:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-01-25 13:24:23 +0100
commitc7fcd5a3bdbf181817ce6e5d2067434d480287a6 (patch)
treec70bcf35b102de68dc26709040016faadecf0f99 /bin
parentea09bad389ee1af19e5e626905e4d67bcc94636e (diff)
Related: tdf#146971 remove %PRODUCTNAME from accessible-description
Change-Id: I83ff18c8b5e95fa172de950eb351cbfd855c9d5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128919 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ui-rules-enforcer.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/ui-rules-enforcer.py b/bin/ui-rules-enforcer.py
index 15b04c65bd1d..c571e9748973 100755
--- a/bin/ui-rules-enforcer.py
+++ b/bin/ui-rules-enforcer.py
@@ -525,6 +525,15 @@ def enforce_noshared_adjustments(current, adjustments):
raise Exception(sys.argv[1] + ': adjustment used more than once', child.text)
adjustments.add(child.text)
+def enforce_no_productname_in_accessible_description(current, adjustments):
+ for child in current:
+ enforce_no_productname_in_accessible_description(child, adjustments)
+ if child.tag == "property":
+ attributes = child.attrib
+ if attributes.get("name") == "AtkObject::accessible-description":
+ if "%PRODUCTNAME" in child.text:
+ raise Exception(sys.argv[1] + ': %PRODUCTNAME used in accessible-description:' , child.text)
+
with open(sys.argv[1], encoding="utf-8") as f:
header = f.readline()
f.seek(0)
@@ -562,6 +571,7 @@ remove_toolbutton_focus(root)
enforce_toolbar_can_focus(root)
enforce_button_always_show_image(root)
enforce_noshared_adjustments(root, set())
+enforce_no_productname_in_accessible_description(root, set())
with open(sys.argv[1], 'wb') as o:
# without encoding='unicode' (and the matching encode("utf8")) we get &#XXXX replacements for non-ascii characters