line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormatNroff::Table::Row; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
3008
|
use strict; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
249
|
|
4
|
8
|
|
|
8
|
|
32
|
use warnings; |
|
8
|
|
|
|
|
10
|
|
|
8
|
|
|
|
|
306
|
|
5
|
8
|
|
|
8
|
|
29
|
use Carp; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
3590
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
8
|
|
|
8
|
1
|
25
|
my ( $class, %attr ) = @_; |
9
|
|
|
|
|
|
|
|
10
|
8
|
|
100
|
|
|
105
|
my $self = bless { |
|
|
|
50
|
|
|
|
|
11
|
|
|
|
|
|
|
align => $attr{'align'} || 'left', |
12
|
|
|
|
|
|
|
valign => $attr{'valign'} || 'middle', |
13
|
|
|
|
|
|
|
current_cell => undef, |
14
|
|
|
|
|
|
|
ended => 1, |
15
|
|
|
|
|
|
|
cells => [], |
16
|
|
|
|
|
|
|
}, $class; |
17
|
|
|
|
|
|
|
|
18
|
8
|
|
|
|
|
39
|
return $self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub add_element { |
22
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %attr ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
0
|
croak "Should be subclassed.\n"; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub end_element { |
28
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
croak "Should be subclassed.\n"; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub add_text { |
34
|
26
|
|
|
26
|
1
|
36
|
my ( $self, $text ) = @_; |
35
|
|
|
|
|
|
|
|
36
|
26
|
100
|
|
|
|
55
|
if ( $self->{'ended'} != 0 ) { |
37
|
11
|
|
|
|
|
59
|
return; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
15
|
|
|
|
|
17
|
my $cell = $self->{'current_cell'}; |
41
|
15
|
50
|
|
|
|
29
|
if ( defined($cell) ) { |
42
|
15
|
|
|
|
|
206
|
$cell->add_text($text); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
else { |
45
|
0
|
|
|
|
|
0
|
return 0; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub text { |
50
|
1
|
|
|
1
|
1
|
9
|
my ($self) = @_; |
51
|
|
|
|
|
|
|
|
52
|
1
|
|
|
|
|
2
|
my $cell = $self->{'current_cell'}; |
53
|
1
|
50
|
|
|
|
3
|
if ( defined($cell) ) { |
54
|
1
|
|
|
|
|
7
|
return $cell->text(); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
else { |
57
|
0
|
|
|
|
|
0
|
return 0; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub widths { |
62
|
7
|
|
|
7
|
1
|
11
|
my ( $self, $final, $array_ref ) = @_; |
63
|
|
|
|
|
|
|
|
64
|
7
|
|
|
|
|
9
|
my @widths; |
65
|
|
|
|
|
|
|
my $cell; |
66
|
7
|
|
|
|
|
8
|
foreach $cell ( @{ $self->{'cells'} } ) { |
|
7
|
|
|
|
|
19
|
|
67
|
6
|
|
|
|
|
29
|
push( @widths, $cell->width() ); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
7
|
|
|
|
|
14
|
$cell = $self->{'current_cell'}; |
71
|
7
|
50
|
|
|
|
18
|
if ( defined($cell) ) { |
72
|
7
|
|
|
|
|
21
|
push( @widths, $cell->width() ); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
7
|
|
|
|
|
29
|
push( @$array_ref, [@widths] ); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub output { |
79
|
7
|
|
|
7
|
1
|
13
|
my ( $self, $final, $formatter, $tab ) = @_; |
80
|
|
|
|
|
|
|
|
81
|
7
|
|
|
|
|
8
|
my $cell; |
82
|
7
|
|
|
|
|
8
|
foreach $cell ( @{ $self->{'cells'} } ) { |
|
7
|
|
|
|
|
28
|
|
83
|
6
|
|
|
|
|
15
|
$cell->output($formatter); |
84
|
6
|
|
|
|
|
33
|
$formatter->out("$tab"); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
7
|
50
|
|
|
|
83
|
if ( defined( $self->{'current_cell'} ) ) { |
88
|
7
|
|
|
|
|
22
|
$self->{'current_cell'}->output($formatter); |
89
|
|
|
|
|
|
|
} |
90
|
7
|
|
|
|
|
46
|
$formatter->out("\n.sp\n"); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
__END__ |