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 <m.weghorn@posteo.de>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user