line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormatNroff::Table::Cell::Nroff; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
19585
|
use 5.004; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
295
|
|
4
|
9
|
|
|
9
|
|
31
|
use strict; |
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
213
|
|
5
|
9
|
|
|
9
|
|
76
|
use warnings; |
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
199
|
|
6
|
9
|
|
|
9
|
|
413
|
use parent 'HTML::FormatNroff::Table::Cell'; |
|
9
|
|
|
|
|
256
|
|
|
9
|
|
|
|
|
38
|
|
7
|
9
|
|
|
9
|
|
360
|
use Carp; |
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
2926
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $_max_tbl_cell = 300; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my %_formats = ( |
12
|
|
|
|
|
|
|
left => "l", |
13
|
|
|
|
|
|
|
center => "c", |
14
|
|
|
|
|
|
|
right => "r", |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub format_str { |
18
|
14
|
|
|
14
|
1
|
30
|
my ( $self, $width ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
14
|
|
|
|
|
28
|
my $result = $_formats{ $self->{'align'} }; |
21
|
14
|
100
|
|
|
|
29
|
if ($width) { $result .= "w(" . $width . "i)"; } |
|
13
|
|
|
|
|
28
|
|
22
|
14
|
|
|
|
|
17
|
my $cnt = $self->{'colspan'}; |
23
|
14
|
|
|
|
|
548
|
while ( $cnt > 1 ) { |
24
|
1
|
|
|
|
|
2
|
$result .= " s"; |
25
|
1
|
|
|
|
|
3
|
$cnt--; |
26
|
|
|
|
|
|
|
} |
27
|
14
|
|
|
|
|
36
|
return $result; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub output { |
31
|
13
|
|
|
13
|
1
|
18
|
my ( $self, $formatter ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
13
|
|
|
|
|
34
|
$formatter->out("T{\n.ad l\n.fi\n"); |
34
|
13
|
100
|
|
|
|
71
|
if ( $self->{'header'} eq 'header' ) { |
35
|
4
|
|
|
|
|
17
|
$formatter->font_start('B'); |
36
|
|
|
|
|
|
|
} |
37
|
13
|
|
|
|
|
40
|
my $text = $self->{'text'}; |
38
|
13
|
|
|
|
|
23
|
$text =~ s/ +/ /; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# need to split to avoid buffer overrun in tbl, |
41
|
|
|
|
|
|
|
# using $_max_tbl_cell as magic number |
42
|
13
|
|
|
|
|
16
|
my $len = length($text); |
43
|
13
|
|
|
|
|
29
|
while ( $len > 0 ) { |
44
|
13
|
50
|
|
|
|
32
|
if ( $len < $_max_tbl_cell ) { |
45
|
13
|
|
|
|
|
36
|
$formatter->out($text); |
46
|
13
|
|
|
|
|
74
|
$len = 0; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
else { |
49
|
0
|
|
|
|
|
0
|
my $place = index( $text, " ", $_max_tbl_cell / 2 ); |
50
|
0
|
|
|
|
|
0
|
$formatter->out( substr( $text, 0, $place ) ); |
51
|
0
|
|
|
|
|
0
|
$formatter->out("\n"); |
52
|
0
|
|
|
|
|
0
|
$text = substr( $text, $place + 1 ); |
53
|
0
|
|
|
|
|
0
|
$len = length($text); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
13
|
100
|
|
|
|
37
|
if ( $self->{'header'} eq 'header' ) { |
58
|
4
|
|
|
|
|
17
|
$formatter->font_end(); |
59
|
|
|
|
|
|
|
} |
60
|
13
|
|
|
|
|
47
|
$formatter->out("\n.nf\nT}"); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |