Intermediate commit - just have to add/fix POD for two classes, then done
[p5sagit/Excel-Template.git] / lib / Excel / Template / Container / Row.pm
CommitLineData
d0eafc11 1package Excel::Template::Container::Row;
2
3use strict;
4
5BEGIN {
6 use vars qw(@ISA);
7 @ISA = qw(Excel::Template::Container);
8
9 use Excel::Template::Container;
10}
11
12sub render
13{
14 my $self = shift;
15 my ($context) = @_;
16
17 $context->{COL} = 0;
18
dee1f239 19 # Apply the height to the current row
20 if (my $height = $context->get($self, 'HEIGHT'))
21 {
22 $height =~ s/\D//g;
23 $height *= 1;
24 if ($height > 0)
25 {
26 $context->active_worksheet->set_row(
27 $context->get( $self, 'ROW' ),
28 $height,
29 );
30 }
31 }
32
d0eafc11 33 return $self->SUPER::render($context);
34}
35
36sub deltas
37{
38 return {
39 ROW => +1,
40 };
41}
42
431;
44__END__
45
46=head1 NAME
47
48Excel::Template::Container::Row - Excel::Template::Container::Row
49
50=head1 PURPOSE
51
52To provide a row context for CELL tags
53
54=head1 NODE NAME
55
56ROW
57
58=head1 INHERITANCE
59
60Excel::Template::Container
61
62=head1 ATTRIBUTES
63
dee1f239 64=over 4
65
66=item * HEIGHT
67
68Sets the height of the row. The last setting for a given row will win out.
69
6dd4c89d 70=back
d0eafc11 71
72=head1 CHILDREN
73
74None
75
76=head1 EFFECTS
77
78Each ROW tag will consume one row of the workbook. When the ROW tag starts, it
79will set the COL value to 0.
80
81=head1 DEPENDENCIES
82
83None
84
85=head1 USAGE
86
87 <row>
88 ... Children here
89 </row>
90
91Generally, you will have CELL and/or FORMULA tags within a ROW.
92
93=head1 AUTHOR
94
c09684ff 95Rob Kinyon (rob.kinyon@gmail.com)
d0eafc11 96
97=head1 SEE ALSO
98
99CELL, FORMULA
100
101=cut