line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
############################################################################### |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Excel::Writer::XLSX::Package::ContentTypes - A class for writing the Excel |
5
|
|
|
|
|
|
|
# XLS [Content_Types] file. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# Used in conjunction with Excel::Writer::XLSX |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Copyright 2000-2021, John McNamara, jmcnamara@cpan.org |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# Documentation after __END__ |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# perltidy with the following options: -mbl=2 -pt=0 -nola |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
use 5.008002; |
17
|
1124
|
|
|
1124
|
|
16683
|
use strict; |
|
1124
|
|
|
|
|
3179
|
|
18
|
1124
|
|
|
1124
|
|
4898
|
use warnings; |
|
1124
|
|
|
|
|
2008
|
|
|
1124
|
|
|
|
|
18818
|
|
19
|
1124
|
|
|
1124
|
|
4604
|
use Carp; |
|
1124
|
|
|
|
|
1999
|
|
|
1124
|
|
|
|
|
24822
|
|
20
|
1124
|
|
|
1124
|
|
5346
|
use Excel::Writer::XLSX::Package::XMLwriter; |
|
1124
|
|
|
|
|
2393
|
|
|
1124
|
|
|
|
|
52195
|
|
21
|
1124
|
|
|
1124
|
|
6524
|
|
|
1124
|
|
|
|
|
2299
|
|
|
1124
|
|
|
|
|
1103173
|
|
22
|
|
|
|
|
|
|
our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); |
23
|
|
|
|
|
|
|
our $VERSION = '1.09'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
############################################################################### |
27
|
|
|
|
|
|
|
# |
28
|
|
|
|
|
|
|
# Package data. |
29
|
|
|
|
|
|
|
# |
30
|
|
|
|
|
|
|
############################################################################### |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my $app_package = 'application/vnd.openxmlformats-package.'; |
33
|
|
|
|
|
|
|
my $app_document = 'application/vnd.openxmlformats-officedocument.'; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our @defaults = ( |
36
|
|
|
|
|
|
|
[ 'rels', $app_package . 'relationships+xml' ], |
37
|
|
|
|
|
|
|
[ 'xml', 'application/xml' ], |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
our @overrides = ( |
41
|
|
|
|
|
|
|
[ '/docProps/app.xml', $app_document . 'extended-properties+xml' ], |
42
|
|
|
|
|
|
|
[ '/docProps/core.xml', $app_package . 'core-properties+xml' ], |
43
|
|
|
|
|
|
|
[ '/xl/styles.xml', $app_document . 'spreadsheetml.styles+xml' ], |
44
|
|
|
|
|
|
|
[ '/xl/theme/theme1.xml', $app_document . 'theme+xml' ], |
45
|
|
|
|
|
|
|
[ '/xl/workbook.xml', $app_document . 'spreadsheetml.sheet.main+xml' ], |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
############################################################################### |
50
|
|
|
|
|
|
|
# |
51
|
|
|
|
|
|
|
# Public and private API methods. |
52
|
|
|
|
|
|
|
# |
53
|
|
|
|
|
|
|
############################################################################### |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
############################################################################### |
56
|
|
|
|
|
|
|
# |
57
|
|
|
|
|
|
|
# new() |
58
|
|
|
|
|
|
|
# |
59
|
|
|
|
|
|
|
# Constructor. |
60
|
|
|
|
|
|
|
# |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my $class = shift; |
63
|
|
|
|
|
|
|
my $fh = shift; |
64
|
896
|
|
|
896
|
0
|
4557
|
my $self = Excel::Writer::XLSX::Package::XMLwriter->new( $fh ); |
65
|
896
|
|
|
|
|
1653
|
|
66
|
896
|
|
|
|
|
2512
|
$self->{_defaults} = [@defaults]; |
67
|
|
|
|
|
|
|
$self->{_overrides} = [@overrides]; |
68
|
896
|
|
|
|
|
3326
|
|
69
|
896
|
|
|
|
|
3259
|
bless $self, $class; |
70
|
|
|
|
|
|
|
|
71
|
896
|
|
|
|
|
1836
|
return $self; |
72
|
|
|
|
|
|
|
} |
73
|
896
|
|
|
|
|
1962
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
############################################################################### |
76
|
|
|
|
|
|
|
# |
77
|
|
|
|
|
|
|
# _assemble_xml_file() |
78
|
|
|
|
|
|
|
# |
79
|
|
|
|
|
|
|
# Assemble and write the XML file. |
80
|
|
|
|
|
|
|
# |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
my $self = shift; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
$self->xml_declaration; |
85
|
893
|
|
|
893
|
|
2205
|
$self->_write_types(); |
86
|
|
|
|
|
|
|
$self->_write_defaults(); |
87
|
893
|
|
|
|
|
7176
|
$self->_write_overrides(); |
88
|
893
|
|
|
|
|
4824
|
|
89
|
893
|
|
|
|
|
3895
|
$self->xml_end_tag( 'Types' ); |
90
|
893
|
|
|
|
|
3581
|
|
91
|
|
|
|
|
|
|
# Close the XML writer filehandle. |
92
|
893
|
|
|
|
|
4635
|
$self->xml_get_fh()->close(); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
893
|
|
|
|
|
3807
|
|
96
|
|
|
|
|
|
|
############################################################################### |
97
|
|
|
|
|
|
|
# |
98
|
|
|
|
|
|
|
# _add_default() |
99
|
|
|
|
|
|
|
# |
100
|
|
|
|
|
|
|
# Add elements to the ContentTypes defaults. |
101
|
|
|
|
|
|
|
# |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
my $self = shift; |
104
|
|
|
|
|
|
|
my $part_name = shift; |
105
|
|
|
|
|
|
|
my $content_type = shift; |
106
|
|
|
|
|
|
|
|
107
|
189
|
|
|
189
|
|
396
|
push @{ $self->{_defaults} }, [ $part_name, $content_type ]; |
108
|
189
|
|
|
|
|
408
|
|
109
|
189
|
|
|
|
|
333
|
} |
110
|
|
|
|
|
|
|
|
111
|
189
|
|
|
|
|
332
|
|
|
189
|
|
|
|
|
1228
|
|
112
|
|
|
|
|
|
|
############################################################################### |
113
|
|
|
|
|
|
|
# |
114
|
|
|
|
|
|
|
# _add_override() |
115
|
|
|
|
|
|
|
# |
116
|
|
|
|
|
|
|
# Add elements to the ContentTypes overrides. |
117
|
|
|
|
|
|
|
# |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
my $self = shift; |
120
|
|
|
|
|
|
|
my $part_name = shift; |
121
|
|
|
|
|
|
|
my $content_type = shift; |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
push @{ $self->{_overrides} }, [ $part_name, $content_type ]; |
124
|
2326
|
|
|
2326
|
|
3955
|
|
125
|
2326
|
|
|
|
|
3522
|
} |
126
|
2326
|
|
|
|
|
3388
|
|
127
|
|
|
|
|
|
|
|
128
|
2326
|
|
|
|
|
3355
|
############################################################################### |
|
2326
|
|
|
|
|
12358
|
|
129
|
|
|
|
|
|
|
# |
130
|
|
|
|
|
|
|
# _add_worksheet_name() |
131
|
|
|
|
|
|
|
# |
132
|
|
|
|
|
|
|
# Add the name of a worksheet to the ContentTypes overrides. |
133
|
|
|
|
|
|
|
# |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
my $self = shift; |
136
|
|
|
|
|
|
|
my $worksheet_name = shift; |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
$worksheet_name = "/xl/worksheets/$worksheet_name.xml"; |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
$self->_add_override( $worksheet_name, |
141
|
1022
|
|
|
1022
|
|
2416
|
$app_document . 'spreadsheetml.worksheet+xml' ); |
142
|
1022
|
|
|
|
|
1915
|
} |
143
|
|
|
|
|
|
|
|
144
|
1022
|
|
|
|
|
3301
|
|
145
|
|
|
|
|
|
|
############################################################################### |
146
|
1022
|
|
|
|
|
5142
|
# |
147
|
|
|
|
|
|
|
# _add_chartsheet_name() |
148
|
|
|
|
|
|
|
# |
149
|
|
|
|
|
|
|
# Add the name of a chartsheet to the ContentTypes overrides. |
150
|
|
|
|
|
|
|
# |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
my $self = shift; |
153
|
|
|
|
|
|
|
my $chartsheet_name = shift; |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
$chartsheet_name = "/xl/chartsheets/$chartsheet_name.xml"; |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
$self->_add_override( $chartsheet_name, |
158
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.chartsheet+xml' ); |
159
|
20
|
|
|
20
|
|
47
|
} |
160
|
20
|
|
|
|
|
41
|
|
161
|
|
|
|
|
|
|
|
162
|
20
|
|
|
|
|
56
|
############################################################################### |
163
|
|
|
|
|
|
|
# |
164
|
20
|
|
|
|
|
84
|
# _add_chart_name() |
165
|
|
|
|
|
|
|
# |
166
|
|
|
|
|
|
|
# Add the name of a chart to the ContentTypes overrides. |
167
|
|
|
|
|
|
|
# |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
my $self = shift; |
170
|
|
|
|
|
|
|
my $chart_name = shift; |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
$chart_name = "/xl/charts/$chart_name.xml"; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
$self->_add_override( $chart_name, $app_document . 'drawingml.chart+xml' ); |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
|
177
|
426
|
|
|
426
|
|
977
|
|
178
|
426
|
|
|
|
|
783
|
############################################################################### |
179
|
|
|
|
|
|
|
# |
180
|
426
|
|
|
|
|
1341
|
# _add_drawing_name() |
181
|
|
|
|
|
|
|
# |
182
|
426
|
|
|
|
|
1662
|
# Add the name of a drawing to the ContentTypes overrides. |
183
|
|
|
|
|
|
|
# |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
my $self = shift; |
186
|
|
|
|
|
|
|
my $drawing_name = shift; |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
$drawing_name = "/xl/drawings/$drawing_name.xml"; |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
$self->_add_override( $drawing_name, $app_document . 'drawing+xml' ); |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
|
194
|
523
|
|
|
523
|
|
1232
|
############################################################################### |
195
|
523
|
|
|
|
|
1103
|
# |
196
|
|
|
|
|
|
|
# _add_vml_name() |
197
|
523
|
|
|
|
|
1817
|
# |
198
|
|
|
|
|
|
|
# Add the name of a VML drawing to the ContentTypes defaults. |
199
|
523
|
|
|
|
|
2037
|
# |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
my $self = shift; |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
$self->_add_default( 'vml', $app_document . 'vmlDrawing' ); |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
############################################################################### |
208
|
|
|
|
|
|
|
# |
209
|
|
|
|
|
|
|
# _add_comment_name() |
210
|
|
|
|
|
|
|
# |
211
|
63
|
|
|
63
|
|
144
|
# Add the name of a comment to the ContentTypes overrides. |
212
|
|
|
|
|
|
|
# |
213
|
63
|
|
|
|
|
322
|
|
214
|
|
|
|
|
|
|
my $self = shift; |
215
|
|
|
|
|
|
|
my $comment_name = shift; |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
$comment_name = "/xl/$comment_name.xml"; |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
$self->_add_override( $comment_name, |
220
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.comments+xml' ); |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
############################################################################### |
224
|
|
|
|
|
|
|
# |
225
|
44
|
|
|
44
|
|
106
|
# _Add_shared_strings() |
226
|
44
|
|
|
|
|
76
|
# |
227
|
|
|
|
|
|
|
# Add the sharedStrings link to the ContentTypes overrides. |
228
|
44
|
|
|
|
|
107
|
# |
229
|
|
|
|
|
|
|
|
230
|
44
|
|
|
|
|
178
|
my $self = shift; |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
$self->_add_override( '/xl/sharedStrings.xml', |
233
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.sharedStrings+xml' ); |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
############################################################################### |
238
|
|
|
|
|
|
|
# |
239
|
|
|
|
|
|
|
# _add_calc_chain() |
240
|
|
|
|
|
|
|
# |
241
|
|
|
|
|
|
|
# Add the calcChain link to the ContentTypes overrides. |
242
|
248
|
|
|
248
|
|
569
|
# |
243
|
|
|
|
|
|
|
|
244
|
248
|
|
|
|
|
1301
|
my $self = shift; |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
$self->_add_override( '/xl/calcChain.xml', |
247
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.calcChain+xml' ); |
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
############################################################################### |
252
|
|
|
|
|
|
|
# |
253
|
|
|
|
|
|
|
# _add_image_types() |
254
|
|
|
|
|
|
|
# |
255
|
|
|
|
|
|
|
# Add the image default types. |
256
|
|
|
|
|
|
|
# |
257
|
1
|
|
|
1
|
|
4
|
|
258
|
|
|
|
|
|
|
my $self = shift; |
259
|
1
|
|
|
|
|
2
|
my %types = @_; |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
for my $type ( keys %types ) { |
262
|
|
|
|
|
|
|
$self->_add_default( $type, 'image/' . $type ); |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
} |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
############################################################################### |
268
|
|
|
|
|
|
|
# |
269
|
|
|
|
|
|
|
# _add_table_name() |
270
|
|
|
|
|
|
|
# |
271
|
|
|
|
|
|
|
# Add the name of a table to the ContentTypes overrides. |
272
|
892
|
|
|
892
|
|
2111
|
# |
273
|
892
|
|
|
|
|
2278
|
|
274
|
|
|
|
|
|
|
my $self = shift; |
275
|
892
|
|
|
|
|
3878
|
my $table_name = shift; |
276
|
119
|
|
|
|
|
564
|
|
277
|
|
|
|
|
|
|
$table_name = "/xl/tables/$table_name.xml"; |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
$self->_add_override( $table_name, |
280
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.table+xml' ); |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
############################################################################### |
285
|
|
|
|
|
|
|
# |
286
|
|
|
|
|
|
|
# _add_vba_project() |
287
|
|
|
|
|
|
|
# |
288
|
|
|
|
|
|
|
# Add a vbaProject to the ContentTypes defaults. |
289
|
37
|
|
|
37
|
|
76
|
# |
290
|
37
|
|
|
|
|
92
|
|
291
|
|
|
|
|
|
|
my $self = shift; |
292
|
37
|
|
|
|
|
96
|
|
293
|
|
|
|
|
|
|
# Change the workbook.xml content-type from xlsx to xlsm. |
294
|
37
|
|
|
|
|
130
|
for my $aref ( @{ $self->{_overrides} } ) { |
295
|
|
|
|
|
|
|
if ( $aref->[0] eq '/xl/workbook.xml' ) { |
296
|
|
|
|
|
|
|
$aref->[1] = 'application/vnd.ms-excel.sheet.macroEnabled.main+xml'; |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
} |
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
$self->_add_default( 'bin', 'application/vnd.ms-office.vbaProject' ); |
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
############################################################################### |
305
|
|
|
|
|
|
|
# |
306
|
|
|
|
|
|
|
# _add_custom_properties() |
307
|
6
|
|
|
6
|
|
89
|
# |
308
|
|
|
|
|
|
|
# Add the custom properties to the ContentTypes overrides. |
309
|
|
|
|
|
|
|
# |
310
|
6
|
|
|
|
|
94
|
|
|
6
|
|
|
|
|
16
|
|
311
|
36
|
100
|
|
|
|
197
|
my $self = shift; |
312
|
6
|
|
|
|
|
13
|
my $custom = "/docProps/custom.xml"; |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
$self->_add_override( $custom, $app_document . 'custom-properties+xml' ); |
315
|
|
|
|
|
|
|
} |
316
|
6
|
|
|
|
|
103
|
|
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
############################################################################### |
319
|
|
|
|
|
|
|
# |
320
|
|
|
|
|
|
|
# _add_metadata() |
321
|
|
|
|
|
|
|
# |
322
|
|
|
|
|
|
|
# Add the metadata file to the ContentTypes overrides. |
323
|
|
|
|
|
|
|
# |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
my $self = shift; |
326
|
|
|
|
|
|
|
my $custom = "/xl/metadata.xml"; |
327
|
|
|
|
|
|
|
|
328
|
4
|
|
|
4
|
|
8
|
$self->_add_override( $custom, |
329
|
4
|
|
|
|
|
30
|
$app_document . 'spreadsheetml.sheetMetadata+xml' ); |
330
|
|
|
|
|
|
|
} |
331
|
4
|
|
|
|
|
23
|
|
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
############################################################################### |
334
|
|
|
|
|
|
|
# |
335
|
|
|
|
|
|
|
# Internal methods. |
336
|
|
|
|
|
|
|
# |
337
|
|
|
|
|
|
|
############################################################################### |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
############################################################################### |
341
|
|
|
|
|
|
|
# |
342
|
|
|
|
|
|
|
# _write_defaults() |
343
|
1
|
|
|
1
|
|
2
|
# |
344
|
1
|
|
|
|
|
2
|
# Write out all of the <Default> types. |
345
|
|
|
|
|
|
|
# |
346
|
1
|
|
|
|
|
4
|
|
347
|
|
|
|
|
|
|
my $self = shift; |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
for my $aref ( @{ $self->{_defaults} } ) { |
350
|
|
|
|
|
|
|
#<<< |
351
|
|
|
|
|
|
|
$self->xml_empty_tag( |
352
|
|
|
|
|
|
|
'Default', |
353
|
|
|
|
|
|
|
'Extension', $aref->[0], |
354
|
|
|
|
|
|
|
'ContentType', $aref->[1] ); |
355
|
|
|
|
|
|
|
#>>> |
356
|
|
|
|
|
|
|
} |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
############################################################################### |
361
|
|
|
|
|
|
|
# |
362
|
|
|
|
|
|
|
# _write_overrides() |
363
|
|
|
|
|
|
|
# |
364
|
|
|
|
|
|
|
# Write out all of the <Override> types. |
365
|
|
|
|
|
|
|
# |
366
|
893
|
|
|
893
|
|
2079
|
|
367
|
|
|
|
|
|
|
my $self = shift; |
368
|
893
|
|
|
|
|
1795
|
|
|
893
|
|
|
|
|
2932
|
|
369
|
|
|
|
|
|
|
for my $aref ( @{ $self->{_overrides} } ) { |
370
|
1975
|
|
|
|
|
7780
|
#<<< |
371
|
|
|
|
|
|
|
$self->xml_empty_tag( |
372
|
|
|
|
|
|
|
'Override', |
373
|
|
|
|
|
|
|
'PartName', $aref->[0], |
374
|
|
|
|
|
|
|
'ContentType', $aref->[1] ); |
375
|
|
|
|
|
|
|
#>>> |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
} |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
############################################################################### |
381
|
|
|
|
|
|
|
# |
382
|
|
|
|
|
|
|
# XML writing methods. |
383
|
|
|
|
|
|
|
# |
384
|
|
|
|
|
|
|
############################################################################### |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
|
387
|
893
|
|
|
893
|
|
1909
|
############################################################################### |
388
|
|
|
|
|
|
|
# |
389
|
893
|
|
|
|
|
1872
|
# _write_types() |
|
893
|
|
|
|
|
2570
|
|
390
|
|
|
|
|
|
|
# |
391
|
6791
|
|
|
|
|
15626
|
# Write the <Types> element. |
392
|
|
|
|
|
|
|
# |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
my $self = shift; |
395
|
|
|
|
|
|
|
my $xmlns = 'http://schemas.openxmlformats.org/package/2006/content-types'; |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
my @attributes = ( 'xmlns' => $xmlns, ); |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
$self->xml_start_tag( 'Types', @attributes ); |
400
|
|
|
|
|
|
|
} |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
############################################################################### |
403
|
|
|
|
|
|
|
# |
404
|
|
|
|
|
|
|
# _write_default() |
405
|
|
|
|
|
|
|
# |
406
|
|
|
|
|
|
|
# Write the <Default> element. |
407
|
|
|
|
|
|
|
# |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
my $self = shift; |
410
|
|
|
|
|
|
|
my $extension = shift; |
411
|
|
|
|
|
|
|
my $content_type = shift; |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
my @attributes = ( |
414
|
|
|
|
|
|
|
'Extension' => $extension, |
415
|
893
|
|
|
893
|
|
2078
|
'ContentType' => $content_type, |
416
|
893
|
|
|
|
|
2034
|
); |
417
|
|
|
|
|
|
|
|
418
|
893
|
|
|
|
|
3315
|
$self->xml_empty_tag( 'Default', @attributes ); |
419
|
|
|
|
|
|
|
} |
420
|
893
|
|
|
|
|
4809
|
|
421
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
############################################################################### |
423
|
|
|
|
|
|
|
# |
424
|
|
|
|
|
|
|
# _write_override() |
425
|
|
|
|
|
|
|
# |
426
|
|
|
|
|
|
|
# Write the <Override> element. |
427
|
|
|
|
|
|
|
# |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
my $self = shift; |
430
|
|
|
|
|
|
|
my $part_name = shift; |
431
|
1
|
|
|
1
|
|
9
|
my $content_type = shift; |
432
|
1
|
|
|
|
|
2
|
my $writer = $self; |
433
|
1
|
|
|
|
|
2
|
|
434
|
|
|
|
|
|
|
my @attributes = ( |
435
|
1
|
|
|
|
|
2
|
'PartName' => $part_name, |
436
|
|
|
|
|
|
|
'ContentType' => $content_type, |
437
|
|
|
|
|
|
|
); |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
$self->xml_empty_tag( 'Override', @attributes ); |
440
|
1
|
|
|
|
|
6
|
} |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
1; |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
=pod |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
=head1 NAME |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
Excel::Writer::XLSX::Package::ContentTypes - A class for writing the Excel XLSX [Content_Types] file. |
452
|
1
|
|
|
1
|
|
8
|
|
453
|
1
|
|
|
|
|
2
|
=head1 SYNOPSIS |
454
|
1
|
|
|
|
|
1
|
|
455
|
1
|
|
|
|
|
2
|
See the documentation for L<Excel::Writer::XLSX>. |
456
|
|
|
|
|
|
|
|
457
|
1
|
|
|
|
|
3
|
=head1 DESCRIPTION |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
This module is used in conjunction with L<Excel::Writer::XLSX>. |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
=head1 AUTHOR |
462
|
1
|
|
|
|
|
5
|
|
463
|
|
|
|
|
|
|
John McNamara jmcnamara@cpan.org |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
=head1 COPYRIGHT |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
(c) MM-MMXXI, John McNamara. |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
=head1 LICENSE |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
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>. |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTY |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
See the documentation for L<Excel::Writer::XLSX>. |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
=cut |