Changeset 3581


Ignore:
Timestamp:
Mar 25, 2013, 3:56:17 PM (11 years ago)
Author:
gah
Message:

fix regression: was not comparing pattern when compiling list of matching components

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/field.tcl

    r3573 r3581  
    262262    # BE CAREFUL: return component names in proper order
    263263    set rlist ""
    264     set components [$_field children -type component]
     264    set components {}
     265    # First compile a list of valid components that match the pattern
     266    foreach cname [$_field children -type component] {
     267        if { ![info exists _isValidComponent($cname)] } {
     268            continue
     269        }
     270        if { [string match $pattern $cname] } {
     271            lappend components $cname
     272        }
     273    }
     274    # Now handle the tests.
    265275    switch -- $params(what) {
    266276        -name {
    267             foreach cname $components {
    268                 if { [info exists _isValidComponent($cname)] } {
    269                     lappend rlist $cname
    270                 }
    271             }
     277            set rlist $components
    272278        }
    273279        -style {
    274280            foreach cname $components {
    275                 if { ![info exists _isValidComponent($cname)] } {
    276                     continue
    277                 }
    278281                if { [info exists _comp2style($cname)] } {
    279282                    lappend rlist $_comp2style($cname)
Note: See TracChangeset for help on using the changeset viewer.