| 1 | package Excel::Template::Element::Range; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Spreadsheet::WriteExcel::Utility; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | BEGIN { | ||||||||||
| 7 | 1 | ▶ | use vars qw(@ISA); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | @ISA = qw(Excel::Template::Element); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Excel::Template::Element; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub min { $_[0] < $_[1] ? $_[0] : $_[1] } | ||||||||
|
Subroutine
min: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 1 branch
| |||||||||||
| 14 | 0 | ▶ | sub max { $_[0] > $_[1] ? $_[0] : $_[1] } | ||||||||
|
Subroutine
max: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 1 branch
| |||||||||||
| 15 | |||||||||||
| 16 | sub resolve | ||||||||||
| 17 | { | ||||||||||
| 18 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
resolve: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 19 | 0 | my ($context) = @_; | |||||||||
| 20 | |||||||||||
| 21 | 0 | my $ref_name = $context->resolve($self, 'REF'); | |||||||||
| 22 | |||||||||||
| 23 | 0 | my @refs = $context->get_all_references( $ref_name ); | |||||||||
| 24 | 0 | ▶ | return '' unless @refs; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | |||||||||||
| 26 | 0 | return $self->_join_refs(@refs); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | sub _join_refs { | ||||||||||
| 30 | 0 | ▶ | my ($self, @refs) = @_; | ||||||||
|
Subroutine
_join_refs: not called CC=2 SCAR=17.9
| |||||||||||
| 31 | |||||||||||
| 32 | 0 | my ($top, $left, $bottom, $right) = | |||||||||
| 33 | ( $refs[0][0], $refs[0][1] ) x 2; | ||||||||||
| 34 | |||||||||||
| 35 | 0 | shift @refs; | |||||||||
| 36 | 0 | foreach my $ref ( @refs ) | |||||||||
| 37 | { | ||||||||||
| 38 | 0 | $top = min( $top, $ref->[0]); | |||||||||
| 39 | 0 | $bottom = max( $bottom, $ref->[0]); | |||||||||
| 40 | 0 | $left = min( $left, $ref->[1]); | |||||||||
| 41 | 0 | $right = max( $right, $ref->[1]); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 0 | return join( ':', | |||||||||
| 45 | xl_rowcol_to_cell($top, $left), | ||||||||||
| 46 | xl_rowcol_to_cell($bottom, $right) | ||||||||||
| 47 | ); | ||||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 1 | 1; | |||||||||
| 51 | __END__ | ||||||||||