From aba91fdc7f3174df76d7bae60e2c7eeca08cd047 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 25 Jun 2026 11:15:58 +0200 Subject: [PATCH] tdf#130857 ui-rules-enforcer: Check column doesn't have multiple same renderers Add a check to the UI rules enforcer that checks that no column (GtkTreeViewColumn) contains multiple renderers of the same type, e.g. no 2 GtkCellRendererToggle. This wouldn't work at least with the qt weld implementation as that one maps the different types of renderers to a role, but setting/displaying multiple different values for the same role in the same column isn't possible. All previously detected occurences (that had dummy columns for other reasons) were addressed in previous commits, so there is currently no such issue left. Adding the check can help to identify/avoid new issues in the future. Change-Id: I637e50477ce41a7ceca8f9cf5830e383b5393c69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207309 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- bin/ui-rules-enforcer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/ui-rules-enforcer.py b/bin/ui-rules-enforcer.py index 9642008fa2c6..3e4fa505ca6c 100755 --- a/bin/ui-rules-enforcer.py +++ b/bin/ui-rules-enforcer.py @@ -664,6 +664,11 @@ def enforce_treeview_column_rules(current): if len(columns[0]) >= 2 and columns[0][0] == "GtkCellRendererPixbuf" and columns[0][1] == "GtkCellRendererToggle": raise Exception(sys.argv[1] + ": treeview has special toggle and pixbuf columns/renderers in wrong order: ", current.attrib.get("id")) + # ensure that column don't contain multiple cell renderers of the same type + for col in columns: + if len(col) != len(set(col)): + raise Exception(sys.argv[1] + ": Multiple cell renderers of the same type not supported in one column: ", current.attrib.get("id")) + with open(sys.argv[1], encoding="utf-8") as f: header = f.readline() f.seek(0)