line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
############################################################################### |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Metadata - A class for writing the Excel XLSX metadata.xml file. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Used in conjunction with Excel::Writer::XLSX |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright 2000-2021, John McNamara, jmcnamara@cpan.org |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# Documentation after __END__ |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# perltidy with the following options: -mbl=2 -pt=0 -nola |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use 5.008002; |
16
|
1124
|
|
|
1124
|
|
15414
|
use strict; |
|
1124
|
|
|
|
|
3112
|
|
17
|
1124
|
|
|
1124
|
|
4747
|
use warnings; |
|
1124
|
|
|
|
|
1888
|
|
|
1124
|
|
|
|
|
17572
|
|
18
|
1124
|
|
|
1124
|
|
4291
|
use Carp; |
|
1124
|
|
|
|
|
2009
|
|
|
1124
|
|
|
|
|
20002
|
|
19
|
1124
|
|
|
1124
|
|
4479
|
use Excel::Writer::XLSX::Package::XMLwriter; |
|
1124
|
|
|
|
|
1926
|
|
|
1124
|
|
|
|
|
48261
|
|
20
|
1124
|
|
|
1124
|
|
6154
|
|
|
1124
|
|
|
|
|
2246
|
|
|
1124
|
|
|
|
|
556046
|
|
21
|
|
|
|
|
|
|
our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); |
22
|
|
|
|
|
|
|
our $VERSION = '1.09'; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
############################################################################### |
26
|
|
|
|
|
|
|
# |
27
|
|
|
|
|
|
|
# Public and private API methods. |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
############################################################################### |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
############################################################################### |
33
|
|
|
|
|
|
|
# |
34
|
|
|
|
|
|
|
# new() |
35
|
|
|
|
|
|
|
# |
36
|
|
|
|
|
|
|
# Constructor. |
37
|
|
|
|
|
|
|
# |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $class = shift; |
40
|
|
|
|
|
|
|
my $fh = shift; |
41
|
892
|
|
|
892
|
0
|
2170
|
my $self = Excel::Writer::XLSX::Package::XMLwriter->new( $fh ); |
42
|
892
|
|
|
|
|
1724
|
|
43
|
892
|
|
|
|
|
4859
|
bless $self, $class; |
44
|
|
|
|
|
|
|
|
45
|
892
|
|
|
|
|
2245
|
return $self; |
46
|
|
|
|
|
|
|
} |
47
|
892
|
|
|
|
|
2256
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
############################################################################### |
50
|
|
|
|
|
|
|
# |
51
|
|
|
|
|
|
|
# _assemble_xml_file() |
52
|
|
|
|
|
|
|
# |
53
|
|
|
|
|
|
|
# Assemble and write the XML file. |
54
|
|
|
|
|
|
|
# |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $self = shift; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
$self->xml_declaration; |
59
|
1
|
|
|
1
|
|
2
|
|
60
|
|
|
|
|
|
|
# Write the metadata element. |
61
|
1
|
|
|
|
|
5
|
$self->_write_metadata(); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# Write the metadataTypes element. |
64
|
1
|
|
|
|
|
5
|
$self->_write_metadata_types(); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# Write the futureMetadata element. |
67
|
1
|
|
|
|
|
4
|
$self->_write_future_metadata(); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Write the cellMetadata element. |
70
|
1
|
|
|
|
|
9
|
$self->_write_cell_metadata(); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
$self->xml_end_tag( 'metadata' ); |
73
|
1
|
|
|
|
|
6
|
|
74
|
|
|
|
|
|
|
# Close the XML writer filehandle. |
75
|
1
|
|
|
|
|
3
|
$self->xml_get_fh()->close(); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
5
|
|
79
|
|
|
|
|
|
|
############################################################################### |
80
|
|
|
|
|
|
|
# |
81
|
|
|
|
|
|
|
# XML writing methods. |
82
|
|
|
|
|
|
|
# |
83
|
|
|
|
|
|
|
############################################################################### |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
############################################################################## |
87
|
|
|
|
|
|
|
# |
88
|
|
|
|
|
|
|
# _write_metadata() |
89
|
|
|
|
|
|
|
# |
90
|
|
|
|
|
|
|
# Write the <metadata> element. |
91
|
|
|
|
|
|
|
# |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
my $self = shift; |
94
|
|
|
|
|
|
|
my $xmlns = 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'; |
95
|
|
|
|
|
|
|
my $xmlns_xda = |
96
|
|
|
|
|
|
|
'http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray'; |
97
|
1
|
|
|
1
|
|
2
|
|
98
|
1
|
|
|
|
|
2
|
my @attributes = ( |
99
|
1
|
|
|
|
|
2
|
'xmlns' => $xmlns, |
100
|
|
|
|
|
|
|
'xmlns:xda' => $xmlns_xda, |
101
|
|
|
|
|
|
|
); |
102
|
1
|
|
|
|
|
3
|
|
103
|
|
|
|
|
|
|
$self->xml_start_tag( 'metadata', @attributes ); |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
1
|
|
|
|
|
6
|
############################################################################## |
108
|
|
|
|
|
|
|
# |
109
|
|
|
|
|
|
|
# _write_metadata_types() |
110
|
|
|
|
|
|
|
# |
111
|
|
|
|
|
|
|
# Write the <metadataTypes> element. |
112
|
|
|
|
|
|
|
# |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
my $self = shift; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
my @attributes = ( 'count' => 1 ); |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
$self->xml_start_tag( 'metadataTypes', @attributes ); |
119
|
1
|
|
|
1
|
|
2
|
|
120
|
|
|
|
|
|
|
# Write the metadataType element. |
121
|
1
|
|
|
|
|
3
|
$self->_write_metadata_type(); |
122
|
|
|
|
|
|
|
|
123
|
1
|
|
|
|
|
3
|
$self->xml_end_tag( 'metadataTypes' ); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
1
|
|
|
|
|
4
|
|
127
|
|
|
|
|
|
|
############################################################################## |
128
|
1
|
|
|
|
|
6
|
# |
129
|
|
|
|
|
|
|
# _write_metadata_type() |
130
|
|
|
|
|
|
|
# |
131
|
|
|
|
|
|
|
# Write the <metadataType> element. |
132
|
|
|
|
|
|
|
# |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
my $self = shift; |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
my @attributes = ( |
137
|
|
|
|
|
|
|
'name' => 'XLDAPR', |
138
|
|
|
|
|
|
|
'minSupportedVersion' => 120000, |
139
|
|
|
|
|
|
|
'copy' => 1, |
140
|
1
|
|
|
1
|
|
2
|
'pasteAll' => 1, |
141
|
|
|
|
|
|
|
'pasteValues' => 1, |
142
|
1
|
|
|
|
|
6
|
'merge' => 1, |
143
|
|
|
|
|
|
|
'splitFirst' => 1, |
144
|
|
|
|
|
|
|
'rowColShift' => 1, |
145
|
|
|
|
|
|
|
'clearFormats' => 1, |
146
|
|
|
|
|
|
|
'clearComments' => 1, |
147
|
|
|
|
|
|
|
'assign' => 1, |
148
|
|
|
|
|
|
|
'coerce' => 1, |
149
|
|
|
|
|
|
|
'cellMeta' => 1, |
150
|
|
|
|
|
|
|
); |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
$self->xml_empty_tag( 'metadataType', @attributes ); |
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
############################################################################## |
157
|
|
|
|
|
|
|
# |
158
|
1
|
|
|
|
|
5
|
# _write_future_metadata() |
159
|
|
|
|
|
|
|
# |
160
|
|
|
|
|
|
|
# Write the <futureMetadata> element. |
161
|
|
|
|
|
|
|
# |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
my $self = shift; |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
my @attributes = ( |
166
|
|
|
|
|
|
|
'name' => 'XLDAPR', |
167
|
|
|
|
|
|
|
'count' => 1, |
168
|
|
|
|
|
|
|
); |
169
|
|
|
|
|
|
|
|
170
|
1
|
|
|
1
|
|
4
|
$self->xml_start_tag( 'futureMetadata', @attributes ); |
171
|
|
|
|
|
|
|
$self->xml_start_tag( 'bk' ); |
172
|
1
|
|
|
|
|
4
|
$self->xml_start_tag( 'extLst' ); |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# Write the ext element. |
175
|
|
|
|
|
|
|
$self->_write_ext(); |
176
|
|
|
|
|
|
|
|
177
|
1
|
|
|
|
|
4
|
$self->xml_end_tag( 'ext' ); |
178
|
1
|
|
|
|
|
5
|
$self->xml_end_tag( 'extLst' ); |
179
|
1
|
|
|
|
|
3
|
$self->xml_end_tag( 'bk' ); |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
$self->xml_end_tag( 'futureMetadata' ); |
182
|
1
|
|
|
|
|
4
|
} |
183
|
|
|
|
|
|
|
|
184
|
1
|
|
|
|
|
3
|
|
185
|
1
|
|
|
|
|
5
|
############################################################################## |
186
|
1
|
|
|
|
|
3
|
# |
187
|
|
|
|
|
|
|
# _write_ext() |
188
|
1
|
|
|
|
|
3
|
# |
189
|
|
|
|
|
|
|
# Write the <ext> element. |
190
|
|
|
|
|
|
|
# |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
my $self = shift; |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
my @attributes = ( 'uri' => '{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}' ); |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
$self->xml_start_tag( 'ext', @attributes ); |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
# Write the xda:dynamicArrayProperties element. |
199
|
|
|
|
|
|
|
$self->_write_xda_dynamic_array_properties(); |
200
|
1
|
|
|
1
|
|
2
|
} |
201
|
|
|
|
|
|
|
|
202
|
1
|
|
|
|
|
2
|
|
203
|
|
|
|
|
|
|
############################################################################## |
204
|
1
|
|
|
|
|
4
|
# |
205
|
|
|
|
|
|
|
# _write_xda_dynamic_array_properties() |
206
|
|
|
|
|
|
|
# |
207
|
1
|
|
|
|
|
3
|
# Write the <xda:dynamicArrayProperties> element. |
208
|
|
|
|
|
|
|
# |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
my $self = shift; |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
my @attributes = ( |
213
|
|
|
|
|
|
|
'fDynamic' => 1, |
214
|
|
|
|
|
|
|
'fCollapsed' => 0, |
215
|
|
|
|
|
|
|
); |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
$self->xml_empty_tag( 'xda:dynamicArrayProperties', @attributes ); |
218
|
|
|
|
|
|
|
} |
219
|
1
|
|
|
1
|
|
8
|
|
220
|
|
|
|
|
|
|
|
221
|
1
|
|
|
|
|
5
|
############################################################################## |
222
|
|
|
|
|
|
|
# |
223
|
|
|
|
|
|
|
# _write_cell_metadata() |
224
|
|
|
|
|
|
|
# |
225
|
|
|
|
|
|
|
# Write the <cellMetadata> element. |
226
|
1
|
|
|
|
|
4
|
# |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
my $self = shift; |
229
|
|
|
|
|
|
|
my $count = 1; |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
my @attributes = ( 'count' => $count, ); |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
$self->xml_start_tag( 'cellMetadata', @attributes ); |
234
|
|
|
|
|
|
|
$self->xml_start_tag( 'bk' ); |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
# Write the rc element. |
237
|
|
|
|
|
|
|
$self->_write_rc(); |
238
|
1
|
|
|
1
|
|
1
|
|
239
|
1
|
|
|
|
|
2
|
$self->xml_end_tag( 'bk' ); |
240
|
|
|
|
|
|
|
$self->xml_end_tag( 'cellMetadata' ); |
241
|
1
|
|
|
|
|
3
|
} |
242
|
|
|
|
|
|
|
|
243
|
1
|
|
|
|
|
4
|
|
244
|
1
|
|
|
|
|
4
|
############################################################################## |
245
|
|
|
|
|
|
|
# |
246
|
|
|
|
|
|
|
# _write_rc() |
247
|
1
|
|
|
|
|
3
|
# |
248
|
|
|
|
|
|
|
# Write the <rc> element. |
249
|
1
|
|
|
|
|
2
|
# |
250
|
1
|
|
|
|
|
2
|
|
251
|
|
|
|
|
|
|
my $self = shift; |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
my @attributes = ( |
254
|
|
|
|
|
|
|
't' => 1, |
255
|
|
|
|
|
|
|
'v' => 0, |
256
|
|
|
|
|
|
|
); |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
$self->xml_empty_tag( 'rc', @attributes ); |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
|
262
|
1
|
|
|
1
|
|
2
|
1; |
263
|
|
|
|
|
|
|
|
264
|
1
|
|
|
|
|
3
|
|
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=pod |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
=head1 NAME |
269
|
1
|
|
|
|
|
4
|
|
270
|
|
|
|
|
|
|
Metadata - A class for writing the Excel XLSX metadata.xml file. |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=head1 SYNOPSIS |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
See the documentation for L<Excel::Writer::XLSX>. |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=head1 DESCRIPTION |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
This module is used in conjunction with L<Excel::Writer::XLSX>. |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=head1 AUTHOR |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
John McNamara jmcnamara@cpan.org |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
=head1 COPYRIGHT |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
(c) MM-MMXXI, John McNamara. |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=head1 LICENSE |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
Either the Perl Artistic Licence L<http://dev.perl.org/licenses/artistic.html> or the GPL L<http://www.opensource.org/licenses/gpl-license.php>. |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTY |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
See the documentation for L<Excel::Writer::XLSX>. |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
=cut |