| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package PDF::TableX::Column; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1716
|
use Moose; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use MooseX::Types; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use PDF::TableX::Types qw/StyleDefinition/; |
|
7
|
|
|
|
|
|
|
use PDF::TableX::Cell; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'PDF::TableX::Stylable'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has rows => (is => 'ro', isa => 'Int', default => 0); |
|
12
|
|
|
|
|
|
|
has width => (is => 'rw', isa => 'Num'); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use overload '@{}' => sub { return $_[0]->{_children} }, fallback => 1; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
around 'width' => sub { |
|
17
|
|
|
|
|
|
|
my $orig = shift; |
|
18
|
|
|
|
|
|
|
my $self = shift; |
|
19
|
|
|
|
|
|
|
return $self->$orig() unless @_; |
|
20
|
|
|
|
|
|
|
for (@{ $self->{_children} }) { $_->width(@_) }; |
|
21
|
|
|
|
|
|
|
$self->$orig(@_); |
|
22
|
|
|
|
|
|
|
return $self; |
|
23
|
|
|
|
|
|
|
}; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub add_cell { |
|
26
|
|
|
|
|
|
|
my ($self, $cell) = @_; |
|
27
|
|
|
|
|
|
|
push @{$self->{_children}}, $cell; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub get_min_width { |
|
31
|
|
|
|
|
|
|
my ($self) = @_; |
|
32
|
|
|
|
|
|
|
my $width = 0; |
|
33
|
|
|
|
|
|
|
for my $cell_min_width ( map {$_->min_width} @{$self->{_children}} ) { |
|
34
|
|
|
|
|
|
|
$width = $cell_min_width if ($cell_min_width > $width); |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
return $width; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub get_reg_width { |
|
40
|
|
|
|
|
|
|
my ($self) = @_; |
|
41
|
|
|
|
|
|
|
my $width = 0; |
|
42
|
|
|
|
|
|
|
for my $cell_reg_width ( map {$_->reg_width} @{$self->{_children}} ) { |
|
43
|
|
|
|
|
|
|
$width = $cell_reg_width if ($cell_reg_width > $width); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
return $width; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 NAME |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
PDF::TableX::Column |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 VERSION |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Version 0.01 |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 FUNCTIONS |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Grzegorz Papkala, C<< <grzegorzpapkala at gmail.com> >> |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 BUGS |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Please report any bugs or feature requests at: L<https://github.com/grzegorzpapkala/PDF-TableX/issues> |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SUPPORT |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
PDF::TableX is hosted on GitHub L<https://github.com/grzegorzpapkala/PDF-TableX> |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Copyright 2013 Grzegorz Papkala, all rights reserved. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
81
|
|
|
|
|
|
|
under the same terms as Perl itself. |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |