bin/ui-rules-enforcer.py |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 408be00b15ec44c9750450fc4dba70120dd0e978
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Jun 25 16:59:45 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Jun 25 21:30:00 2021 +0200

    add no max-length property in GtkSpinButton rule
    
    Change-Id: I49ef02102620d6f455758a136d980b2c39b076df
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117910
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/bin/ui-rules-enforcer.py b/bin/ui-rules-enforcer.py
index f2da99524737..020c10cd14a4 100755
--- a/bin/ui-rules-enforcer.py
+++ b/bin/ui-rules-enforcer.py
@@ -224,6 +224,22 @@ def remove_spin_button_input_purpose(current):
     if input_purpose != None:
       current.remove(input_purpose)
 
+def remove_spin_button_max_length(current):
+  max_length = None
+  isspinbutton = current.get('class') == "GtkSpinButton"
+  for child in current:
+    remove_spin_button_max_length(child)
+    if not isspinbutton:
+        continue
+    if child.tag == "property":
+      attributes = child.attrib
+      if attributes.get("name") == "max_length" or attributes.get("name") == 
"max-length":
+        max_length = child
+
+  if isspinbutton:
+    if max_length != None:
+      current.remove(max_length)
+
 def remove_track_visited_links(current):
   track_visited_links = None
   islabel = current.get('class') == "GtkLabel"
@@ -366,6 +382,7 @@ replace_image_stock(root)
 remove_check_button_align(root)
 remove_check_button_relief(root)
 remove_spin_button_input_purpose(root)
+remove_spin_button_max_length(root)
 remove_track_visited_links(root)
 remove_expander_label_fill(root)
 remove_expander_spacing(root)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to