Changeset 1613 for trunk/gui/scripts


Ignore:
Timestamp:
Nov 10, 2009, 9:47:30 AM (15 years ago)
Author:
dkearney
Message:

fix for rappture automatic ticket #256452. if we receive no data in the xy
curve object, we don't add empty data to the list of curves. this also affects
xvector and yvector objects that have unequal lengths. if this is encountered,
we don't add the curve to the list of curves. we also no not tell the user
there was an error.

adding file nodata.xml which showed the error described in the automatic
ticket.

File:
1 edited

Legend:

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

    r1587 r1613  
    237237            set _hints(tooltip) $_hints(label)
    238238        }
    239         set _hints(xmlobj) $_xmlobj
     239        set _hints(xmlobj) $_xmlobj
    240240    }
    241241    if {$keyword != ""} {
     
    268268    #
    269269    foreach cname [$_curve children -type component] {
    270         set xv ""
    271         set yv ""
     270        set xv [blt::vector create \#auto]
     271        set yv [blt::vector create \#auto]
    272272
    273273        set xydata [$_curve get $cname.xy]
    274274        if { "" != $xydata} {
    275             set xv [blt::vector create \#auto]
    276             set yv [blt::vector create \#auto]
    277275            set tmp [blt::vector create \#auto]
    278276            $tmp set $xydata
    279277            $tmp split $xv $yv
    280278            blt::vector destroy $tmp
    281         } else {
    282             set xv [blt::vector create \#auto]
    283             set yv [blt::vector create \#auto]
     279        } else {
    284280            $xv set [$_curve get $cname.xvector]
    285281            $yv set [$_curve get $cname.yvector]
    286             if { [$xv length] != [$yv length] } {
    287                 blt::vector destroy $xv $yv
    288                 set xv ""; set yv ""
    289             }
    290         }
    291         if {$xv != "" && $yv != ""} {
     282        }
     283        if { (([$xv length] == 0) && ([$yv length] == 0))
     284            || ([$xv length] != [$yv length]) } {
     285            # FIXME: need to show an error about improper data.
     286            blt::vector destroy $xv $yv
     287            set xv ""; set yv ""
     288        } else {
    292289            set _comp2xy($cname) [list $xv $yv]
    293290            incr _counter
Note: See TracChangeset for help on using the changeset viewer.