unxls 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ext/extconf.rb +4 -0
- data/lib/formulas/constants.rb +886 -0
- data/lib/formulas/map.rb +5 -0
- data/lib/formulas/parsed_expressions.rb +229 -0
- data/lib/formulas/record.rb +130 -0
- data/lib/formulas/structure.rb +30 -0
- data/lib/unxls.rb +16 -0
- data/lib/unxls/biff8/browser.rb +347 -0
- data/lib/unxls/biff8/constants.rb +624 -0
- data/lib/unxls/biff8/record.rb +1267 -0
- data/lib/unxls/biff8/structure.rb +2740 -0
- data/lib/unxls/biff8/workbook_stream.rb +322 -0
- data/lib/unxls/bit_ops.rb +92 -0
- data/lib/unxls/dtyp.rb +33 -0
- data/lib/unxls/log.rb +59 -0
- data/lib/unxls/map.rb +59 -0
- data/lib/unxls/offcrypto.rb +423 -0
- data/lib/unxls/oshared.rb +210 -0
- data/lib/unxls/parser.rb +100 -0
- data/lib/unxls/version.rb +5 -0
- data/spec/bitops_spec.rb +95 -0
- data/spec/spec_helper.rb +117 -0
- data/spec/unxls_spec.rb +2651 -0
- metadata +167 -0
@@ -0,0 +1,624 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Unxls::Biff8::Constants
|
4
|
+
|
5
|
+
RECORD_IDS = {
|
6
|
+
6 => :Formula, # section 2.4.127
|
7
|
+
9 => :BOF, # 0x0009 used in BIFF2 streams
|
8
|
+
10 => :EOF, # section 2.4.103
|
9
|
+
12 => :CalcCount, # section 2.4.31
|
10
|
+
13 => :CalcMode, # section 2.4.34
|
11
|
+
14 => :CalcPrecision, # section 2.4.35
|
12
|
+
15 => :CalcRefMode, # section 2.4.36
|
13
|
+
16 => :CalcDelta, # section 2.4.32
|
14
|
+
17 => :CalcIter, # section 2.4.33
|
15
|
+
18 => :Protect, # section 2.4.207
|
16
|
+
19 => :Password, # section 2.4.191
|
17
|
+
20 => :Header, # section 2.4.136
|
18
|
+
21 => :Footer, # section 2.4.124
|
19
|
+
23 => :ExternSheet, # section 2.4.106
|
20
|
+
24 => :Lbl, # section 2.4.150
|
21
|
+
25 => :WinProtect, # section 2.4.347
|
22
|
+
26 => :VerticalPageBreaks, # section 2.4.343
|
23
|
+
27 => :HorizontalPageBreaks, # section 2.4.142
|
24
|
+
28 => :Note, # section 2.4.179
|
25
|
+
29 => :Selection, # section 2.4.248
|
26
|
+
34 => :Date1904, # section 2.4.77
|
27
|
+
35 => :ExternName, # section 2.4.105
|
28
|
+
38 => :LeftMargin, # section 2.4.151
|
29
|
+
39 => :RightMargin, # section 2.4.219
|
30
|
+
40 => :TopMargin, # section 2.4.328
|
31
|
+
41 => :BottomMargin, # section 2.4.27
|
32
|
+
42 => :PrintRowCol, # section 2.4.203
|
33
|
+
43 => :PrintGrid, # section 2.4.202
|
34
|
+
47 => :FilePass, # section 2.4.117
|
35
|
+
49 => :Font, # section 2.4.122
|
36
|
+
51 => :PrintSize, # section 2.4.204
|
37
|
+
60 => :Continue, # section 2.4.58
|
38
|
+
61 => :Window1, # section 2.4.345
|
39
|
+
64 => :Backup, # section 2.4.14
|
40
|
+
65 => :Pane, # section 2.4.189
|
41
|
+
66 => :CodePage, # section 2.4.52
|
42
|
+
77 => :Pls, # section 2.4.199
|
43
|
+
80 => :DCon, # section 2.4.82
|
44
|
+
81 => :DConRef, # section 2.4.86
|
45
|
+
82 => :DConName, # section 2.4.85
|
46
|
+
85 => :DefColWidth, # section 2.4.89
|
47
|
+
89 => :XCT, # section 2.4.352
|
48
|
+
90 => :CRN, # section 2.4.65
|
49
|
+
91 => :FileSharing, # section 2.4.118
|
50
|
+
92 => :WriteAccess, # section 2.4.349
|
51
|
+
93 => :Obj, # section 2.4.181
|
52
|
+
94 => :Uncalced, # section 2.4.331
|
53
|
+
95 => :CalcSaveRecalc, # section 2.4.37
|
54
|
+
96 => :Template, # section 2.4.323
|
55
|
+
97 => :Intl, # section 2.4.147
|
56
|
+
99 => :ObjProtect, # section 2.4.183
|
57
|
+
125 => :ColInfo, # section 2.4.53
|
58
|
+
128 => :Guts, # section 2.4.134
|
59
|
+
129 => :WsBool, # section 2.4.351
|
60
|
+
130 => :GridSet, # section 2.4.132
|
61
|
+
131 => :HCenter, # section 2.4.135
|
62
|
+
132 => :VCenter, # section 2.4.342
|
63
|
+
133 => :BoundSheet8, # section 2.4.28
|
64
|
+
134 => :WriteProtect, # section 2.4.350
|
65
|
+
140 => :Country, # section 2.4.63
|
66
|
+
141 => :HideObj, # section 2.4.139
|
67
|
+
144 => :Sort, # section 2.4.263
|
68
|
+
146 => :Palette, # section 2.4.188
|
69
|
+
151 => :Sync, # section 2.4.318
|
70
|
+
152 => :LPr, # section 2.4.158
|
71
|
+
153 => :DxGCol, # section 2.4.98
|
72
|
+
154 => :FnGroupName, # section 2.4.120
|
73
|
+
155 => :FilterMode, # section 2.4.119
|
74
|
+
156 => :BuiltInFnGroupCount, # section 2.4.30
|
75
|
+
157 => :AutoFilterInfo, # section 2.4.8
|
76
|
+
158 => :AutoFilter, # section 2.4.6
|
77
|
+
160 => :Scl, # section 2.4.247
|
78
|
+
161 => :Setup, # section 2.4.257
|
79
|
+
174 => :ScenMan, # section 2.4.246
|
80
|
+
175 => :SCENARIO, # section 2.4.244
|
81
|
+
176 => :SxView, # section 2.4.313
|
82
|
+
177 => :Sxvd, # section 2.4.309
|
83
|
+
178 => :SXVI, # section 2.4.312
|
84
|
+
180 => :SxIvd, # section 2.4.292
|
85
|
+
181 => :SXLI, # section 2.4.293
|
86
|
+
182 => :SXPI, # section 2.4.298
|
87
|
+
184 => :DocRoute, # section 2.4.91
|
88
|
+
185 => :RecipName, # section 2.4.216
|
89
|
+
189 => :MulRk, # section 2.4.175
|
90
|
+
190 => :MulBlank, # section 2.4.174
|
91
|
+
193 => :Mms, # section 2.4.169
|
92
|
+
197 => :SXDI, # section 2.4.278
|
93
|
+
198 => :SXDB, # section 2.4.275
|
94
|
+
199 => :SXFDB, # section 2.4.283
|
95
|
+
200 => :SXDBB, # section 2.4.276
|
96
|
+
201 => :SXNum, # section 2.4.296
|
97
|
+
202 => :SxBool, # section 2.4.274
|
98
|
+
203 => :SxErr, # section 2.4.281
|
99
|
+
204 => :SXInt, # section 2.4.289
|
100
|
+
205 => :SXString, # section 2.4.304
|
101
|
+
206 => :SXDtr, # section 2.4.279
|
102
|
+
207 => :SxNil, # section 2.4.295
|
103
|
+
208 => :SXTbl, # section 2.4.305
|
104
|
+
209 => :SXTBRGIITM, # section 2.4.307
|
105
|
+
210 => :SxTbpg, # section 2.4.306
|
106
|
+
211 => :ObProj, # section 2.4.185
|
107
|
+
213 => :SXStreamID, # section 2.4.303
|
108
|
+
215 => :DBCell, # section 2.4.78
|
109
|
+
216 => :SXRng, # section 2.4.300
|
110
|
+
217 => :SxIsxoper, # section 2.4.290
|
111
|
+
218 => :BookBool, # section 2.4.22
|
112
|
+
220 => :DbOrParamQry, # section 2.4.79
|
113
|
+
221 => :ScenarioProtect, # section 2.4.245
|
114
|
+
222 => :OleObjectSize, # section 2.4.187
|
115
|
+
224 => :XF, # section 2.4.353
|
116
|
+
225 => :InterfaceHdr, # section 2.4.146
|
117
|
+
226 => :InterfaceEnd, # section 2.4.145
|
118
|
+
227 => :SXVS, # section 2.4.317
|
119
|
+
229 => :MergeCells, # section 2.4.168
|
120
|
+
233 => :BkHim, # section 2.4.19
|
121
|
+
235 => :MsoDrawingGroup, # section 2.4.171
|
122
|
+
236 => :MsoDrawing, # section 2.4.170
|
123
|
+
237 => :MsoDrawingSelection, # section 2.4.172
|
124
|
+
239 => :PhoneticInfo, # section 2.4.192
|
125
|
+
240 => :SxRule, # section 2.4.301
|
126
|
+
241 => :SXEx, # section 2.4.282
|
127
|
+
242 => :SxFilt, # section 2.4.285
|
128
|
+
244 => :SxDXF, # section 2.4.280
|
129
|
+
245 => :SxItm, # section 2.4.291
|
130
|
+
246 => :SxName, # section 2.4.294
|
131
|
+
247 => :SxSelect, # section 2.4.302
|
132
|
+
248 => :SXPair, # section 2.4.297
|
133
|
+
249 => :SxFmla, # section 2.4.286
|
134
|
+
251 => :SxFormat, # section 2.4.287
|
135
|
+
252 => :SST, # section 2.4.265
|
136
|
+
253 => :LabelSst, # section 2.4.149
|
137
|
+
255 => :ExtSST, # section 2.4.107
|
138
|
+
256 => :SXVDEx, # section 2.4.310
|
139
|
+
259 => :SXFormula, # section 2.4.288
|
140
|
+
290 => :SXDBEx, # section 2.4.277
|
141
|
+
311 => :RRDInsDel, # section 2.4.228
|
142
|
+
312 => :RRDHead, # section 2.4.226
|
143
|
+
315 => :RRDChgCell, # section 2.4.223
|
144
|
+
317 => :RRTabId, # section 2.4.241
|
145
|
+
318 => :RRDRenSheet, # section 2.4.234
|
146
|
+
319 => :RRSort, # section 2.4.240
|
147
|
+
320 => :RRDMove, # section 2.4.231
|
148
|
+
330 => :RRFormat, # section 2.4.238
|
149
|
+
331 => :RRAutoFmt, # section 2.4.222
|
150
|
+
333 => :RRInsertSh, # section 2.4.239
|
151
|
+
334 => :RRDMoveBegin, # section 2.4.232
|
152
|
+
335 => :RRDMoveEnd, # section 2.4.233
|
153
|
+
336 => :RRDInsDelBegin, # section 2.4.229
|
154
|
+
337 => :RRDInsDelEnd, # section 2.4.230
|
155
|
+
338 => :RRDConflict, # section 2.4.224
|
156
|
+
339 => :RRDDefName, # section 2.4.225
|
157
|
+
340 => :RRDRstEtxp, # section 2.4.235
|
158
|
+
351 => :LRng, # section 2.4.159
|
159
|
+
352 => :UsesELFs, # section 2.4.337
|
160
|
+
353 => :DSF, # section 2.4.94
|
161
|
+
401 => :CUsr, # section 2.4.72
|
162
|
+
402 => :CbUsr, # section 2.4.40
|
163
|
+
403 => :UsrInfo, # section 2.4.340
|
164
|
+
404 => :UsrExcl, # section 2.4.339
|
165
|
+
405 => :FileLock, # section 2.4.116
|
166
|
+
406 => :RRDInfo, # section 2.4.227
|
167
|
+
407 => :BCUsrs, # section 2.4.16
|
168
|
+
408 => :UsrChk, # section 2.4.338
|
169
|
+
425 => :UserBView, # section 2.4.333
|
170
|
+
426 => :UserSViewBegin, # section 2.4.334
|
171
|
+
# 426 => :UserSViewBegin_Chart, # section 2.4.335
|
172
|
+
427 => :UserSViewEnd, # section 2.4.336
|
173
|
+
428 => :RRDUserView, # section 2.4.237
|
174
|
+
429 => :Qsi, # section 2.4.208
|
175
|
+
430 => :SupBook, # section 2.4.271
|
176
|
+
431 => :Prot4Rev, # section 2.4.205
|
177
|
+
432 => :CondFmt, # section 2.4.56
|
178
|
+
433 => :CF, # section 2.4.42
|
179
|
+
434 => :DVal, # section 2.4.96
|
180
|
+
437 => :DConBin, # section 2.4.83
|
181
|
+
438 => :TxO, # section 2.4.329
|
182
|
+
439 => :RefreshAll, # section 2.4.217
|
183
|
+
440 => :HLink, # section 2.4.140
|
184
|
+
441 => :Lel, # section 2.4.154
|
185
|
+
442 => :CodeName, # section 2.4.51
|
186
|
+
443 => :SXFDBType, # section 2.4.284
|
187
|
+
444 => :Prot4RevPass, # section 2.4.206
|
188
|
+
445 => :ObNoMacros, # section 2.4.184
|
189
|
+
446 => :Dv, # section 2.4.95
|
190
|
+
448 => :Excel9File, # section 2.4.104
|
191
|
+
449 => :RecalcId, # section 2.4.215
|
192
|
+
450 => :EntExU2, # section 2.4.102
|
193
|
+
512 => :Dimensions, # section 2.4.90
|
194
|
+
513 => :Blank, # section 2.4.20
|
195
|
+
515 => :Number, # section 2.4.180
|
196
|
+
516 => :Label, # section 2.4.148
|
197
|
+
517 => :BoolErr, # section 2.4.24
|
198
|
+
519 => :String, # section 2.4.268
|
199
|
+
520 => :Row, # section 2.4.221
|
200
|
+
521 => :BOF, # 0x0209 used in BIFF3 streams
|
201
|
+
523 => :Index, # section 2.4.144
|
202
|
+
545 => :Array, # section 2.4.4
|
203
|
+
549 => :DefaultRowHeight, # section 2.4.87
|
204
|
+
566 => :Table, # section 2.4.319
|
205
|
+
574 => :Window2, # section 2.4.346
|
206
|
+
638 => :RK, # section 2.4.220
|
207
|
+
659 => :Style, # section 2.4.269
|
208
|
+
1033 => :BOF, # 0x0409 used in BIFF4 streams
|
209
|
+
1048 => :BigName, # section 2.4.18
|
210
|
+
1054 => :Format, # section 2.4.126
|
211
|
+
1084 => :ContinueBigName, # section 2.4.59
|
212
|
+
1212 => :ShrFmla, # section 2.4.260
|
213
|
+
2048 => :HLinkTooltip, # section 2.4.141
|
214
|
+
2049 => :WebPub, # section 2.4.344
|
215
|
+
2050 => :QsiSXTag, # section 2.4.211
|
216
|
+
2051 => :DBQueryExt, # section 2.4.81
|
217
|
+
2052 => :ExtString, # section 2.4.108
|
218
|
+
2053 => :TxtQry, # section 2.4.330
|
219
|
+
2054 => :Qsir, # section 2.4.210
|
220
|
+
2055 => :Qsif, # section 2.4.209
|
221
|
+
2056 => :RRDTQSIF, # section 2.4.236
|
222
|
+
2057 => :BOF, # section 2.4.21; 0x0809 used in BIFF5/7/8 streams
|
223
|
+
2058 => :OleDbConn, # section 2.4.186
|
224
|
+
2059 => :WOpt, # section 2.4.348
|
225
|
+
2060 => :SXViewEx, # section 2.4.314
|
226
|
+
2061 => :SXTH, # section 2.4.308
|
227
|
+
2062 => :SXPIEx, # section 2.4.299
|
228
|
+
2063 => :SXVDTEx, # section 2.4.311
|
229
|
+
2064 => :SXViewEx9, # section 2.4.315
|
230
|
+
2066 => :ContinueFrt, # section 2.4.60
|
231
|
+
2067 => :RealTimeData, # section 2.4.214
|
232
|
+
2128 => :ChartFrtInfo, # section 2.4.49
|
233
|
+
2129 => :FrtWrapper, # section 2.4.130
|
234
|
+
2130 => :StartBlock, # section 2.4.266
|
235
|
+
2131 => :EndBlock, # section 2.4.100
|
236
|
+
2132 => :StartObject, # section 2.4.267
|
237
|
+
2133 => :EndObject, # section 2.4.101
|
238
|
+
2134 => :CatLab, # section 2.4.38
|
239
|
+
2135 => :YMult, # section 2.4.356
|
240
|
+
2136 => :SXViewLink, # section 2.4.316
|
241
|
+
2137 => :PivotChartBits, # section 2.4.196
|
242
|
+
2138 => :FrtFontList, # section 2.4.129
|
243
|
+
2146 => :SheetExt, # section 2.4.259
|
244
|
+
2147 => :BookExt, # section 2.4.23
|
245
|
+
2148 => :SXAddl, # section 2.4.273.2
|
246
|
+
2149 => :CrErr, # section 2.4.64
|
247
|
+
2150 => :HFPicture, # section 2.4.138
|
248
|
+
2151 => :FeatHdr, # section 2.4.112
|
249
|
+
2152 => :Feat, # section 2.4.111
|
250
|
+
2154 => :DataLabExt, # section 2.4.75
|
251
|
+
2155 => :DataLabExtContents, # section 2.4.76
|
252
|
+
2156 => :CellWatch, # section 2.4.41
|
253
|
+
2161 => :FeatHdr11, # section 2.4.113
|
254
|
+
2162 => :Feature11, # section 2.4.114
|
255
|
+
2164 => :DropDownObjIds, # section 2.4.93
|
256
|
+
2165 => :ContinueFrt11, # section 2.4.61
|
257
|
+
2166 => :DConn, # section 2.4.84
|
258
|
+
2167 => :List12, # section 2.4.157
|
259
|
+
2168 => :Feature12, # section 2.4.115
|
260
|
+
2169 => :CondFmt12, # section 2.4.57
|
261
|
+
2170 => :CF12, # section 2.4.43
|
262
|
+
2171 => :CFEx, # section 2.4.44
|
263
|
+
2172 => :XFCRC, # section 2.4.354
|
264
|
+
2173 => :XFExt, # section 2.4.355
|
265
|
+
2174 => :AutoFilter12, # section 2.4.7
|
266
|
+
2175 => :ContinueFrt12, # section 2.4.62
|
267
|
+
2180 => :MDTInfo, # section 2.4.162
|
268
|
+
2181 => :MDXStr, # section 2.4.166
|
269
|
+
2182 => :MDXTuple, # section 2.4.167
|
270
|
+
2183 => :MDXSet, # section 2.4.165
|
271
|
+
2184 => :MDXProp, # section 2.4.164
|
272
|
+
2185 => :MDXKPI, # section 2.4.163
|
273
|
+
2186 => :MDB, # section 2.4.161
|
274
|
+
2187 => :PLV, # section 2.4.200
|
275
|
+
2188 => :Compat12, # section 2.4.54
|
276
|
+
2189 => :DXF, # section 2.4.97
|
277
|
+
2190 => :TableStyles, # section 2.4.322
|
278
|
+
2191 => :TableStyle, # section 2.4.320
|
279
|
+
2192 => :TableStyleElement, # section 2.4.321
|
280
|
+
2194 => :StyleExt, # section 2.4.270
|
281
|
+
2195 => :NamePublish, # section 2.4.178
|
282
|
+
2196 => :NameCmt, # section 2.4.176
|
283
|
+
2197 => :SortData, # section 2.4.264
|
284
|
+
2198 => :Theme, # section 2.4.326
|
285
|
+
2199 => :GUIDTypeLib, # section 2.4.133
|
286
|
+
2200 => :FnGrp12, # section 2.4.121
|
287
|
+
2201 => :NameFnGrp12, # section 2.4.177
|
288
|
+
2202 => :MTRSettings, # section 2.4.173
|
289
|
+
2203 => :CompressPictures, # section 2.4.55
|
290
|
+
2204 => :HeaderFooter, # section 2.4.137
|
291
|
+
2205 => :CrtLayout12, # section 2.4.66
|
292
|
+
2206 => :CrtMlFrt, # section 2.4.70
|
293
|
+
2207 => :CrtMlFrtContinue, # section 2.4.71
|
294
|
+
2211 => :ForceFullCalculation, # section 2.4.125
|
295
|
+
2212 => :ShapePropsStream, # section 2.4.258
|
296
|
+
2213 => :TextPropsStream, # section 2.4.325
|
297
|
+
2214 => :RichTextStream, # section 2.4.218
|
298
|
+
2215 => :CrtLayout12A, # section 2.4.67
|
299
|
+
4097 => :Units, # section 2.4.332
|
300
|
+
4098 => :Chart, # section 2.4.45
|
301
|
+
4099 => :Series, # section 2.4.252
|
302
|
+
4102 => :DataFormat, # section 2.4.74
|
303
|
+
4103 => :LineFormat, # section 2.4.156
|
304
|
+
4105 => :MarkerFormat, # section 2.4.160
|
305
|
+
4106 => :AreaFormat, # section 2.4.3
|
306
|
+
4107 => :PieFormat, # section 2.4.195
|
307
|
+
4108 => :AttachedLabel, # section 2.4.5
|
308
|
+
4109 => :SeriesText, # section 2.4.254
|
309
|
+
4116 => :ChartFormat, # section 2.4.48
|
310
|
+
4117 => :Legend, # section 2.4.152
|
311
|
+
4118 => :SeriesList, # section 2.4.253
|
312
|
+
4119 => :Bar, # section 2.4.15
|
313
|
+
4120 => :Line, # section 2.4.155
|
314
|
+
4121 => :Pie, # section 2.4.194
|
315
|
+
4122 => :Area, # section 2.4.2
|
316
|
+
4123 => :Scatter, # section 2.4.243
|
317
|
+
4124 => :CrtLine, # section 2.4.68
|
318
|
+
4125 => :Axis, # section 2.4.11
|
319
|
+
4126 => :Tick, # section 2.4.327
|
320
|
+
4127 => :ValueRange, # section 2.4.341
|
321
|
+
4128 => :CatSerRange, # section 2.4.39
|
322
|
+
4129 => :AxisLine, # section 2.4.12
|
323
|
+
4130 => :CrtLink, # section 2.4.69
|
324
|
+
4132 => :DefaultText, # section 2.4.88
|
325
|
+
4133 => :Text, # section 2.4.324
|
326
|
+
4134 => :FontX, # section 2.4.123
|
327
|
+
4135 => :ObjectLink, # section 2.4.182
|
328
|
+
4146 => :Frame, # section 2.4.128
|
329
|
+
4147 => :Begin, # section 2.4.17
|
330
|
+
4148 => :End, # section 2.4.99
|
331
|
+
4149 => :PlotArea, # section 2.4.197
|
332
|
+
4154 => :Chart3d, # section 2.4.46
|
333
|
+
4156 => :PicF, # section 2.4.193
|
334
|
+
4157 => :DropBar, # section 2.4.92
|
335
|
+
4158 => :Radar, # section 2.4.212
|
336
|
+
4159 => :Surf, # section 2.4.272
|
337
|
+
4160 => :RadarArea, # section 2.4.213
|
338
|
+
4161 => :AxisParent, # section 2.4.13
|
339
|
+
4163 => :LegendException, # section 2.4.153
|
340
|
+
4164 => :ShtProps, # section 2.4.261
|
341
|
+
4165 => :SerToCrt, # section 2.4.256
|
342
|
+
4166 => :AxesUsed, # section 2.4.10
|
343
|
+
4168 => :SBaseRef, # section 2.4.242
|
344
|
+
4170 => :SerParent, # section 2.4.255
|
345
|
+
4171 => :SerAuxTrend, # section 2.4.250
|
346
|
+
4174 => :IFmtRecord, # section 2.4.143
|
347
|
+
4175 => :Pos, # section 2.4.201
|
348
|
+
4176 => :AlRuns, # section 2.4.1
|
349
|
+
4177 => :BRAI, # section 2.4.29
|
350
|
+
4187 => :SerAuxErrBar, # section 2.4.249
|
351
|
+
4188 => :ClrtClient, # section 2.4.50
|
352
|
+
4189 => :SerFmt, # section 2.4.251
|
353
|
+
4191 => :Chart3DBarShape, # section 2.4.47
|
354
|
+
4192 => :Fbi, # section 2.4.109
|
355
|
+
4193 => :BopPop, # section 2.4.25
|
356
|
+
4194 => :AxcExt, # section 2.4.9
|
357
|
+
4195 => :Dat, # section 2.4.73
|
358
|
+
4196 => :PlotGrowth, # section 2.4.198
|
359
|
+
4197 => :SIIndex, # section 2.4.262
|
360
|
+
4198 => :GelFrame, # section 2.4.131
|
361
|
+
4199 => :BopPopCustom, # section 2.4.26
|
362
|
+
4200 => :Fbi2, # section 2.4.110
|
363
|
+
}.freeze
|
364
|
+
|
365
|
+
CONTINUE_RECORDS = [
|
366
|
+
:Continue,
|
367
|
+
:ContinueFrt,
|
368
|
+
:ContinueFrt11,
|
369
|
+
:ContinueFrt12,
|
370
|
+
:ContinueBigName,
|
371
|
+
:CrtMlFrtContinue,
|
372
|
+
].freeze
|
373
|
+
|
374
|
+
# See "5.17 CODEPAGE" of OpenOffice's doc, p.145
|
375
|
+
# @todo Move to BIFF submodules for versions <8 as BIFF8 CodePage is always UTF-16LE
|
376
|
+
CODEPAGES = {
|
377
|
+
0x016F => :ASCII, # 367
|
378
|
+
0x01B5 => :CP437, # IBM PC CP-437 (US), 437
|
379
|
+
0x02D0 => :CP720, # IBM PC CP-720 (OEM Arabic), 720
|
380
|
+
0x02E1 => :CP737, # IBM PC CP-737 (Greek), 737
|
381
|
+
0x0307 => :CP775, # IBM PC CP-775 (Baltic), 775
|
382
|
+
0x0352 => :CP850, # IBM PC CP-850 (Latin I), 850
|
383
|
+
0x0354 => :CP852, # IBM PC CP-852 (Latin II (Central European)), 852
|
384
|
+
0x0357 => :CP855, # IBM PC CP-855 (Cyrillic), 855
|
385
|
+
0x0359 => :CP857, # IBM PC CP-857 (Turkish), 857
|
386
|
+
0x035A => :CP858, # IBM PC CP-858 (Multilingual Latin I with Euro), 858
|
387
|
+
0x035C => :CP860, # IBM PC CP-860 (Portuguese), 860
|
388
|
+
0x035D => :CP861, # IBM PC CP-861 (Icelandic), 861
|
389
|
+
0x035E => :CP862, # IBM PC CP-862 (Hebrew), 862
|
390
|
+
0x035F => :CP863, # IBM PC CP-863 (Canadian (French)), 863
|
391
|
+
0x0360 => :CP864, # IBM PC CP-864 (Arabic), 864
|
392
|
+
0x0361 => :CP865, # IBM PC CP-865 (Nordic), 865
|
393
|
+
0x0362 => :CP866, # IBM PC CP-866 (Cyrillic (Russian)), 866
|
394
|
+
0x0365 => :CP869, # IBM PC CP-869 (Greek (Modern)), 869
|
395
|
+
0x036A => :CP874, # Windows CP-874 (Thai), 874
|
396
|
+
0x03A4 => :'Windows-932', # (Japanese Shift-JIS), 932
|
397
|
+
0x03A8 => :'Windows-936', # (Chinese Simplified GBK), 936
|
398
|
+
0x03B5 => :'Windows-949', # (Korean (Wansung)), 949
|
399
|
+
0x03B6 => :'Windows-950', # (Chinese Traditional BIG5), 950
|
400
|
+
0x04B0 => :'UTF-16LE', # (BIFF8), 1200
|
401
|
+
0x04E2 => :'Windows-1250', # (Latin II) (Central European), 1250
|
402
|
+
0x04E3 => :'Windows-1251', # (Cyrillic), 1251
|
403
|
+
0x04E4 => :'Windows-1252', # (Latin I) (BIFF4-BIFF5), 1252
|
404
|
+
0x04E5 => :'Windows-1253', # (Greek), 1253
|
405
|
+
0x04E6 => :'Windows-1254', # (Turkish), 1254
|
406
|
+
0x04E7 => :'Windows-1255', # (Hebrew), 1255
|
407
|
+
0x04E8 => :'Windows-1256', # (Arabic), 1256
|
408
|
+
0x04E9 => :'Windows-1257', # (Baltic), 1257
|
409
|
+
0x04EA => :'Windows-1258', # (Vietnamese), 1258
|
410
|
+
0x0551 => :'Windows-1361', # (Korean (Johab)), 1361
|
411
|
+
0x2710 => :MacRoman, # Apple Roman, 10000
|
412
|
+
0x8000 => :MacRoman, # Apple Roman, 32768
|
413
|
+
0x8001 => :'Windows-1252' # (Latin I) (BIFF2-BIFF3), 32769
|
414
|
+
}.freeze
|
415
|
+
|
416
|
+
CHARSETS = {
|
417
|
+
0x00 => :ANSI, # ANSI Latin
|
418
|
+
0x01 => :Default, # System default
|
419
|
+
0x02 => :Symbol, # Symbol
|
420
|
+
0x4D => :Mac, # Apple Roman
|
421
|
+
0x80 => :ShiftJIS, # ANSI Japanese Shift-JIS
|
422
|
+
0x81 => :Jangul, # ANSI Korean (Hangul)
|
423
|
+
0x82 => :Johab, # ANSI Korean (Johab)
|
424
|
+
0x86 => :GB2312, # ANSI Chinese Simplified GBK
|
425
|
+
0x88 => :ChineseBIG5, # ANSI Chinese Traditional BIG5
|
426
|
+
0xA1 => :Greek, # ANSI Greek
|
427
|
+
0xA2 => :Turkish, # ANSI Turkish
|
428
|
+
0xA3 => :Vietnamese, # ANSI Vietnamese
|
429
|
+
0xB1 => :Hebrew, # ANSI Hebrew
|
430
|
+
0xB2 => :Arabic, # ANSI Arabic
|
431
|
+
0xBA => :Baltic, # ANSI Baltic
|
432
|
+
0xCC => :Russian, # ANSI Cyrillic
|
433
|
+
0xDD => :Thai, # ANSI Thai
|
434
|
+
0xEE => :EastEurope, # ANSI Latin II (Central European)
|
435
|
+
0xFF => :OEM # OEM Latin I
|
436
|
+
}.freeze
|
437
|
+
|
438
|
+
COUNTRIES = {
|
439
|
+
1 => :'United States',
|
440
|
+
2 => :Canada,
|
441
|
+
3 => :'Latin America except Brazil',
|
442
|
+
7 => :Russia,
|
443
|
+
20 => :Egypt,
|
444
|
+
30 => :Greece,
|
445
|
+
31 => :Netherlands,
|
446
|
+
32 => :Belgium,
|
447
|
+
33 => :France,
|
448
|
+
34 => :Spain,
|
449
|
+
36 => :Hungary,
|
450
|
+
39 => :Italy,
|
451
|
+
41 => :Switzerland,
|
452
|
+
43 => :Austria,
|
453
|
+
44 => :'United Kingdom',
|
454
|
+
45 => :Denmark,
|
455
|
+
46 => :Sweden,
|
456
|
+
47 => :Norway,
|
457
|
+
48 => :Poland,
|
458
|
+
49 => :Germany,
|
459
|
+
52 => :Mexico,
|
460
|
+
55 => :Brazil,
|
461
|
+
61 => :Australia,
|
462
|
+
64 => :'New Zealand',
|
463
|
+
66 => :Thailand,
|
464
|
+
81 => :Japan,
|
465
|
+
82 => :Korea,
|
466
|
+
84 => :'Viet Nam',
|
467
|
+
86 => :"People's Republic of China",
|
468
|
+
90 => :Turkey,
|
469
|
+
213 => :Algeria,
|
470
|
+
216 => :Morocco,
|
471
|
+
218 => :Libya,
|
472
|
+
351 => :Portugal,
|
473
|
+
354 => :Iceland,
|
474
|
+
358 => :Finland,
|
475
|
+
420 => :'Czech Republic',
|
476
|
+
886 => :Taiwan,
|
477
|
+
961 => :Lebanon,
|
478
|
+
962 => :Jordan,
|
479
|
+
963 => :Syria,
|
480
|
+
964 => :Iraq,
|
481
|
+
965 => :Kuwait,
|
482
|
+
966 => :'Saudi Arabia',
|
483
|
+
971 => :'United Arab Emirates',
|
484
|
+
972 => :Israel,
|
485
|
+
974 => :Qatar,
|
486
|
+
981 => :Iran
|
487
|
+
}.freeze
|
488
|
+
|
489
|
+
# See G.2 Built-in Cell Styles (p. 4456), Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf
|
490
|
+
BUILTIN_STYLES = {
|
491
|
+
0 => :'Normal',
|
492
|
+
1 => :'RowLevel_',
|
493
|
+
2 => :'ColLevel_',
|
494
|
+
3 => :'Comma',
|
495
|
+
4 => :'Currency',
|
496
|
+
5 => :'Percent',
|
497
|
+
6 => :'Comma [0]',
|
498
|
+
7 => :'Currency [0]',
|
499
|
+
8 => :'Hyperlink',
|
500
|
+
9 => :'Followed Hyperlink',
|
501
|
+
10 => :'Note',
|
502
|
+
11 => :'Warning Text',
|
503
|
+
# 12 => :'Emphasis 1', # not in the specification
|
504
|
+
# 13 => :'Emphasis 2', # not in the specification
|
505
|
+
# 14 => :'Emphasis 3', # not in the specification
|
506
|
+
15 => :'Title',
|
507
|
+
16 => :'Heading 1',
|
508
|
+
17 => :'Heading 2',
|
509
|
+
18 => :'Heading 3',
|
510
|
+
19 => :'Heading 4',
|
511
|
+
20 => :'Input',
|
512
|
+
21 => :'Output',
|
513
|
+
22 => :'Calculation',
|
514
|
+
23 => :'Check Cell',
|
515
|
+
24 => :'Linked Cell',
|
516
|
+
25 => :'Total',
|
517
|
+
26 => :'Good',
|
518
|
+
27 => :'Bad',
|
519
|
+
28 => :'Neutral',
|
520
|
+
29 => :'Accent1',
|
521
|
+
30 => :'20% - Accent1',
|
522
|
+
31 => :'40% - Accent1',
|
523
|
+
32 => :'60% - Accent1',
|
524
|
+
33 => :'Accent2',
|
525
|
+
34 => :'20% - Accent2',
|
526
|
+
35 => :'40% - Accent2',
|
527
|
+
36 => :'60% - Accent2',
|
528
|
+
37 => :'Accent3',
|
529
|
+
38 => :'20% - Accent3',
|
530
|
+
39 => :'40% - Accent3',
|
531
|
+
40 => :'60% - Accent3',
|
532
|
+
41 => :'Accent4',
|
533
|
+
42 => :'20% - Accent4',
|
534
|
+
43 => :'40% - Accent4',
|
535
|
+
44 => :'60% - Accent4',
|
536
|
+
45 => :'Accent5',
|
537
|
+
46 => :'20% - Accent5',
|
538
|
+
47 => :'40% - Accent5',
|
539
|
+
48 => :'60% - Accent5',
|
540
|
+
49 => :'Accent6',
|
541
|
+
50 => :'20% - Accent6',
|
542
|
+
51 => :'40% - Accent6',
|
543
|
+
52 => :'60% - Accent6',
|
544
|
+
53 => :'Explanatory Text',
|
545
|
+
}.freeze
|
546
|
+
|
547
|
+
# See p. 699
|
548
|
+
ICV_COLOR_TABLE = {
|
549
|
+
# Built-in
|
550
|
+
0x0000 => { name: :Black, rgb: :'000000' },
|
551
|
+
0x0001 => { name: :White, rgb: :'FFFFFF' },
|
552
|
+
0x0002 => { name: :Red, rgb: :'FF0000' },
|
553
|
+
0x0003 => { name: :Green, rgb: :'00FF00' },
|
554
|
+
0x0004 => { name: :Blue, rgb: :'0000FF' },
|
555
|
+
0x0005 => { name: :Yellow, rgb: :'FFFF00' },
|
556
|
+
0x0006 => { name: :Magenta, rgb: :'FF00FF' },
|
557
|
+
0x0007 => { name: :Cyan, rgb: :'00FFFF' },
|
558
|
+
# Default palette
|
559
|
+
0x0008 => { name: :rgColor0, rgb: :'000000' },
|
560
|
+
0x0009 => { name: :rgColor1, rgb: :'FFFFFF' },
|
561
|
+
0x000A => { name: :rgColor2, rgb: :'FF0000' },
|
562
|
+
0x000B => { name: :rgColor3, rgb: :'00FF00' },
|
563
|
+
0x000C => { name: :rgColor4, rgb: :'0000FF' },
|
564
|
+
0x000D => { name: :rgColor5, rgb: :'FFFF00' },
|
565
|
+
0x000E => { name: :rgColor6, rgb: :'FF00FF' },
|
566
|
+
0x000F => { name: :rgColor7, rgb: :'00FFFF' },
|
567
|
+
0x0010 => { name: :rgColor8, rgb: :'800000' },
|
568
|
+
0x0011 => { name: :rgColor9, rgb: :'008000' },
|
569
|
+
0x0012 => { name: :rgColor10, rgb: :'000080' },
|
570
|
+
0x0013 => { name: :rgColor11, rgb: :'808000' },
|
571
|
+
0x0014 => { name: :rgColor12, rgb: :'800080' },
|
572
|
+
0x0015 => { name: :rgColor13, rgb: :'008080' },
|
573
|
+
0x0016 => { name: :rgColor14, rgb: :'C0C0C0' },
|
574
|
+
0x0017 => { name: :rgColor15, rgb: :'808080' },
|
575
|
+
0x0018 => { name: :rgColor16, rgb: :'9999FF' },
|
576
|
+
0x0019 => { name: :rgColor17, rgb: :'993366' },
|
577
|
+
0x001A => { name: :rgColor18, rgb: :'FFFFCC' },
|
578
|
+
0x001B => { name: :rgColor19, rgb: :'CCFFFF' },
|
579
|
+
0x001C => { name: :rgColor20, rgb: :'660066' },
|
580
|
+
0x001D => { name: :rgColor21, rgb: :'FF8080' },
|
581
|
+
0x001E => { name: :rgColor22, rgb: :'0066CC' },
|
582
|
+
0x001F => { name: :rgColor23, rgb: :'CCCCFF' },
|
583
|
+
0x0020 => { name: :rgColor24, rgb: :'000080' },
|
584
|
+
0x0021 => { name: :rgColor25, rgb: :'FF00FF' },
|
585
|
+
0x0022 => { name: :rgColor26, rgb: :'FFFF00' },
|
586
|
+
0x0023 => { name: :rgColor27, rgb: :'00FFFF' },
|
587
|
+
0x0024 => { name: :rgColor28, rgb: :'800080' },
|
588
|
+
0x0025 => { name: :rgColor29, rgb: :'800000' },
|
589
|
+
0x0026 => { name: :rgColor30, rgb: :'008080' },
|
590
|
+
0x0027 => { name: :rgColor31, rgb: :'0000FF' },
|
591
|
+
0x0028 => { name: :rgColor32, rgb: :'00CCFF' },
|
592
|
+
0x0029 => { name: :rgColor33, rgb: :'CCFFFF' },
|
593
|
+
0x002A => { name: :rgColor34, rgb: :'CCFFCC' },
|
594
|
+
0x002B => { name: :rgColor35, rgb: :'FFFF99' },
|
595
|
+
0x002C => { name: :rgColor36, rgb: :'99CCFF' },
|
596
|
+
0x002D => { name: :rgColor37, rgb: :'FF99CC' },
|
597
|
+
0x002E => { name: :rgColor38, rgb: :'CC99FF' },
|
598
|
+
0x002F => { name: :rgColor39, rgb: :'FFCC99' },
|
599
|
+
0x0030 => { name: :rgColor40, rgb: :'3366FF' },
|
600
|
+
0x0031 => { name: :rgColor41, rgb: :'33CCCC' },
|
601
|
+
0x0032 => { name: :rgColor42, rgb: :'99CC00' },
|
602
|
+
0x0033 => { name: :rgColor43, rgb: :'FFCC00' },
|
603
|
+
0x0034 => { name: :rgColor44, rgb: :'FF9900' },
|
604
|
+
0x0035 => { name: :rgColor45, rgb: :'FF6600' },
|
605
|
+
0x0036 => { name: :rgColor46, rgb: :'666699' },
|
606
|
+
0x0037 => { name: :rgColor47, rgb: :'969696' },
|
607
|
+
0x0038 => { name: :rgColor48, rgb: :'003366' },
|
608
|
+
0x0039 => { name: :rgColor49, rgb: :'339966' },
|
609
|
+
0x003A => { name: :rgColor50, rgb: :'003300' },
|
610
|
+
0x003B => { name: :rgColor51, rgb: :'333300' },
|
611
|
+
0x003C => { name: :rgColor52, rgb: :'993300' },
|
612
|
+
0x003D => { name: :rgColor53, rgb: :'993366' },
|
613
|
+
0x003E => { name: :rgColor54, rgb: :'333399' },
|
614
|
+
0x003F => { name: :rgColor55, rgb: :'333333' },
|
615
|
+
0x0040 => { name: :default_foreground }, # Default foreground color. This is the window text color in the sheet display.
|
616
|
+
0x0041 => { name: :default_background }, # Default background color. This is the window background color in the sheet display and is the default background color for a cell.
|
617
|
+
0x004D => { name: :default_chart_foreground }, # Default chart foreground color. This is the window text color in the chart display.
|
618
|
+
0x004E => { name: :default_chart_background }, # Default chart background color. This is the window background color in the chart display.
|
619
|
+
0x004F => { name: :chart_neutral }, # Chart neutral color which is black, an RGB value of (0,0,0).
|
620
|
+
0x0051 => { name: :tooltip_text }, # ToolTip text color. This is the automatic font color for comments.
|
621
|
+
0x7FFF => { name: :font_automatic }, # Font automatic color. This is the window text color.
|
622
|
+
}.freeze
|
623
|
+
|
624
|
+
end
|