| Filename | /home/micha/Projekt/spreadsheet-parsexlsx/lib/Spreadsheet/ParseXLSX/Cell.pm |
| Statements | Executed 9 statements in 143µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 10µs | 12µs | Spreadsheet::ParseXLSX::Cell::BEGIN@3 |
| 1 | 1 | 1 | 3µs | 19µs | Spreadsheet::ParseXLSX::Cell::BEGIN@4 |
| 1 | 1 | 1 | 3µs | 34µs | Spreadsheet::ParseXLSX::Cell::BEGIN@11 |
| 1 | 1 | 1 | 2µs | 2µs | Spreadsheet::ParseXLSX::Cell::BEGIN@10 |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseXLSX::Cell::DESTROY |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseXLSX::Cell::is_merged |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Spreadsheet::ParseXLSX::Cell; | ||||
| 2 | |||||
| 3 | 2 | 18µs | 2 | 13µs | # spent 12µs (10+1) within Spreadsheet::ParseXLSX::Cell::BEGIN@3 which was called:
# once (10µs+1µs) by Spreadsheet::ParseXLSX::BEGIN@18 at line 3 # spent 12µs making 1 call to Spreadsheet::ParseXLSX::Cell::BEGIN@3
# spent 2µs making 1 call to strict::import |
| 4 | 2 | 16µs | 2 | 34µs | # spent 19µs (3+15) within Spreadsheet::ParseXLSX::Cell::BEGIN@4 which was called:
# once (3µs+15µs) by Spreadsheet::ParseXLSX::BEGIN@18 at line 4 # spent 19µs making 1 call to Spreadsheet::ParseXLSX::Cell::BEGIN@4
# spent 15µs making 1 call to warnings::import |
| 5 | |||||
| 6 | # VERSION | ||||
| 7 | |||||
| 8 | # ABSTRACT: wrapper class around L<Spreadsheet::ParseExcel::Cell> | ||||
| 9 | |||||
| 10 | 2 | 12µs | 1 | 2µs | # spent 2µs within Spreadsheet::ParseXLSX::Cell::BEGIN@10 which was called:
# once (2µs+0s) by Spreadsheet::ParseXLSX::BEGIN@18 at line 10 # spent 2µs making 1 call to Spreadsheet::ParseXLSX::Cell::BEGIN@10 |
| 11 | 2 | 95µs | 2 | 64µs | # spent 34µs (3+31) within Spreadsheet::ParseXLSX::Cell::BEGIN@11 which was called:
# once (3µs+31µs) by Spreadsheet::ParseXLSX::BEGIN@18 at line 11 # spent 34µs making 1 call to Spreadsheet::ParseXLSX::Cell::BEGIN@11
# spent 31µs making 1 call to base::import |
| 12 | |||||
| 13 | |||||
| 14 | =head1 SYNOPSIS | ||||
| 15 | |||||
| 16 | use Spreadsheet::ParseXLSX::Cell; | ||||
| 17 | |||||
| 18 | my $cell = Spreadsheet::ParseXLSX::Cell->new( | ||||
| 19 | Sheet => $sheet, | ||||
| 20 | Row => $row, | ||||
| 21 | Col => $row, | ||||
| 22 | ... | ||||
| 23 | ); | ||||
| 24 | |||||
| 25 | my $isMerged = $cell->is_merged(); | ||||
| 26 | # see Spreadsheet::ParseExcel::Cell for further documentation | ||||
| 27 | |||||
| 28 | =cut | ||||
| 29 | |||||
| 30 | sub DESTROY { | ||||
| 31 | my $self = shift; | ||||
| 32 | |||||
| 33 | #$self->SUPER::DESTROY(); | ||||
| 34 | |||||
| 35 | undef $self->{Sheet}; # break circular dependencies | ||||
| 36 | } | ||||
| 37 | |||||
| 38 | =method is_merged($sheet, $row, $col) | ||||
| 39 | |||||
| 40 | Returns true if the cell is merged being part of the given sheet, located at | ||||
| 41 | the given row and column. Returns undef if the current cell is not connected to | ||||
| 42 | any sheet: | ||||
| 43 | |||||
| 44 | C<$sheet> defaults to the cell's C<{Sheet}> property, | ||||
| 45 | C<$row> to C<{Row}> and | ||||
| 46 | C<$col> to the C<{Col}. | ||||
| 47 | |||||
| 48 | |||||
| 49 | =cut | ||||
| 50 | |||||
| 51 | sub is_merged { | ||||
| 52 | my ($self, $sheet, $row, $col) = @_; | ||||
| 53 | |||||
| 54 | return $self->{Merged} if defined $self->{Merged}; | ||||
| 55 | |||||
| 56 | $sheet //= $self->{Sheet}; | ||||
| 57 | $row //= $self->{Row}; | ||||
| 58 | $col //= $self->{Col}; | ||||
| 59 | |||||
| 60 | return unless defined $sheet && defined $row && defined $col; | ||||
| 61 | |||||
| 62 | return $self->{Merged} = Spreadsheet::ParseXLSX::_is_merged(undef, $sheet, $row, $col); | ||||
| 63 | } | ||||
| 64 | |||||
| 65 | 1 | 2µs | 1; |