line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
4000
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
98
|
|
2
|
2
|
|
|
2
|
|
13
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
415
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package HTML::Tested::Value::DropDown; |
5
|
2
|
|
|
2
|
|
14
|
use base 'HTML::Tested::Value::Array'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
2730
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub merge_one_value { |
8
|
3
|
|
|
3
|
0
|
9
|
my ($self, $root, $val, @path) = @_; |
9
|
3
|
|
|
|
|
23
|
my $n = $self->name; |
10
|
3
|
|
|
|
|
10
|
my $v = $root->{$n}; |
11
|
3
|
100
|
|
|
|
15
|
if (ref($v)) { |
12
|
1
|
|
|
|
|
12
|
$_->[2] = $_->[0] eq $val for @$v; |
13
|
|
|
|
|
|
|
} else { |
14
|
2
|
|
|
|
|
10
|
$root->{$n} = $self->transform_value($root, $val, $n); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub transform_value { |
19
|
10
|
|
|
10
|
0
|
23
|
my ($self, $caller, $val, $n) = @_; |
20
|
10
|
100
|
|
|
|
62
|
goto OUT if (ref($val) eq 'ARRAY'); |
21
|
|
|
|
|
|
|
|
22
|
3
|
|
|
|
|
14
|
my $dv = $self->get_default_value($caller, $n); |
23
|
3
|
|
|
|
|
9
|
my @res = map { [ $_->[0], $_->[1], $_->[0] eq $val ] } @$dv; |
|
6
|
|
|
|
|
30
|
|
24
|
3
|
|
|
|
|
6
|
$val = \@res; |
25
|
20
|
|
|
|
|
1261
|
OUT: |
26
|
10
|
|
|
|
|
24
|
return [ map { $self->SUPER::transform_value($caller, $_, $n) } @$val ]; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub value_to_string { |
30
|
8
|
|
|
8
|
1
|
18
|
my ($self, $name, $val) = @_; |
31
|
16
|
100
|
|
|
|
45
|
my $options = join("\n", map { |
32
|
8
|
|
|
|
|
24
|
my $sel = $_->[2] ? " selected=\"selected\"" : ""; |
33
|
16
|
|
|
|
|
79
|
"" |
34
|
|
|
|
|
|
|
} @$val); |
35
|
8
|
|
|
|
|
1323
|
return <
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$options |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
ENDS |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |