add a rule to enforce not sharing adjustments between widgets

Change-Id: I44e9548c41de2ea4816d5b87d7491ad06a46f111
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125204
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2021-11-15 12:35:08 +01:00
parent 2a8506c2f2
commit 90705b6772
+11
View File
@@ -513,6 +513,16 @@ def enforce_button_always_show_image(current):
else:
always_show_image.text = "True"
def enforce_noshared_adjustments(current, adjustments):
for child in current:
enforce_noshared_adjustments(child, adjustments)
if child.tag == "property":
attributes = child.attrib
if attributes.get("name") == "adjustment":
if child.text in adjustments:
raise Exception(sys.argv[1] + ': adjustment used more than once', child.text)
adjustments.add(child.text)
with open(sys.argv[1], encoding="utf-8") as f:
header = f.readline()
f.seek(0)
@@ -549,6 +559,7 @@ remove_skip_pager_hint(root)
remove_toolbutton_focus(root)
enforce_toolbar_can_focus(root)
enforce_button_always_show_image(root)
enforce_noshared_adjustments(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