XLSX.pm

filter: Statementstmt 98.9% 194 / 196 Branchbran 87.9% 95 / 108 Conditioncond 75.7% 25 / 33 MC/DCmcdc 57.1% 12 / 21 Subroutinesub 100% 15 / 15 Podpod 0.0% 0 / 1 totaltotal 91.1% 341 / 374 CC 79 SCAR 29.9
CC
79
Cov
93%
_load_workbook
37.7
__load_styles
14.0
__member_contents
10.1
CRAP 19.9
« XLSX/Utility2007.pm ↑ Summary XLSX/Fmt2007.pm »
1 package Spreadsheet::XLSX;
2
3 12 ▶use 5.006000;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 12 ▶use base 'Spreadsheet::ParseExcel::Workbook';
Subroutine BEGIN: called CC=1 SCAR=0.0
8
9 12 our $VERSION = '0.20';
10
11 12 our $MAX_MEMBER_SIZE = 64 * 1024 * 1024;
12 12 our $MAX_TOTAL_SIZE = 256 * 1024 * 1024;
13 12 our $MAX_MEMBERS = 10000;
14
15 12 ▶use Archive::Zip;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 12 ▶use Spreadsheet::ParseExcel;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 12 ▶use Spreadsheet::XLSX::Fmt2007;
Subroutine BEGIN: called CC=1 SCAR=0.0
18
19 ################################################################################
20
21 67 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
22 67 my ($class, $filename, $converter) = @_;
23
24 67 my %shared_info; # shared_strings, styles, style_info, rels, converter
25 67 $shared_info{converter} = $converter;
26
27 67 my $self = bless Spreadsheet::ParseExcel::Workbook->new(), $class;
28
29 67 my $zip = __load_zip($filename);
30
31 64 $shared_info{shared_strings}= __load_shared_strings($zip, $shared_info{converter});
32 61 my ($styles, $style_info) = __load_styles($zip);
33 37 $shared_info{styles} = $styles;
34 37 $shared_info{style_info} = $style_info;
35 37 $shared_info{rels} = __load_rels($zip);
36
37 35 $self->_load_workbook($zip, \%shared_info);
38
39 19 return $self;
40 }
41
42 35 ▶sub _load_workbook {
Subroutine _load_workbook: called CC=37 SCAR=36.3
43 35 my ($self, $zip, $shared_info) = @_;
44
45 35 ▶ my $member_workbook = $zip->memberNamed('xl/workbook.xml') or die("xl/workbook.xml not found in this zip\n");
Branch: 1 branch
BranchTrueFalseTotal
my $member_workbook = $zip->memberNamed("xl/workbook.xml") or die "xl/workbook.xml not found in this zip\n" 35 0 35
46 35 $self->{SheetCount} = 0;
47 35 $self->{FmtClass} = Spreadsheet::XLSX::Fmt2007->new;
48 35 $self->{Flg1904} = 0;
49 35 my $workbook_xml = __member_contents($member_workbook);
50 33 ▶ if ($workbook_xml =~ /date1904="1"/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($workbook_xml =~ /date1904="1"/) 0 33 33
51 0 $self->{Flg1904} = 1;
52 }
53
54 33 foreach ($workbook_xml =~ /\<(.*?)\/?\>/g) {
55
56 214 /^(\w+)\s+/;
57
58 214 my ($tag, $other) = ($1, $');
59
60 214 my @pairs = split /\" /, $other;
61
62 214 ▶ $tag eq 'sheet' or next;
Branch: 1 branch
BranchTrueFalseTotal
$tag eq "sheet" or next 42 172 214
63
64 42 my $sheet = {
65 MaxRow => 0,
66 MaxCol => 0,
67 MinRow => 1000000,
68 MinCol => 1000000,
69 };
70
71 42 foreach ($other =~ /(\S+=".*?")/gsm) {
72
73 129 my ($k, $v) = split /=?"/; #"
74
75 129 ▶ if ($k eq 'name') {
Branch: 2 branches
BranchTrueFalseTotal
if ($k eq 'name') { } 42 87 129
elsif ($k eq 'r:id') { } 42 45 87
76 42 $sheet->{Name} = $v;
77 42 ▶ $sheet->{Name} = $shared_info->{converter}->convert($sheet->{Name}) if defined $shared_info->{converter};
Branch: 1 branch
BranchTrueFalseTotal
if defined $shared_info->{"converter"} 0 42 42
78 } elsif ($k eq 'r:id') {
79
80 42 $sheet->{path} = $shared_info->{rels}->{$v};
81
82 }
83
84 }
85
86 42 my $wsheet = Spreadsheet::ParseExcel::Worksheet->new(%$sheet);
87 42 $self->{Worksheet}[$self->{SheetCount}] = $wsheet;
88 42 $self->{SheetCount} += 1;
89
90 }
91
92
93 33 foreach my $sheet (@{$self->{Worksheet}}) {
94
95 42 ▶ my $member_sheet = $zip->memberNamed("xl/$sheet->{path}") or next;
Branch: 1 branch
BranchTrueFalseTotal
my $member_sheet = $zip->memberNamed(qq[xl/$sheet->{"path"}]) or next 42 0 42
96
97 42 my ($row, $col);
98
99 42 my $parsing_v_tag = 0;
100 42 my $s = 0;
101 42 my $s2 = 0;
102 42 my $sty = 0;
103 42 my $sheet_xml = __member_contents($member_sheet);
104 40 foreach ($sheet_xml =~ /(\<.*?\/?\>|.*?(?=\<))/g) {
105 10238 ▶ if (/^<c(?:\s|\/?>)/) {
Branch: 4 branches
BranchTrueFalseTotal
if (m[^<c(?:\s|/?>)]) { } 1666 8572 10238
elsif (/^<v>/) { } 1653 6919 8572
elsif (m[^</v>]) { } 1652 5267 6919
elsif (length $_ and $parsing_v_tag) { } 1653 3614 5267
106
107 1666 my ($reference) = /\sr="([^"]*)"/;
108 1666 ($row, $col) = __decode_cell_name($reference);
109
110 1655 ▶ $s = m/t=\"s\"/ ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
/t=\"s\"/ ? : 836 819 1655
111 1655 ▶ $s2 = m/t=\"str\"/ ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
/t=\"str\"/ ? : 1 1654 1655
112 1655 ▶ $sty = m/s="([0-9]+)"/ ? $1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
/s="([0-9]+)"/ ? : 1620 35 1655
113
114 } elsif (/^<v>/) {
115 1653 $parsing_v_tag = 1;
116 } elsif (/^<\/v>/) {
117 1652 $parsing_v_tag = 0;
118 ▶ } elsif (length($_) && $parsing_v_tag) {
Condition66%2/3
length $_ and $parsing_v_tag
!ll&&!rl&&r
036141653
MC/DC50%1/2
length $_ and $parsing_v_tag
length $_ $parsing_v_tag
Truth table66%2/3
A and B
A= length $_B= $parsing_v_tag
ABresult
0X0
100
111
119 1653 ▶ my $v = $s ? $shared_info->{shared_strings}->[$_] : $_;
Branch: 1 branch
BranchTrueFalseTotal
$s ? : 836 817 1653
120
121 1653 ▶ if ($v eq "</c>") {
Branch: 1 branch
BranchTrueFalseTotal
if ($v eq "</c>") 0 1653 1653
122 0 $v = "";
123 }
124 1653 my $type = "Text";
125 1653 my $thisstyle = "";
126
127 1653 ▶ if (not($s) && not($s2)) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($s or $s2) 817 836 1653
Condition66%2/3
$s or $s2
l!l&&r!l&&!r
8360817
MC/DC50%1/2
$s or $s2
$s $s2
Truth table66%2/3
A or B
A= $sB= $s2
ABresult
1X1
011
000
128 817 $type = "Numeric";
129
130 817 ▶ if (defined $sty && defined $shared_info->{styles}->[$sty]) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $sty and defined $shared_info->{"styles"}[$sty]) 793 24 817
Condition66%2/3
defined $sty and defined $shared_info->{"styles"}[$sty]
!ll&&!rl&&r
024793
MC/DC50%1/2
defined $sty and defined $shared_info->{"styles"}[$sty]
defined $sty defined $shared_info->{"styles"}[$sty]
Truth table66%2/3
A and B
A= defined $styB= defined $shared_info->{"styles"}[$sty]
ABresult
0X0
100
111
131 793 $thisstyle = $shared_info->{style_info}->{$shared_info->{styles}->[$sty]};
132 793 ▶ if ($thisstyle =~ /\b(mmm|m|d|yy|h|hh|mm|ss)\b/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($thisstyle =~ /\b(mmm|m|d|yy|h|hh|mm|ss)\b/) 4 789 793
133 4 $type = "Date";
134 }
135 }
136 }
137
138
139 1653 ▶ $sheet->{MaxRow} = $row if $sheet->{MaxRow} < $row;
Branch: 1 branch
BranchTrueFalseTotal
if $sheet->{"MaxRow"} < $row 802 851 1653
140 1653 ▶ $sheet->{MaxCol} = $col if $sheet->{MaxCol} < $col;
Branch: 1 branch
BranchTrueFalseTotal
if $sheet->{"MaxCol"} < $col 13 1640 1653
141 1653 ▶ $sheet->{MinRow} = $row if $sheet->{MinRow} > $row;
Branch: 1 branch
BranchTrueFalseTotal
if $sheet->{"MinRow"} > $row 31 1622 1653
142 1653 ▶ $sheet->{MinCol} = $col if $sheet->{MinCol} > $col;
Branch: 1 branch
BranchTrueFalseTotal
if $sheet->{"MinCol"} > $col 31 1622 1653
143
144 1653 ▶ if ($v =~ /(.*)E\-(.*)/gsm && $type eq "Numeric") {
Branch: 1 branch
BranchTrueFalseTotal
if ($v =~ /(.*)E\-(.*)/gms and $type eq "Numeric") 97 1556 1653
Condition66%2/3
$v =~ /(.*)E\-(.*)/gms and $type eq "Numeric"
!ll&&!rl&&r
1556097
MC/DC50%1/2
$v =~ /(.*)E\-(.*)/gms and $type eq "Numeric"
$v =~ /(.*)E\-(.*)/gms $type eq "Numeric"
Truth table66%2/3
A and B
A= $v =~ /(.*)E\-(.*)/gmsB= $type eq "Numeric"
ABresult
0X0
100
111
145 97 $v = $1 / (10**$2); # this handles scientific notation for very small numbers
146 }
147
148 1653 my $cell = Spreadsheet::ParseExcel::Cell->new(
149 Val => $v,
150 Format => $thisstyle,
151 Type => $type
152 );
153
154 1653 $cell->{_Value} = $self->{FmtClass}->ValFmt($cell, $self);
155 1652 ▶ if ($type eq "Date") {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq "Date") 3 1649 1652
156 3 ▶ if ($v < 1) { #then this is Excel time field
Branch: 1 branch
BranchTrueFalseTotal
if ($v < 1) 1 2 3
157 1 $cell->{Type} = "Text";
158 1 $cell->{Val} = $cell->{_Value};
159 }
160 }
161 1652 $sheet->{Cells}[$row][$col] = $cell;
162 }
163 }
164
165 28 ▶ $sheet->{MinRow} = 0 if $sheet->{MinRow} > $sheet->{MaxRow};
Branch: 1 branch
BranchTrueFalseTotal
if $sheet->{"MinRow"} > $sheet->{"MaxRow"} 9 19 28
166 28 ▶ $sheet->{MinCol} = 0 if $sheet->{MinCol} > $sheet->{MaxCol};
Branch: 1 branch
BranchTrueFalseTotal
if $sheet->{"MinCol"} > $sheet->{"MaxCol"} 9 19 28
167
168 }
169
170 19 return $self;
171 }
172
173 # Validate before numeric conversion or using a reference as an array index.
174 # XLSX worksheets have at most 1,048,576 rows and 16,384 columns (XFD).
175
176 1666 ▶sub __decode_cell_name {
Subroutine __decode_cell_name: called CC=6 SCAR=17.9
177 1666 my ($reference) = @_;
178 1666 ▶ die "Invalid XLSX cell reference\n"
Branch: 1 branch
BranchTrueFalseTotal
unless defined $reference and $reference =~ /\A([A-Z]{1,3})([1-9][0-9]{0,6})\z/ 8 1658 1666
Condition100%3/3
defined $reference and $reference =~ /\A([A-Z]{1,3})([1-9][0-9]{0,6})\z/
!ll&&!rl&&r
171658
MC/DC100%2/2
defined $reference and $reference =~ /\A([A-Z]{1,3})([1-9][0-9]{0,6})\z/
defined $reference $reference =~ /\A([A-Z]{1,3})([1-9][0-9]{0,6})\z/
Truth table100%3/3
A and B
A= defined $referenceB= $reference =~ /\A([A-Z]{1,3})([1-9][0-9]{0,6})\z/
ABresult
0X0
100
111
179 unless defined($reference)
180 && $reference =~ /\A([A-Z]{1,3})([1-9][0-9]{0,6})\z/;
181 1658 my ($letters, $digits) = ($1, $2);
182 1658 ▶ die "XLSX cell row exceeds worksheet limit\n" if $digits > 1048576;
Branch: 1 branch
BranchTrueFalseTotal
if $digits > 1048576 2 1656 1658
183
184 1656 my $col = 0;
185 1656 $col = $col * 26 + ord($_) - ord('A') + 1 for split //, $letters;
186 1656 ▶ die "XLSX cell column exceeds worksheet limit\n" if $col > 16384;
Branch: 1 branch
BranchTrueFalseTotal
if $col > 16384 1 1655 1656
187
188 1655 return ($digits - 1, $col - 1);
189 }
190
191
192 64 ▶sub __load_shared_strings {
Subroutine __load_shared_strings: called CC=5 SCAR=16.1
193 64 my ($zip, $converter) = @_;
194
195 64 my $member_shared_strings = $zip->memberNamed('xl/sharedStrings.xml');
196
197 64 my @shared_strings = ();
198
199 64 ▶ if ($member_shared_strings) {
Branch: 1 branch
BranchTrueFalseTotal
if ($member_shared_strings) 20 44 64
200
201 20 my $mstr = __member_contents($member_shared_strings);
202 17 $mstr =~ s/<t\/>/<t><\/t>/gsm; # this handles an empty t tag in the xml <t/>
203 17 foreach my $si ($mstr =~ /<si.*?>(.*?)<\/si/gsm) {
204 843 my $str;
205 843 foreach my $t ($si =~ /<t.*?>(.*?)<\/t/gsm) {
206 843 ▶ $t = $converter->convert($t) if defined $converter;
Branch: 1 branch
BranchTrueFalseTotal
if defined $converter 0 843 843
207 843 $str .= $t;
208 }
209 843 push @shared_strings, $str;
210 }
211 }
212
213 61 return \@shared_strings;
214 }
215
216
217 61 ▶sub __load_styles {
Subroutine __load_styles: called CC=14 SCAR=26.4
218 61 my ($zip) = @_;
219
220 61 my $member_styles = $zip->memberNamed('xl/styles.xml');
221
222 61 my @styles = ();
223 61 my %style_info = ();
224
225 61 ▶ if ($member_styles) {
Branch: 1 branch
BranchTrueFalseTotal
if ($member_styles) 45 16 61
226 45 my $formatter = Spreadsheet::XLSX::Fmt2007->new();
227 45 my $styles_xml = __member_contents($member_styles);
228
229 # IDs from both format declarations and style references are data,
230 # never regular-expression syntax.
231 43 foreach my $id ($styles_xml =~ /\bnumFmtId="([^"]*)"/g) {
232 260 ▶ die "Invalid XLSX number format ID\n" unless $id =~ /\A[0-9]+\z/;
Branch: 1 branch
BranchTrueFalseTotal
unless $id =~ /\A[0-9]+\z/ 22 238 260
233 }
234
235 21 foreach my $t ($styles_xml =~ /xf\ numFmtId="([^"]*)"(?!.*\/cellStyleXfs)/gsm) { #"
236 73 push @styles, $t;
237 }
238
239 21 ▶ my $default = $1 || '';
Condition100%2/2
$1 || ''
l!l
714
MC/DC100%1/1
$1 || ''
$1
Truth table100%2/2
A
A= $1
Aresult
11
00
240
241 21 foreach my $t1 (@styles) {
242 73 $styles_xml =~ /numFmtId="\Q$t1\E" formatCode="([^"]*)/;
243 73 ▶ my $formatCode = $1 || '';
Condition100%2/2
$1 || ''
l!l
2944
MC/DC100%1/1
$1 || ''
$1
Truth table100%2/2
A
A= $1
Aresult
11
00
244 73 ▶ if ($formatCode eq $default || not($formatCode)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($formatCode eq $default or not $formatCode) 55 18 73
Condition100%3/3
$formatCode eq $default or not $formatCode
l!l&&r!l&&!r
441118
MC/DC100%2/2
$formatCode eq $default or not $formatCode
$formatCode eq $default not $formatCode
Truth table100%3/3
A or not(B)
A= $formatCode eq $defaultB= not $formatCode
ABresult
1X1
011
000
245 55 ▶ if ($t1 == 9 || $t1 == 10) {
Branch: 2 branches
BranchTrueFalseTotal
if ($t1 == 9 or $t1 == 10) { } 1 54 55
elsif ($t1 == 14) { } 3 51 54
Condition66%2/3
$t1 == 9 or $t1 == 10
l!l&&r!l&&!r
1054
MC/DC50%1/2
$t1 == 9 or $t1 == 10
$t1 == 9 $t1 == 10
Truth table66%2/3
A or B
A= $t1 == 9B= $t1 == 10
ABresult
1X1
011
000
246 1 $formatCode = '0.00000%';
247 } elsif ($t1 == 14) {
248 3 $formatCode = 'yyyy-mm-dd';
249 } else {
250 51 $formatCode = '';
251 }
252 # $formatCode = $formatter->FmtStringDef($t1);
253 }
254 73 $style_info{$t1} = $formatCode;
255 73 ▶ $default = $1 || '';
Condition100%2/2
$1 || ''
l!l
2944
MC/DC100%1/1
$1 || ''
$1
Truth table100%2/2
A
A= $1
Aresult
11
00
256 }
257
258 }
259 37 return (\@styles, \%style_info);
260 }
261
262
263 37 ▶sub __load_rels {
Subroutine __load_rels: called CC=5 SCAR=16.6
264 37 my ($zip) = @_;
265
266 37 ▶ my $member_rels = $zip->memberNamed('xl/_rels/workbook.xml.rels') or die("xl/_rels/workbook.xml.rels not found in this zip\n");
Branch: 1 branch
BranchTrueFalseTotal
my $member_rels = $zip->memberNamed("xl/_rels/workbook.xml.rels") or die "xl/_rels/workbook.xml.rels not found in this zip\n" 37 0 37
267
268 37 my %rels = ();
269
270 37 my $rels_xml = __member_contents($member_rels);
271 35 foreach ($rels_xml =~ /\<Relationship (.*?)\/?\>/g) {
272
273 58 my ($id, $target);
274 58 ($id) = /Id="(.*?)"/;
275 58 ($target) = /Target="(.*?)"/;
276
277 58 ▶ if (defined $id and defined $target) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $id and defined $target) 58 0 58
Condition33%1/3
defined $id and defined $target
!ll&&!rl&&r
0058
MC/DC0%0/2
defined $id and defined $target
defined $id defined $target
Truth table33%1/3
A and B
A= defined $idB= defined $target
ABresult
0X0
100
111
278 58 $rels{$id} = $target;
279 }
280
281 }
282
283 35 return \%rels;
284 }
285
286 67 ▶sub __load_zip {
Subroutine __load_zip: called CC=8 SCAR=20.8
287 67 my ($filename) = @_;
288
289 67 my $zip = Archive::Zip->new();
290
291 67 ▶ if (ref $filename) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $filename) { } 2 65 67
292 2 ▶ $zip->readFromFileHandle($filename) == Archive::Zip::AZ_OK or die("Cannot open data as Zip archive");
Branch: 1 branch
BranchTrueFalseTotal
$zip->readFromFileHandle($filename) == 0 or die "Cannot open data as Zip archive" 2 0 2
293 } else {
294 65 ▶ $zip->read($filename) == Archive::Zip::AZ_OK or die("Cannot open $filename as Zip archive");
Branch: 1 branch
BranchTrueFalseTotal
$zip->read($filename) == 0 or die "Cannot open $filename as Zip archive" 65 0 65
295 }
296
297 67 my @members = $zip->members();
298 67 ▶ die "XLSX ZIP entry count exceeds limit\n" if @members > $MAX_MEMBERS;
Branch: 1 branch
BranchTrueFalseTotal
if @members > $Spreadsheet::XLSX::MAX_MEMBERS 1 66 67
299 66 my $total = 0;
300 66 foreach my $member (@members) {
301 308 my $size = $member->uncompressedSize();
302 308 ▶ die "XLSX ZIP member size exceeds limit\n" if $size > $MAX_MEMBER_SIZE;
Branch: 1 branch
BranchTrueFalseTotal
if $size > $Spreadsheet::XLSX::MAX_MEMBER_SIZE 1 307 308
303 307 $total += $size;
304 307 ▶ die "XLSX ZIP total size exceeds limit\n" if $total > $MAX_TOTAL_SIZE;
Branch: 1 branch
BranchTrueFalseTotal
if $total > $Spreadsheet::XLSX::MAX_TOTAL_SIZE 1 306 307
305 }
306
307 64 return $zip;
308 }
309
310 # readChunk() limits compressed input, not inflated output. Small input chunks
311 # bound temporary inflate buffers; check output before appending it. Never trust
312 # central-directory sizes alone: actual output must not exceed the declared size.
313 179 ▶sub __member_contents {
Subroutine __member_contents: called CC=10 SCAR=23.1
314 179 my ($member) = @_;
315 179 my $declared = $member->uncompressedSize();
316 179 ▶ die "XLSX ZIP member size exceeds limit\n" if $declared > $MAX_MEMBER_SIZE;
Branch: 1 branch
BranchTrueFalseTotal
if $declared > $Spreadsheet::XLSX::MAX_MEMBER_SIZE 0 179 179
317 179 my $old_method = $member->desiredCompressionMethod(Archive::Zip::COMPRESSION_STORED);
318 179 my $contents = '';
319 179 my $ok = eval {
320 179 ▶ die "Cannot read XLSX ZIP member\n" unless $member->rewindData() == Archive::Zip::AZ_OK;
Branch: 1 branch
BranchTrueFalseTotal
unless $member->rewindData == 0 0 179 179
321 179 while (1) {
322 304 my ($buffer, $status) = $member->readChunk(1024);
323 304 ▶ die "Cannot read XLSX ZIP member\n"
Branch: 1 branch
BranchTrueFalseTotal
unless $status == 0 or $status == 1 0 304 304
Condition66%2/3
$status == 0 or $status == 1
l!l&&r!l&&!r
1251790
MC/DC0%0/2
$status == 0 or $status == 1
$status == 0 $status == 1
Truth table66%2/3
A or B
A= $status == 0B= $status == 1
ABresult
1X1
011
000
324 unless $status == Archive::Zip::AZ_OK || $status == Archive::Zip::AZ_STREAM_END;
325 304 my $size = length($contents) + length($$buffer);
326 304 ▶ die "XLSX ZIP member size exceeds limit\n" if $size > $MAX_MEMBER_SIZE;
Branch: 1 branch
BranchTrueFalseTotal
if $size > $Spreadsheet::XLSX::MAX_MEMBER_SIZE 1 303 304
327 303 ▶ die "XLSX ZIP member size does not match metadata\n" if $size > $declared;
Branch: 1 branch
BranchTrueFalseTotal
if $size > $declared 5 298 303
328 298 $contents .= $$buffer;
329 298 ▶ last if $status == Archive::Zip::AZ_STREAM_END;
Branch: 1 branch
BranchTrueFalseTotal
if $status == 1 173 125 298
330 }
331 173 ▶ die "XLSX ZIP member size does not match metadata\n" if length($contents) != $declared;
Branch: 1 branch
BranchTrueFalseTotal
if length $contents != $declared 5 168 173
332 168 1;
333 };
334 179 my $error = $@;
335 179 $member->endRead();
336 179 $member->desiredCompressionMethod($old_method);
337 179 ▶ die $error unless $ok;
Branch: 1 branch
BranchTrueFalseTotal
unless $ok 11 168 179
338 168 return $contents;
339 }
340
341
342 12 1;
343 __END__
« XLSX/Utility2007.pm ↑ Summary XLSX/Fmt2007.pm »