xref: /trunk/main/oox/inc/oox/xls/biffhelper.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef OOX_XLS_BIFFHELPER_HXX
29 #define OOX_XLS_BIFFHELPER_HXX
30 
31 #include "oox/helper/binarystreambase.hxx"
32 
33 namespace oox { class SequenceInputStream; }
34 
35 namespace oox {
36 namespace xls {
37 
38 class BiffInputStream;
39 
40 // BIFF12 record identifiers ==================================================
41 
42 const sal_Int32 BIFF12_ID_ARRAY             = 0x01AA;
43 const sal_Int32 BIFF12_ID_AUTOFILTER        = 0x00A1;
44 const sal_Int32 BIFF12_ID_AUTOSORTSCOPE     = 0x01CB;
45 const sal_Int32 BIFF12_ID_BINARYINDEXBLOCK  = 0x002A;
46 const sal_Int32 BIFF12_ID_BINARYINDEXROWS   = 0x0028;
47 const sal_Int32 BIFF12_ID_BOOKVIEWS         = 0x0087;
48 const sal_Int32 BIFF12_ID_BORDER            = 0x002E;
49 const sal_Int32 BIFF12_ID_BORDERS           = 0x0265;
50 const sal_Int32 BIFF12_ID_BRK               = 0x018C;
51 const sal_Int32 BIFF12_ID_CALCPR            = 0x009D;
52 const sal_Int32 BIFF12_ID_CELL_BLANK        = 0x0001;
53 const sal_Int32 BIFF12_ID_CELL_BOOL         = 0x0004;
54 const sal_Int32 BIFF12_ID_CELL_DOUBLE       = 0x0005;
55 const sal_Int32 BIFF12_ID_CELL_ERROR        = 0x0003;
56 const sal_Int32 BIFF12_ID_CELL_RK           = 0x0002;
57 const sal_Int32 BIFF12_ID_CELL_RSTRING      = 0x003E;
58 const sal_Int32 BIFF12_ID_CELL_SI           = 0x0007;
59 const sal_Int32 BIFF12_ID_CELL_STRING       = 0x0006;
60 const sal_Int32 BIFF12_ID_CELLSTYLE         = 0x0030;
61 const sal_Int32 BIFF12_ID_CELLSTYLES        = 0x026B;
62 const sal_Int32 BIFF12_ID_CELLSTYLEXFS      = 0x0272;
63 const sal_Int32 BIFF12_ID_CELLXFS           = 0x0269;
64 const sal_Int32 BIFF12_ID_CFCOLOR           = 0x0234;
65 const sal_Int32 BIFF12_ID_CFRULE            = 0x01CF;
66 const sal_Int32 BIFF12_ID_CHARTPAGESETUP    = 0x028C;
67 const sal_Int32 BIFF12_ID_CHARTPROTECTION   = 0x029D;
68 const sal_Int32 BIFF12_ID_CHARTSHEETPR      = 0x028B;
69 const sal_Int32 BIFF12_ID_CHARTSHEETVIEW    = 0x008D;
70 const sal_Int32 BIFF12_ID_CHARTSHEETVIEWS   = 0x008B;
71 const sal_Int32 BIFF12_ID_COL               = 0x003C;
72 const sal_Int32 BIFF12_ID_COLBREAKS         = 0x018A;
73 const sal_Int32 BIFF12_ID_COLOR             = 0x023C;
74 const sal_Int32 BIFF12_ID_COLORS            = 0x01D9;
75 const sal_Int32 BIFF12_ID_COLORSCALE        = 0x01D5;
76 const sal_Int32 BIFF12_ID_COLS              = 0x0186;
77 const sal_Int32 BIFF12_ID_COMMENT           = 0x027B;
78 const sal_Int32 BIFF12_ID_COMMENTAUTHOR     = 0x0278;
79 const sal_Int32 BIFF12_ID_COMMENTAUTHORS    = 0x0276;
80 const sal_Int32 BIFF12_ID_COMMENTLIST       = 0x0279;
81 const sal_Int32 BIFF12_ID_COMMENTS          = 0x0274;
82 const sal_Int32 BIFF12_ID_COMMENTTEXT       = 0x027D;
83 const sal_Int32 BIFF12_ID_CONDFORMATTING    = 0x01CD;
84 const sal_Int32 BIFF12_ID_CONNECTION        = 0x00C9;
85 const sal_Int32 BIFF12_ID_CONNECTIONS       = 0x01AD;
86 const sal_Int32 BIFF12_ID_CONTROL           = 0x0284;
87 const sal_Int32 BIFF12_ID_CONTROLS          = 0x0283;
88 const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEW   = 0x028F;
89 const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEWS  = 0x028D;
90 const sal_Int32 BIFF12_ID_CUSTOMFILTER      = 0x00AE;
91 const sal_Int32 BIFF12_ID_CUSTOMFILTERS     = 0x00AC;
92 const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEW   = 0x01A7;
93 const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEWS  = 0x01A6;
94 const sal_Int32 BIFF12_ID_CUSTOMWORKBOOKVIEW= 0x018D;
95 const sal_Int32 BIFF12_ID_DATABAR           = 0x01D3;
96 const sal_Int32 BIFF12_ID_DATATABLE         = 0x01AC;
97 const sal_Int32 BIFF12_ID_DATAVALIDATION    = 0x0040;
98 const sal_Int32 BIFF12_ID_DATAVALIDATIONS   = 0x023D;
99 const sal_Int32 BIFF12_ID_DDEITEMVALUES     = 0x0242;
100 const sal_Int32 BIFF12_ID_DDEITEM_BOOL      = 0x0248;
101 const sal_Int32 BIFF12_ID_DDEITEM_DOUBLE    = 0x0244;
102 const sal_Int32 BIFF12_ID_DDEITEM_ERROR     = 0x0245;
103 const sal_Int32 BIFF12_ID_DDEITEM_STRING    = 0x0246;
104 const sal_Int32 BIFF12_ID_DEFINEDNAME       = 0x0027;
105 const sal_Int32 BIFF12_ID_DIMENSION         = 0x0094;
106 const sal_Int32 BIFF12_ID_DISCRETEFILTER    = 0x00A7;
107 const sal_Int32 BIFF12_ID_DISCRETEFILTERS   = 0x00A5;
108 const sal_Int32 BIFF12_ID_DRAWING           = 0x0226;
109 const sal_Int32 BIFF12_ID_DXF               = 0x01FB;
110 const sal_Int32 BIFF12_ID_DXFS              = 0x01F9;
111 const sal_Int32 BIFF12_ID_EXTCELL_BLANK     = 0x016F;
112 const sal_Int32 BIFF12_ID_EXTCELL_BOOL      = 0x0171;
113 const sal_Int32 BIFF12_ID_EXTCELL_DOUBLE    = 0x0170;
114 const sal_Int32 BIFF12_ID_EXTCELL_ERROR     = 0x0172;
115 const sal_Int32 BIFF12_ID_EXTCELL_STRING    = 0x0173;
116 const sal_Int32 BIFF12_ID_EXTERNALADDIN     = 0x029B;
117 const sal_Int32 BIFF12_ID_EXTERNALBOOK      = 0x0168;
118 const sal_Int32 BIFF12_ID_EXTERNALNAME      = 0x0241;
119 const sal_Int32 BIFF12_ID_EXTERNALREF       = 0x0163;
120 const sal_Int32 BIFF12_ID_EXTERNALREFS      = 0x0161;
121 const sal_Int32 BIFF12_ID_EXTERNALSELF      = 0x0165;
122 const sal_Int32 BIFF12_ID_EXTERNALSAME      = 0x0166;
123 const sal_Int32 BIFF12_ID_EXTERNALSHEETS    = 0x016A;
124 const sal_Int32 BIFF12_ID_EXTROW            = 0x016E;
125 const sal_Int32 BIFF12_ID_EXTSHEETDATA      = 0x016B;
126 const sal_Int32 BIFF12_ID_EXTERNALNAMEFLAGS = 0x024A;
127 const sal_Int32 BIFF12_ID_EXTSHEETNAMES     = 0x0167;
128 const sal_Int32 BIFF12_ID_FILESHARING       = 0x0224;
129 const sal_Int32 BIFF12_ID_FILEVERSION       = 0x0080;
130 const sal_Int32 BIFF12_ID_FILL              = 0x002D;
131 const sal_Int32 BIFF12_ID_FILLS             = 0x025B;
132 const sal_Int32 BIFF12_ID_FILTERCOLUMN      = 0x00A3;
133 const sal_Int32 BIFF12_ID_FONT              = 0x002B;
134 const sal_Int32 BIFF12_ID_FONTS             = 0x0263;
135 const sal_Int32 BIFF12_ID_FORMULA_STRING    = 0x0008;
136 const sal_Int32 BIFF12_ID_FORMULA_DOUBLE    = 0x0009;
137 const sal_Int32 BIFF12_ID_FORMULA_BOOL      = 0x000A;
138 const sal_Int32 BIFF12_ID_FORMULA_ERROR     = 0x000B;
139 const sal_Int32 BIFF12_ID_FUNCTIONGROUP     = 0x0299;
140 const sal_Int32 BIFF12_ID_FUNCTIONGROUPS    = 0x0298;
141 const sal_Int32 BIFF12_ID_HEADERFOOTER      = 0x01DF;
142 const sal_Int32 BIFF12_ID_HYPERLINK         = 0x01EE;
143 const sal_Int32 BIFF12_ID_ICONSET           = 0x01D1;
144 const sal_Int32 BIFF12_ID_INDEXEDCOLORS     = 0x0235;
145 const sal_Int32 BIFF12_ID_INPUTCELLS        = 0x01F8;
146 const sal_Int32 BIFF12_ID_LEGACYDRAWING     = 0x0227;
147 const sal_Int32 BIFF12_ID_MERGECELL         = 0x00B0;
148 const sal_Int32 BIFF12_ID_MERGECELLS        = 0x00B1;
149 const sal_Int32 BIFF12_ID_MRUCOLORS         = 0x0239;
150 const sal_Int32 BIFF12_ID_MULTCELL_BLANK    = 0x000C;
151 const sal_Int32 BIFF12_ID_MULTCELL_BOOL     = 0x000F;
152 const sal_Int32 BIFF12_ID_MULTCELL_DOUBLE   = 0x0010;
153 const sal_Int32 BIFF12_ID_MULTCELL_ERROR    = 0x000E;
154 const sal_Int32 BIFF12_ID_MULTCELL_RK       = 0x000D;
155 const sal_Int32 BIFF12_ID_MULTCELL_RSTRING  = 0x003D;
156 const sal_Int32 BIFF12_ID_MULTCELL_SI       = 0x0012;
157 const sal_Int32 BIFF12_ID_MULTCELL_STRING   = 0x0011;
158 const sal_Int32 BIFF12_ID_NUMFMT            = 0x002C;
159 const sal_Int32 BIFF12_ID_NUMFMTS           = 0x0267;
160 const sal_Int32 BIFF12_ID_OLEOBJECT         = 0x027F;
161 const sal_Int32 BIFF12_ID_OLEOBJECTS        = 0x027E;
162 const sal_Int32 BIFF12_ID_OLESIZE           = 0x0225;
163 const sal_Int32 BIFF12_ID_PAGEMARGINS       = 0x01DC;
164 const sal_Int32 BIFF12_ID_PAGESETUP         = 0x01DE;
165 const sal_Int32 BIFF12_ID_PANE              = 0x0097;
166 const sal_Int32 BIFF12_ID_PCDEFINITION      = 0x00B3;
167 const sal_Int32 BIFF12_ID_PCDFDISCRETEPR    = 0x00E1;
168 const sal_Int32 BIFF12_ID_PCDFGROUPITEMS    = 0x00DD;
169 const sal_Int32 BIFF12_ID_PCDFIELD          = 0x00B7;
170 const sal_Int32 BIFF12_ID_PCDFIELDGROUP     = 0x00DB;
171 const sal_Int32 BIFF12_ID_PCDFIELDS         = 0x00B5;
172 const sal_Int32 BIFF12_ID_PCDFRANGEPR       = 0x00DF;
173 const sal_Int32 BIFF12_ID_PCDFSHAREDITEMS   = 0x00BD;
174 const sal_Int32 BIFF12_ID_PCDSHEETSOURCE    = 0x00BB;
175 const sal_Int32 BIFF12_ID_PCDSOURCE         = 0x00B9;
176 const sal_Int32 BIFF12_ID_PCITEM_ARRAY      = 0x00BF;
177 const sal_Int32 BIFF12_ID_PCITEM_BOOL       = 0x0016;
178 const sal_Int32 BIFF12_ID_PCITEM_DATE       = 0x0019;
179 const sal_Int32 BIFF12_ID_PCITEM_DOUBLE     = 0x0015;
180 const sal_Int32 BIFF12_ID_PCITEM_ERROR      = 0x0017;
181 const sal_Int32 BIFF12_ID_PCITEM_INDEX      = 0x001A;
182 const sal_Int32 BIFF12_ID_PCITEM_MISSING    = 0x0014;
183 const sal_Int32 BIFF12_ID_PCITEM_STRING     = 0x0018;
184 const sal_Int32 BIFF12_ID_PCITEMA_BOOL      = 0x001D;
185 const sal_Int32 BIFF12_ID_PCITEMA_DATE      = 0x0020;
186 const sal_Int32 BIFF12_ID_PCITEMA_DOUBLE    = 0x001C;
187 const sal_Int32 BIFF12_ID_PCITEMA_ERROR     = 0x001E;
188 const sal_Int32 BIFF12_ID_PCITEMA_MISSING   = 0x001B;
189 const sal_Int32 BIFF12_ID_PCITEMA_STRING    = 0x001F;
190 const sal_Int32 BIFF12_ID_PCRECORD          = 0x0021;
191 const sal_Int32 BIFF12_ID_PCRECORDDT        = 0x0022;
192 const sal_Int32 BIFF12_ID_PCRECORDS         = 0x00C1;
193 const sal_Int32 BIFF12_ID_PHONETICPR        = 0x0219;
194 const sal_Int32 BIFF12_ID_PICTURE           = 0x0232;
195 const sal_Int32 BIFF12_ID_PIVOTAREA         = 0x00F7;
196 const sal_Int32 BIFF12_ID_PIVOTCACHE        = 0x0182;
197 const sal_Int32 BIFF12_ID_PIVOTCACHES       = 0x0180;
198 const sal_Int32 BIFF12_ID_PRINTOPTIONS      = 0x01DD;
199 const sal_Int32 BIFF12_ID_PTCOLFIELDS       = 0x0137;
200 const sal_Int32 BIFF12_ID_PTDATAFIELD       = 0x0125;
201 const sal_Int32 BIFF12_ID_PTDATAFIELDS      = 0x0127;
202 const sal_Int32 BIFF12_ID_PTDEFINITION      = 0x0118;
203 const sal_Int32 BIFF12_ID_PTFIELD           = 0x011D;
204 const sal_Int32 BIFF12_ID_PTFIELDS          = 0x011F;
205 const sal_Int32 BIFF12_ID_PTFILTER          = 0x0259;
206 const sal_Int32 BIFF12_ID_PTFILTERS         = 0x0257;
207 const sal_Int32 BIFF12_ID_PTFITEM           = 0x011A;
208 const sal_Int32 BIFF12_ID_PTFITEMS          = 0x011B;
209 const sal_Int32 BIFF12_ID_PTLOCATION        = 0x013A;
210 const sal_Int32 BIFF12_ID_PTPAGEFIELD       = 0x0121;
211 const sal_Int32 BIFF12_ID_PTPAGEFIELDS      = 0x0123;
212 const sal_Int32 BIFF12_ID_PTREFERENCE       = 0x00FB;
213 const sal_Int32 BIFF12_ID_PTREFERENCEITEM   = 0x017E;
214 const sal_Int32 BIFF12_ID_PTREFERENCES      = 0x00F9;
215 const sal_Int32 BIFF12_ID_PTROWFIELDS       = 0x0135;
216 const sal_Int32 BIFF12_ID_QUERYTABLE        = 0x01BF;
217 const sal_Int32 BIFF12_ID_QUERYTABLEREFRESH = 0x01C1;
218 const sal_Int32 BIFF12_ID_RGBCOLOR          = 0x01DB;
219 const sal_Int32 BIFF12_ID_ROW               = 0x0000;
220 const sal_Int32 BIFF12_ID_ROWBREAKS         = 0x0188;
221 const sal_Int32 BIFF12_ID_SCENARIO          = 0x01F6;
222 const sal_Int32 BIFF12_ID_SCENARIOS         = 0x01F4;
223 const sal_Int32 BIFF12_ID_SELECTION         = 0x0098;
224 const sal_Int32 BIFF12_ID_SHAREDFMLA        = 0x01AB;
225 const sal_Int32 BIFF12_ID_SHEET             = 0x009C;
226 const sal_Int32 BIFF12_ID_SHEETDATA         = 0x0091;
227 const sal_Int32 BIFF12_ID_SHEETFORMATPR     = 0x01E5;
228 const sal_Int32 BIFF12_ID_SHEETPR           = 0x0093;
229 const sal_Int32 BIFF12_ID_SHEETPROTECTION   = 0x0217;
230 const sal_Int32 BIFF12_ID_SHEETS            = 0x008F;
231 const sal_Int32 BIFF12_ID_SHEETVIEW         = 0x0089;
232 const sal_Int32 BIFF12_ID_SHEETVIEWS        = 0x0085;
233 const sal_Int32 BIFF12_ID_SI                = 0x0013;
234 const sal_Int32 BIFF12_ID_SST               = 0x009F;
235 const sal_Int32 BIFF12_ID_STYLESHEET        = 0x0116;
236 const sal_Int32 BIFF12_ID_TABLE             = 0x0157;
237 const sal_Int32 BIFF12_ID_TABLEPART         = 0x0295;
238 const sal_Int32 BIFF12_ID_TABLEPARTS        = 0x0294;
239 const sal_Int32 BIFF12_ID_TABLESTYLEINFO    = 0x0201;
240 const sal_Int32 BIFF12_ID_TABLESTYLES       = 0x01FC;
241 const sal_Int32 BIFF12_ID_TOP10FILTER       = 0x00AA;
242 const sal_Int32 BIFF12_ID_VOLTYPE           = 0x0204;
243 const sal_Int32 BIFF12_ID_VOLTYPEMAIN       = 0x0206;
244 const sal_Int32 BIFF12_ID_VOLTYPES          = 0x0202;
245 const sal_Int32 BIFF12_ID_VOLTYPESTP        = 0x020A;
246 const sal_Int32 BIFF12_ID_VOLTYPETR         = 0x020B;
247 const sal_Int32 BIFF12_ID_WEBPR             = 0x0105;
248 const sal_Int32 BIFF12_ID_WEBPRTABLES       = 0x0107;
249 const sal_Int32 BIFF12_ID_WORKBOOK          = 0x0083;
250 const sal_Int32 BIFF12_ID_WORKBOOKPR        = 0x0099;
251 const sal_Int32 BIFF12_ID_WORKBOOKVIEW      = 0x009E;
252 const sal_Int32 BIFF12_ID_WORKSHEET         = 0x0081;
253 const sal_Int32 BIFF12_ID_XF                = 0x002F;
254 
255 // BIFF2-BIFF8 record identifiers =============================================
256 
257 /** An enumeration for all binary Excel file format types (BIFF types). */
258 enum BiffType
259 {
260     BIFF2 = 0,                  /// MS Excel 2.1.
261     BIFF3,                      /// MS Excel 3.0.
262     BIFF4,                      /// MS Excel 4.0.
263     BIFF5,                      /// MS Excel 5.0, MS Excel 7.0 (95).
264     BIFF8,                      /// MS Excel 8.0 (97), 9.0 (2000), 10.0 (XP), 11.0 (2003).
265     BIFF_UNKNOWN                /// Unknown BIFF version.
266 };
267 
268 const sal_uInt16 BIFF2_MAXRECSIZE           = 2080;
269 const sal_uInt16 BIFF8_MAXRECSIZE           = 8224;
270 
271 // record identifiers ---------------------------------------------------------
272 
273 const sal_uInt16 BIFF2_ID_ARRAY             = 0x0021;
274 const sal_uInt16 BIFF3_ID_ARRAY             = 0x0221;
275 const sal_uInt16 BIFF_ID_AUTOFILTER         = 0x009D;
276 const sal_uInt16 BIFF2_ID_BLANK             = 0x0001;
277 const sal_uInt16 BIFF3_ID_BLANK             = 0x0201;
278 const sal_uInt16 BIFF2_ID_BOF               = 0x0009;
279 const sal_uInt16 BIFF3_ID_BOF               = 0x0209;
280 const sal_uInt16 BIFF4_ID_BOF               = 0x0409;
281 const sal_uInt16 BIFF5_ID_BOF               = 0x0809;
282 const sal_uInt16 BIFF_ID_BOOKBOOL           = 0x00DA;
283 const sal_uInt16 BIFF_ID_BOOKEXT            = 0x0863;
284 const sal_uInt16 BIFF2_ID_BOOLERR           = 0x0005;
285 const sal_uInt16 BIFF3_ID_BOOLERR           = 0x0205;
286 const sal_uInt16 BIFF_ID_BOTTOMMARGIN       = 0x0029;
287 const sal_uInt16 BIFF_ID_CALCCOUNT          = 0x000C;
288 const sal_uInt16 BIFF_ID_CALCMODE           = 0x000D;
289 const sal_uInt16 BIFF_ID_CFHEADER           = 0x01B0;
290 const sal_uInt16 BIFF_ID_CFRULE             = 0x01B1;
291 const sal_uInt16 BIFF_ID_CFRULE12           = 0x087A;
292 const sal_uInt16 BIFF_ID_CFRULEEXT          = 0x087B;
293 const sal_uInt16 BIFF_ID_CH3DDATAFORMAT     = 0x105F;
294 const sal_uInt16 BIFF_ID_CHAREA             = 0x101A;
295 const sal_uInt16 BIFF_ID_CHAREAFORMAT       = 0x100A;
296 const sal_uInt16 BIFF_ID_CHATTACHEDLABEL    = 0x100C;
297 const sal_uInt16 BIFF_ID_CHAXESSET          = 0x1041;
298 const sal_uInt16 BIFF_ID_CHAXIS             = 0x101D;
299 const sal_uInt16 BIFF_ID_CHAXISLINE         = 0x1021;
300 const sal_uInt16 BIFF_ID_CHBAR              = 0x1017;
301 const sal_uInt16 BIFF_ID_CHBEGIN            = 0x1033;
302 const sal_uInt16 BIFF_ID_CHCHART            = 0x1002;
303 const sal_uInt16 BIFF_ID_CHCHART3D          = 0x103A;
304 const sal_uInt16 BIFF_ID_CHCHARTLINE        = 0x101C;
305 const sal_uInt16 BIFF_ID_CHDATAFORMAT       = 0x1006;
306 const sal_uInt16 BIFF_ID_CHDATERANGE        = 0x1062;
307 const sal_uInt16 BIFF_ID_CHDEFAULTTEXT      = 0x1024;
308 const sal_uInt16 BIFF_ID_CHDROPBAR          = 0x103D;
309 const sal_uInt16 BIFF_ID_CHECKCOMPAT        = 0x088C;
310 const sal_uInt16 BIFF_ID_CHEND              = 0x1034;
311 const sal_uInt16 BIFF_ID_CHESCHERFORMAT     = 0x1066;
312 const sal_uInt16 BIFF_ID_CHFONT             = 0x1026;
313 const sal_uInt16 BIFF_ID_CHFORMAT           = 0x104E;
314 const sal_uInt16 BIFF_ID_CHFORMATRUNS       = 0x1050;
315 const sal_uInt16 BIFF_ID_CHFRAME            = 0x1032;
316 const sal_uInt16 BIFF_ID_CHFRAMEPOS         = 0x104F;
317 const sal_uInt16 BIFF_ID_CHFRBLOCKBEGIN     = 0x0852;
318 const sal_uInt16 BIFF_ID_CHFRBLOCKEND       = 0x0853;
319 const sal_uInt16 BIFF_ID_CHFRCATEGORYPROPS  = 0x0856;
320 const sal_uInt16 BIFF_ID_CHFREXTPROPS       = 0x089E;
321 const sal_uInt16 BIFF_ID_CHFREXTPROPSCONT   = 0x089F;
322 const sal_uInt16 BIFF_ID_CHFRINFO           = 0x0850;
323 const sal_uInt16 BIFF_ID_CHFRLABELPROPS     = 0x086B;
324 const sal_uInt16 BIFF_ID_CHFRLAYOUT         = 0x089D;
325 const sal_uInt16 BIFF_ID_CHFRPLOTAREALAYOUT = 0x08A7;
326 const sal_uInt16 BIFF_ID_CHFRSHAPEPROPS     = 0x08A4;
327 const sal_uInt16 BIFF_ID_CHFRTEXTPROPS      = 0x08A5;
328 const sal_uInt16 BIFF_ID_CHFRUNITPROPS      = 0x0857;
329 const sal_uInt16 BIFF_ID_CHFRWRAPPER        = 0x0851;
330 const sal_uInt16 BIFF_ID_CHLABELRANGE       = 0x1020;
331 const sal_uInt16 BIFF_ID_CHLEGEND           = 0x1015;
332 const sal_uInt16 BIFF_ID_CHLINE             = 0x1018;
333 const sal_uInt16 BIFF_ID_CHLINEFORMAT       = 0x1007;
334 const sal_uInt16 BIFF_ID_CHMARKERFORMAT     = 0x1009;
335 const sal_uInt16 BIFF_ID_CHOBJECTLINK       = 0x1027;
336 const sal_uInt16 BIFF_ID_CHPICFORMAT        = 0x103C;
337 const sal_uInt16 BIFF_ID_CHPIE              = 0x1019;
338 const sal_uInt16 BIFF_ID_CHPIEEXT           = 0x1061;
339 const sal_uInt16 BIFF_ID_CHPIEFORMAT        = 0x100B;
340 const sal_uInt16 BIFF_ID_CHPIVOTFLAGS       = 0x0859;
341 const sal_uInt16 BIFF5_ID_CHPIVOTREF        = 0x1048;
342 const sal_uInt16 BIFF8_ID_CHPIVOTREF        = 0x0858;
343 const sal_uInt16 BIFF_ID_CHPLOTFRAME        = 0x1035;
344 const sal_uInt16 BIFF_ID_CHPLOTGROWTH       = 0x1064;
345 const sal_uInt16 BIFF_ID_CHPROPERTIES       = 0x1044;
346 const sal_uInt16 BIFF_ID_CHRADARLINE        = 0x103E;
347 const sal_uInt16 BIFF_ID_CHRADARAREA        = 0x1040;
348 const sal_uInt16 BIFF_ID_CHSCATTER          = 0x101B;
349 const sal_uInt16 BIFF_ID_CHSERERRORBAR      = 0x105B;
350 const sal_uInt16 BIFF_ID_CHSERGROUP         = 0x1045;
351 const sal_uInt16 BIFF_ID_CHSERIES           = 0x1003;
352 const sal_uInt16 BIFF_ID_CHSERIESFORMAT     = 0x105D;
353 const sal_uInt16 BIFF_ID_CHSERPARENT        = 0x104A;
354 const sal_uInt16 BIFF_ID_CHSERTRENDLINE     = 0x104B;
355 const sal_uInt16 BIFF_ID_CHSOURCELINK       = 0x1051;
356 const sal_uInt16 BIFF_ID_CHSTRING           = 0x100D;
357 const sal_uInt16 BIFF_ID_CHSURFACE          = 0x103F;
358 const sal_uInt16 BIFF_ID_CHTEXT             = 0x1025;
359 const sal_uInt16 BIFF_ID_CHTICK             = 0x101E;
360 const sal_uInt16 BIFF_ID_CHTYPEGROUP        = 0x1014;
361 const sal_uInt16 BIFF_ID_CHVALUERANGE       = 0x101F;
362 const sal_uInt16 BIFF_ID_CODENAME           = 0x01BA;
363 const sal_uInt16 BIFF_ID_CODEPAGE           = 0x0042;
364 const sal_uInt16 BIFF_ID_COLINFO            = 0x007D;
365 const sal_uInt16 BIFF_ID_COLUMNDEFAULT      = 0x0020;
366 const sal_uInt16 BIFF_ID_COLWIDTH           = 0x0024;
367 const sal_uInt16 BIFF_ID_COMPRESSPICS       = 0x089B;
368 const sal_uInt16 BIFF_ID_CONNECTION         = 0x0876;
369 const sal_uInt16 BIFF_ID_CONT               = 0x003C;
370 const sal_uInt16 BIFF_ID_COORDLIST          = 0x00A9;
371 const sal_uInt16 BIFF_ID_COUNTRY            = 0x008C;
372 const sal_uInt16 BIFF_ID_CRN                = 0x005A;
373 const sal_uInt16 BIFF2_ID_DATATABLE         = 0x0036;
374 const sal_uInt16 BIFF3_ID_DATATABLE         = 0x0236;
375 const sal_uInt16 BIFF2_ID_DATATABLE2        = 0x0037;
376 const sal_uInt16 BIFF_ID_DATAVALIDATION     = 0x01BE;
377 const sal_uInt16 BIFF_ID_DATAVALIDATIONS    = 0x01B2;
378 const sal_uInt16 BIFF_ID_DATEMODE           = 0x0022;
379 const sal_uInt16 BIFF_ID_DBCELL             = 0x00D7;
380 const sal_uInt16 BIFF_ID_DBQUERY            = 0x00DC;
381 const sal_uInt16 BIFF_ID_DCONBINAME         = 0x01B5;
382 const sal_uInt16 BIFF_ID_DCONNAME           = 0x0052;
383 const sal_uInt16 BIFF_ID_DCONREF            = 0x0051;
384 const sal_uInt16 BIFF_ID_DEFCOLWIDTH        = 0x0055;
385 const sal_uInt16 BIFF2_ID_DEFINEDNAME       = 0x0018;
386 const sal_uInt16 BIFF3_ID_DEFINEDNAME       = 0x0218;
387 const sal_uInt16 BIFF5_ID_DEFINEDNAME       = 0x0018;
388 const sal_uInt16 BIFF2_ID_DEFROWHEIGHT      = 0x0025;
389 const sal_uInt16 BIFF3_ID_DEFROWHEIGHT      = 0x0225;
390 const sal_uInt16 BIFF_ID_DELTA              = 0x0010;
391 const sal_uInt16 BIFF2_ID_DIMENSION         = 0x0000;
392 const sal_uInt16 BIFF3_ID_DIMENSION         = 0x0200;
393 const sal_uInt16 BIFF_ID_DXF                = 0x088D;
394 const sal_uInt16 BIFF_ID_EOF                = 0x000A;
395 const sal_uInt16 BIFF_ID_EXTERNALBOOK       = 0x01AE;
396 const sal_uInt16 BIFF2_ID_EXTERNALNAME      = 0x0023;
397 const sal_uInt16 BIFF3_ID_EXTERNALNAME      = 0x0223;
398 const sal_uInt16 BIFF5_ID_EXTERNALNAME      = 0x0023;
399 const sal_uInt16 BIFF_ID_EXTERNSHEET        = 0x0017;
400 const sal_uInt16 BIFF_ID_EXTSST             = 0x00FF;
401 const sal_uInt16 BIFF_ID_FILEPASS           = 0x002F;
402 const sal_uInt16 BIFF_ID_FILESHARING        = 0x005B;
403 const sal_uInt16 BIFF_ID_FILTERCOLUMN       = 0x009E;
404 const sal_uInt16 BIFF_ID_FILTERMODE         = 0x009B;
405 const sal_uInt16 BIFF2_ID_FONT              = 0x0031;
406 const sal_uInt16 BIFF3_ID_FONT              = 0x0231;
407 const sal_uInt16 BIFF5_ID_FONT              = 0x0031;
408 const sal_uInt16 BIFF_ID_FONTCOLOR          = 0x0045;
409 const sal_uInt16 BIFF_ID_FOOTER             = 0x0015;
410 const sal_uInt16 BIFF_ID_FORCEFULLCALC      = 0x08A3;
411 const sal_uInt16 BIFF2_ID_FORMAT            = 0x001E;
412 const sal_uInt16 BIFF4_ID_FORMAT            = 0x041E;
413 const sal_uInt16 BIFF2_ID_FORMULA           = 0x0006;
414 const sal_uInt16 BIFF3_ID_FORMULA           = 0x0206;
415 const sal_uInt16 BIFF4_ID_FORMULA           = 0x0406;
416 const sal_uInt16 BIFF5_ID_FORMULA           = 0x0006;
417 const sal_uInt16 BIFF_ID_GUTS               = 0x0080;
418 const sal_uInt16 BIFF_ID_HCENTER            = 0x0083;
419 const sal_uInt16 BIFF_ID_HEADER             = 0x0014;
420 const sal_uInt16 BIFF_ID_HEADERFOOTER       = 0x089C;
421 const sal_uInt16 BIFF_ID_HIDEOBJ            = 0x008D;
422 const sal_uInt16 BIFF_ID_HORPAGEBREAKS      = 0x001B;
423 const sal_uInt16 BIFF_ID_HYPERLINK          = 0x01B8;
424 const sal_uInt16 BIFF3_ID_IMGDATA           = 0x007F;
425 const sal_uInt16 BIFF8_ID_IMGDATA           = 0x00E9;
426 const sal_uInt16 BIFF2_ID_INDEX             = 0x000B;
427 const sal_uInt16 BIFF3_ID_INDEX             = 0x020B;
428 const sal_uInt16 BIFF2_ID_INTEGER           = 0x0002;
429 const sal_uInt16 BIFF_ID_INTERFACEHDR       = 0x00E1;
430 const sal_uInt16 BIFF_ID_ITERATION          = 0x0011;
431 const sal_uInt16 BIFF_ID_IXFE               = 0x0044;
432 const sal_uInt16 BIFF2_ID_LABEL             = 0x0004;
433 const sal_uInt16 BIFF3_ID_LABEL             = 0x0204;
434 const sal_uInt16 BIFF_ID_LABELRANGES        = 0x015F;
435 const sal_uInt16 BIFF_ID_LABELSST           = 0x00FD;
436 const sal_uInt16 BIFF_ID_LEFTMARGIN         = 0x0026;
437 const sal_uInt16 BIFF_ID_MERGEDCELLS        = 0x00E5;
438 const sal_uInt16 BIFF_ID_MSODRAWING         = 0x00EC;
439 const sal_uInt16 BIFF_ID_MSODRAWINGGROUP    = 0x00EB;
440 const sal_uInt16 BIFF_ID_MSODRAWINGSEL      = 0x00ED;
441 const sal_uInt16 BIFF_ID_MTHREADSETTINGS    = 0x089A;
442 const sal_uInt16 BIFF_ID_MULTBLANK          = 0x00BE;
443 const sal_uInt16 BIFF_ID_MULTRK             = 0x00BD;
444 const sal_uInt16 BIFF_ID_NOTE               = 0x001C;
445 const sal_uInt16 BIFF_ID_NOTESOUND          = 0x0096;
446 const sal_uInt16 BIFF2_ID_NUMBER            = 0x0003;
447 const sal_uInt16 BIFF3_ID_NUMBER            = 0x0203;
448 const sal_uInt16 BIFF_ID_OBJ                = 0x005D;
449 const sal_uInt16 BIFF_ID_OBJECTPROTECT      = 0x0063;
450 const sal_uInt16 BIFF_ID_OLESIZE            = 0x00DE;
451 const sal_uInt16 BIFF_ID_PAGELAYOUTVIEW     = 0x088B;
452 const sal_uInt16 BIFF_ID_PAGESETUP          = 0x00A1;
453 const sal_uInt16 BIFF_ID_PALETTE            = 0x0092;
454 const sal_uInt16 BIFF_ID_PANE               = 0x0041;
455 const sal_uInt16 BIFF_ID_PARAMQUERY         = 0x00DC;
456 const sal_uInt16 BIFF_ID_PASSWORD           = 0x0013;
457 const sal_uInt16 BIFF_ID_PCDEFINITION       = 0x00C6;
458 const sal_uInt16 BIFF_ID_PCDEFINITION2      = 0x0122;
459 const sal_uInt16 BIFF_ID_PCDFDISCRETEPR     = 0x00D9;
460 const sal_uInt16 BIFF_ID_PCDFIELD           = 0x00C7;
461 const sal_uInt16 BIFF_ID_PCDFIELDINDEX      = 0x0103;
462 const sal_uInt16 BIFF_ID_PCDFORMULAFIELD    = 0x00F9;
463 const sal_uInt16 BIFF_ID_PCDFRANGEPR        = 0x00D8;
464 const sal_uInt16 BIFF_ID_PCDFSQLTYPE        = 0x01BB;
465 const sal_uInt16 BIFF_ID_PCDSOURCE          = 0x00E3;
466 const sal_uInt16 BIFF_ID_PCITEM_BOOL        = 0x00CA;
467 const sal_uInt16 BIFF_ID_PCITEM_DATE        = 0x00CE;
468 const sal_uInt16 BIFF_ID_PCITEM_DOUBLE      = 0x00C9;
469 const sal_uInt16 BIFF_ID_PCITEM_ERROR       = 0x00CB;
470 const sal_uInt16 BIFF_ID_PCITEM_INDEXLIST   = 0x00C8;
471 const sal_uInt16 BIFF_ID_PCITEM_INTEGER     = 0x00CC;
472 const sal_uInt16 BIFF_ID_PCITEM_MISSING     = 0x00CF;
473 const sal_uInt16 BIFF_ID_PCITEM_STRING      = 0x00CD;
474 const sal_uInt16 BIFF_ID_PHONETICPR         = 0x00EF;
475 const sal_uInt16 BIFF_ID_PICTURE            = 0x00E9;
476 const sal_uInt16 BIFF_ID_PIVOTCACHE         = 0x00D5;
477 const sal_uInt16 BIFF_ID_PRECISION          = 0x000E;
478 const sal_uInt16 BIFF_ID_PRINTGRIDLINES     = 0x002B;
479 const sal_uInt16 BIFF_ID_PRINTHEADERS       = 0x002A;
480 const sal_uInt16 BIFF_ID_PROJEXTSHEET       = 0x00A3;
481 const sal_uInt16 BIFF_ID_PROTECT            = 0x0012;
482 const sal_uInt16 BIFF_ID_PTDATAFIELD        = 0x00C5;
483 const sal_uInt16 BIFF_ID_PTDEFINITION       = 0x00B0;
484 const sal_uInt16 BIFF_ID_PTDEFINITION2      = 0x00F1;
485 const sal_uInt16 BIFF_ID_PTFIELD            = 0x00B1;
486 const sal_uInt16 BIFF_ID_PTFIELD2           = 0x0100;
487 const sal_uInt16 BIFF_ID_PTFITEM            = 0x00B2;
488 const sal_uInt16 BIFF_ID_PTPAGEFIELDS       = 0x00B6;
489 const sal_uInt16 BIFF_ID_PTROWCOLFIELDS     = 0x00B4;
490 const sal_uInt16 BIFF_ID_PTROWCOLITEMS      = 0x00B5;
491 const sal_uInt16 BIFF_ID_QUERYTABLE         = 0x01AD;
492 const sal_uInt16 BIFF_ID_QUERYTABLEREFRESH  = 0x0802;
493 const sal_uInt16 BIFF_ID_QUERYTABLESETTINGS = 0x0803;
494 const sal_uInt16 BIFF_ID_QUERYTABLESTRING   = 0x0804;
495 const sal_uInt16 BIFF_ID_RECALCID           = 0x01C1;
496 const sal_uInt16 BIFF_ID_REFMODE            = 0x000F;
497 const sal_uInt16 BIFF_ID_RIGHTMARGIN        = 0x0027;
498 const sal_uInt16 BIFF_ID_RK                 = 0x027E;
499 const sal_uInt16 BIFF2_ID_ROW               = 0x0008;
500 const sal_uInt16 BIFF3_ID_ROW               = 0x0208;
501 const sal_uInt16 BIFF_ID_RSTRING            = 0x00D6;
502 const sal_uInt16 BIFF_ID_SAVERECALC         = 0x005F;
503 const sal_uInt16 BIFF_ID_SCENARIO           = 0x00AF;
504 const sal_uInt16 BIFF_ID_SCENARIOS          = 0x00AE;
505 const sal_uInt16 BIFF_ID_SCL                = 0x00A0;
506 const sal_uInt16 BIFF_ID_SCENPROTECT        = 0x00DD;
507 const sal_uInt16 BIFF_ID_SCREENTIP          = 0x0800;
508 const sal_uInt16 BIFF_ID_SELECTION          = 0x001D;
509 const sal_uInt16 BIFF_ID_SHAREDFEATHEAD     = 0x0867;
510 const sal_uInt16 BIFF_ID_SHAREDFMLA         = 0x04BC;
511 const sal_uInt16 BIFF_ID_SHEET              = 0x0085;
512 const sal_uInt16 BIFF_ID_SHEETEXT           = 0x0862;
513 const sal_uInt16 BIFF_ID_SHEETHEADER        = 0x008F;
514 const sal_uInt16 BIFF_ID_SHEETPR            = 0x0081;
515 const sal_uInt16 BIFF_ID_SST                = 0x00FC;
516 const sal_uInt16 BIFF_ID_STANDARDWIDTH      = 0x0099;
517 const sal_uInt16 BIFF2_ID_STRING            = 0x0007;
518 const sal_uInt16 BIFF3_ID_STRING            = 0x0207;
519 const sal_uInt16 BIFF_ID_STYLE              = 0x0293;
520 const sal_uInt16 BIFF_ID_STYLEEXT           = 0x0892;
521 const sal_uInt16 BIFF_ID_TABLESTYLES        = 0x088E;
522 const sal_uInt16 BIFF_ID_THEME              = 0x0896;
523 const sal_uInt16 BIFF_ID_TOPMARGIN          = 0x0028;
524 const sal_uInt16 BIFF_ID_TXO                = 0x01B6;
525 const sal_uInt16 BIFF_ID_UNCALCED           = 0x005E;
526 const sal_uInt16 BIFF_ID_USESELFS           = 0x0160;
527 const sal_uInt16 BIFF_ID_VBAPROJECT         = 0x00D3;
528 const sal_uInt16 BIFF_ID_VBAPROJECTEMPTY    = 0x01BD;
529 const sal_uInt16 BIFF_ID_VCENTER            = 0x0084;
530 const sal_uInt16 BIFF_ID_VERPAGEBREAKS      = 0x001A;
531 const sal_uInt16 BIFF_ID_WINDOW1            = 0x003D;
532 const sal_uInt16 BIFF2_ID_WINDOW2           = 0x003E;
533 const sal_uInt16 BIFF3_ID_WINDOW2           = 0x023E;
534 const sal_uInt16 BIFF_ID_WRITEACCESS        = 0x005C;
535 const sal_uInt16 BIFF_ID_XCT                = 0x0059;
536 const sal_uInt16 BIFF2_ID_XF                = 0x0043;
537 const sal_uInt16 BIFF3_ID_XF                = 0x0243;
538 const sal_uInt16 BIFF4_ID_XF                = 0x0443;
539 const sal_uInt16 BIFF5_ID_XF                = 0x00E0;
540 const sal_uInt16 BIFF_ID_XFCRC              = 0x087C;
541 const sal_uInt16 BIFF_ID_XFEXT              = 0x087D;
542 
543 const sal_uInt16 BIFF_ID_UNKNOWN            = SAL_MAX_UINT16;
544 
545 // OBJ subrecord identifiers --------------------------------------------------
546 
547 const sal_uInt16 BIFF_ID_OBJEND             = 0x0000;   /// End of OBJ.
548 const sal_uInt16 BIFF_ID_OBJMACRO           = 0x0004;   /// Macro link.
549 const sal_uInt16 BIFF_ID_OBJBUTTON          = 0x0005;   /// Button data.
550 const sal_uInt16 BIFF_ID_OBJGMO             = 0x0006;   /// Group marker.
551 const sal_uInt16 BIFF_ID_OBJCF              = 0x0007;   /// Clipboard format.
552 const sal_uInt16 BIFF_ID_OBJFLAGS           = 0x0008;   /// Option flags.
553 const sal_uInt16 BIFF_ID_OBJPICTFMLA        = 0x0009;   /// OLE link formula.
554 const sal_uInt16 BIFF_ID_OBJCBLS            = 0x000A;   /// Check box/radio button data.
555 const sal_uInt16 BIFF_ID_OBJRBO             = 0x000B;   /// Radio button group data.
556 const sal_uInt16 BIFF_ID_OBJSBS             = 0x000C;   /// Scroll bar data.
557 const sal_uInt16 BIFF_ID_OBJNTS             = 0x000C;   /// Note data.
558 const sal_uInt16 BIFF_ID_OBJSBSFMLA         = 0x000E;   /// Scroll bar/list box/combo box cell link.
559 const sal_uInt16 BIFF_ID_OBJGBODATA         = 0x000F;   /// Group box data.
560 const sal_uInt16 BIFF_ID_OBJEDODATA         = 0x0010;   /// Edit box data.
561 const sal_uInt16 BIFF_ID_OBJRBODATA         = 0x0011;   /// Radio button group data.
562 const sal_uInt16 BIFF_ID_OBJCBLSDATA        = 0x0012;   /// Check box/radio button data.
563 const sal_uInt16 BIFF_ID_OBJLBSDATA         = 0x0013;   /// List box/combo box data.
564 const sal_uInt16 BIFF_ID_OBJCBLSFMLA        = 0x0014;   /// Check box/radio button cell link.
565 const sal_uInt16 BIFF_ID_OBJCMO             = 0x0015;   /// Common object settings.
566 
567 // record constants -----------------------------------------------------------
568 
569 const sal_uInt16 BIFF_BOF_BIFF2             = 0x0200;
570 const sal_uInt16 BIFF_BOF_BIFF3             = 0x0300;
571 const sal_uInt16 BIFF_BOF_BIFF4             = 0x0400;
572 const sal_uInt16 BIFF_BOF_BIFF5             = 0x0500;
573 const sal_uInt16 BIFF_BOF_BIFF8             = 0x0600;
574 
575 const sal_uInt8 BIFF_ERR_NULL               = 0x00;
576 const sal_uInt8 BIFF_ERR_DIV0               = 0x07;
577 const sal_uInt8 BIFF_ERR_VALUE              = 0x0F;
578 const sal_uInt8 BIFF_ERR_REF                = 0x17;
579 const sal_uInt8 BIFF_ERR_NAME               = 0x1D;
580 const sal_uInt8 BIFF_ERR_NUM                = 0x24;
581 const sal_uInt8 BIFF_ERR_NA                 = 0x2A;
582 
583 const sal_uInt8 BIFF_DATATYPE_EMPTY         = 0;
584 const sal_uInt8 BIFF_DATATYPE_DOUBLE        = 1;
585 const sal_uInt8 BIFF_DATATYPE_STRING        = 2;
586 const sal_uInt8 BIFF_DATATYPE_BOOL          = 4;
587 const sal_uInt8 BIFF_DATATYPE_ERROR         = 16;
588 
589 const sal_uInt8 BIFF_BOOLERR_BOOL           = 0;
590 const sal_uInt8 BIFF_BOOLERR_ERROR          = 1;
591 
592 // BIFF8 unicode strings ------------------------------------------------------
593 
594 const sal_uInt8 BIFF_STRF_16BIT             = 0x01;
595 const sal_uInt8 BIFF_STRF_PHONETIC          = 0x04;
596 const sal_uInt8 BIFF_STRF_RICH              = 0x08;
597 const sal_uInt8 BIFF_STRF_UNKNOWN           = 0xF2;
598 
599 // ============================================================================
600 
601 /** Static helper functions for BIFF filters. */
602 class BiffHelper
603 {
604 public:
605     // conversion -------------------------------------------------------------
606 
607     /** Converts the passed packed number to a double. */
608     static double       calcDoubleFromRk( sal_Int32 nRkValue );
609     /** Converts the passed double to a packed number, returns true on success. */
610     static bool         calcRkFromDouble( sal_Int32& ornRkValue, double fValue );
611 
612     /** Converts the passed BIFF error to a double containing the respective Calc error code. */
613     static double       calcDoubleFromError( sal_uInt8 nErrorCode );
614 
615     /** Returns a text encoding from an Windows code page.
616         @return  The corresponding text encoding or RTL_TEXTENCODING_DONTKNOW. */
617     static rtl_TextEncoding calcTextEncodingFromCodePage( sal_uInt16 nCodePage );
618     /** Returns a Windows code page from a text encoding. */
619     static sal_uInt16   calcCodePageFromTextEncoding( rtl_TextEncoding eTextEnc );
620 
621     // BIFF12 import ----------------------------------------------------------
622 
623     /** Reads a BIFF12 string with leading 16-bit or 32-bit length field. */
624     static ::rtl::OUString readString( SequenceInputStream& rStrm, bool b32BitLen = true, bool bAllowNulChars = false );
625 
626     // BIFF2-BIFF8 import -----------------------------------------------------
627 
628     /** Returns true, if the current record of the stream is a BOF record. */
629     static bool         isBofRecord( BiffInputStream& rStrm );
630 
631     /** Skips a block of records up to the specified end record.
632 
633         Skips all records until next end record. When this function returns,
634         the stream points to the end record, and the next call of the function
635         startNextRecord() at the stream will start the record following the end
636         record.
637 
638         The identifier of the record that is active while this function is
639         called is used as start record identifier. This identifier is used to
640         correctly skip embedded record blocks with the same start and end
641         record identifier.
642 
643         @return  True = stream points to the end record.
644      */
645     static bool         skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId );
646 
647     /** Imports a picture from an IMGDATA record. */
648     static void         importImgData( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, BiffType eBiff );
649 
650 private:
651                         BiffHelper();   // not implemented
652                         ~BiffHelper();  // not implemented
653 };
654 
655 // ----------------------------------------------------------------------------
656 
657 /** BIFF12 stream operator for an ::rtl::OUString, reads 32-bit string length and Unicode array. */
658 inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, ::rtl::OUString& orString )
659 {
660     orString = BiffHelper::readString( rStrm );
661     return rStrm;
662 }
663 
664 // ============================================================================
665 
666 } // namespace xls
667 } // namespace oox
668 
669 #endif
670