From 1c5e85db6beede28d883c6bc3d01a69ad72c9c76 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 10 Apr 2012 22:12:19 +0200 Subject: [PATCH] PspppireSelector: Prevent selection of disallowed entries. We had been relying on the deselected state of the widget to prevent selection with the "allow" predicate was false. But clicking the widget itself isn't the only way items can be selected (double clicking the item for example). This change adds a test at a lower level to prevent selection of disallowed items. --- src/ui/gui/psppire-selector.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/gui/psppire-selector.c b/src/ui/gui/psppire-selector.c index 7b30106013..a5ac034c88 100644 --- a/src/ui/gui/psppire-selector.c +++ b/src/ui/gui/psppire-selector.c @@ -584,6 +584,10 @@ select_selection (PsppireSelector *selector) g_return_if_fail (selector->select_items); + if (selector->allow_selection && + ! selector->allow_selection (selector->source, selector->dest)) + return; + selector->selecting = TRUE; for (item = g_list_first (selected_rows); -- 2.30.2