PspppireSelector: Prevent selection of disallowed entries. 20120412030503/pspp 20120413030504/pspp
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 10 Apr 2012 20:12:19 +0000 (22:12 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 11 Apr 2012 15:44:19 +0000 (17:44 +0200)
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

index 7b30106013b21297cd9085a9008856b02de04511..a5ac034c888e8cb36a75fcadbdbbc160e59c6b90 100644 (file)
@@ -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);