]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/ButtonController.C
try this for distinguishing inner and outer tabs
[lyx.git] / src / frontends / xforms / ButtonController.C
index b844ac0ac3db734803aa9fb1c726e8cba9d6789a..9e497995c696114b4c67983614481b5ea208383c 100644 (file)
@@ -1,5 +1,7 @@
 #include <config.h>
 
+#include <algorithm>
+
 #include FORMS_H_LOCATION
 
 #ifdef __GNUG__
@@ -17,7 +19,7 @@ using std::vector;
 ButtonController::ButtonController(ButtonPolicy * bp,
                                   char const * cancel, char const * close)
        : bp_(bp), okay_(0), apply_(0), cancel_(0), undo_all_(0),
-         read_only_(), trigger_change_(),
+         read_only_(), dont_trigger_change_(),
          cancel_label(cancel), close_label(close)
 {
        Assert(bp);
@@ -148,13 +150,14 @@ void ButtonController::readWrite()
 
 bool ButtonController::valid(bool v, FL_OBJECT * obj)
 { 
-       if (obj && !trigger_change_.empty()) {
+       if (obj && !dont_trigger_change_.empty()) {
                vector<FL_OBJECT *>::const_iterator cit =
-                       find(trigger_change_.begin(), trigger_change_.end(),
+                       find(dont_trigger_change_.begin(),
+                            dont_trigger_change_.end(),
                             obj);
 
-               // Only trigger a change if the obj is in the list
-               if (cit != trigger_change_.end()) {
+               // Only trigger a change if the obj is not in the list
+               if (cit == dont_trigger_change_.end()) {
                        if (v) {
                                input(ButtonPolicy::SMI_VALID);
                        } else {