From 477fb12c00c792fc64240e083bcf706cee0f8173 Mon Sep 17 00:00:00 2001 From: nikicc Date: Fri, 1 Jul 2016 14:21:41 +0200 Subject: [PATCH] SelectRows: Index attrs only by visible in set_data In `set_data` we calculate the index of an attribute that is passed to `add_rows`. Since `add_rows` only consider visible attributes the index has to be calculated only on visible as well. Otherwise this caused `attr_combo.setCurrentIndex` to be set to values larger than the number of items inside it. Strangely this works but causes `attr_combo.currentText()` to returns an empty string which of course breaks indexing on domain. --- Orange/widgets/data/owselectrows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Orange/widgets/data/owselectrows.py b/Orange/widgets/data/owselectrows.py index b6c366ca34f..401cc978e2b 100644 --- a/Orange/widgets/data/owselectrows.py +++ b/Orange/widgets/data/owselectrows.py @@ -319,7 +319,7 @@ def set_data(self, data): self.update_info(data, self.data_in_variables, "In: ") for attr, cond_type, cond_value in self.conditions: attrs = [a.name for a in - data.domain.variables + data.domain.metas] + filter_visible(chain(data.domain.variables, data.domain.metas))] if attr in attrs: self.add_row(attrs.index(attr), cond_type, cond_value) self.unconditional_commit()