LibreOffice Module sc (master)  1
read.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <document.hxx>
21 #include <scerrors.hxx>
22 #include <fprogressbar.hxx>
23 #include <globstr.hrc>
24 #include <xlcontent.hxx>
25 #include <xltracer.hxx>
26 #include <xltable.hxx>
27 #include <xihelper.hxx>
28 #include <xipage.hxx>
29 #include <xiview.hxx>
30 #include <xilink.hxx>
31 #include <xiname.hxx>
32 #include <xlname.hxx>
33 #include <xicontent.hxx>
34 #include <xiescher.hxx>
35 #include <xipivot.hxx>
36 #include <xistyle.hxx>
37 #include <XclImpChangeTrack.hxx>
38 #include <documentimport.hxx>
39 
40 #include <root.hxx>
41 #include <imp_op.hxx>
42 #include <excimp8.hxx>
43 
44 #include <unotools/configmgr.hxx>
45 
46 #include <memory>
47 
48 namespace
49 {
50  bool TryStartNextRecord(XclImpStream& rIn, std::size_t nProgressBasePos)
51  {
52  bool bValid = true;
53  // i#115255 fdo#40304 BOUNDSHEET doesn't point to a valid
54  // BOF record position. Scan the records manually (from
55  // the BOUNDSHEET position) until we find a BOF. Some 3rd
56  // party Russian programs generate invalid xls docs with
57  // this kind of silliness.
58  if (rIn.PeekRecId(nProgressBasePos) == EXC_ID5_BOF)
59  // BOUNDSHEET points to a valid BOF record. Good.
60  rIn.StartNextRecord(nProgressBasePos);
61  else
62  {
63  while (bValid && rIn.GetRecId() != EXC_ID5_BOF)
64  bValid = rIn.StartNextRecord();
65  }
66  return bValid;
67  }
68 }
69 
71 {
72  ErrCode eLastErr = ERRCODE_NONE;
73  try
74  {
75  XclImpPageSettings& rPageSett = GetPageSettings();
76  XclImpTabViewSettings& rTabViewSett = GetTabViewSettings();
77  XclImpPalette& rPal = GetPalette();
78  XclImpFontBuffer& rFontBfr = GetFontBuffer();
79  XclImpNumFmtBuffer& rNumFmtBfr = GetNumFmtBuffer();
80  XclImpXFBuffer& rXFBfr = GetXFBuffer();
81  XclImpNameManager& rNameMgr = GetNameManager();
82  // call to GetCurrSheetDrawing() cannot be cached (changes in new sheets)
83 
84  enum STATE {
85  Z_BiffNull, // not a valid Biff-Format
86  Z_Biff2, // Biff2: only one table
87 
88  Z_Biff3, // Biff3: only one table
89 
90  Z_Biff4, // Biff4: only one table
91  Z_Biff4W, // Biff4 Workbook: Globals
92  Z_Biff4T, // Biff4 Workbook: a table itself
93  Z_Biff4E, // Biff4 Workbook: between tables
94 
95  Z_Biff5WPre,// Biff5: Prefetch Workbook
96  Z_Biff5W, // Biff5: Globals
97  Z_Biff5TPre,// Biff5: Prefetch for Shrfmla/Array Formula
98  Z_Biff5T, // Biff5: a table itself
99  Z_Biff5E, // Biff5: between tables
100  Z_Biffn0, // all Biffs: skip table till next EOF
101  Z_End };
102 
103  STATE eCurrent = Z_BiffNull, ePrev = Z_BiffNull;
104 
105  sal_uInt16 nOpcode;
106  sal_uInt16 nBofLevel = 0;
107 
108  std::unique_ptr< ScfSimpleProgressBar > pProgress( new ScfSimpleProgressBar(
109  aIn.GetSvStreamSize(), GetDocShell(), STR_LOAD_DOC ) );
110 
111  /* #i104057# Need to track a base position for progress bar calculation,
112  because sheet substreams may not be in order of sheets. */
113  std::size_t nProgressBasePos = 0;
114  std::size_t nProgressBaseSize = 0;
115 
116  for (; eCurrent != Z_End; mnLastRecId = nOpcode)
117  {
118  if( eCurrent == Z_Biff5E )
119  {
120  sal_uInt16 nScTab = GetCurrScTab();
121  if( nScTab < maSheetOffsets.size() )
122  {
123  nProgressBaseSize += (aIn.GetSvStreamPos() - nProgressBasePos);
124  nProgressBasePos = maSheetOffsets[ nScTab ];
125 
126  bool bValid = TryStartNextRecord(aIn, nProgressBasePos);
127  if (!bValid)
128  {
129  // Safeguard ourselves from potential infinite loop.
130  eCurrent = Z_End;
131  }
132  }
133  else
134  eCurrent = Z_End;
135  }
136  else
138 
139  nOpcode = aIn.GetRecId();
140 
141  if( !aIn.IsValid() )
142  {
143  // finalize table if EOF is missing
144  switch( eCurrent )
145  {
146  case Z_Biff2:
147  case Z_Biff3:
148  case Z_Biff4:
149  case Z_Biff4T:
150  case Z_Biff5TPre:
151  case Z_Biff5T:
152  rNumFmtBfr.CreateScFormats();
153  Eof();
154  break;
155  default:;
156  }
157  break;
158  }
159 
160  if( eCurrent == Z_End )
161  break;
162 
163  if( eCurrent != Z_Biff5TPre && eCurrent != Z_Biff5WPre )
164  pProgress->ProgressAbs( nProgressBaseSize + aIn.GetSvStreamPos() - nProgressBasePos );
165 
166  switch( eCurrent )
167  {
168 
169  case Z_BiffNull: // ------------------------------- Z_BiffNull -
170  {
171  switch( nOpcode )
172  {
173  case EXC_ID2_BOF:
174  case EXC_ID3_BOF:
175  case EXC_ID4_BOF:
176  case EXC_ID5_BOF:
177  {
178  // #i23425# don't rely on the record ID, but on the detected BIFF version
179  switch( GetBiff() )
180  {
181  case EXC_BIFF2:
182  Bof2();
183  if( pExcRoot->eDateiTyp == Biff2 )
184  {
185  eCurrent = Z_Biff2;
186  NewTable();
187  }
188  break;
189  case EXC_BIFF3:
190  Bof3();
191  if( pExcRoot->eDateiTyp == Biff3 )
192  {
193  eCurrent = Z_Biff3;
194  NewTable();
195  }
196  break;
197  case EXC_BIFF4:
198  Bof4();
199  if( pExcRoot->eDateiTyp == Biff4 )
200  {
201  eCurrent = Z_Biff4;
202  NewTable();
203  }
204  else if( pExcRoot->eDateiTyp == Biff4W )
205  eCurrent = Z_Biff4W;
206  break;
207  case EXC_BIFF5:
208  Bof5();
209  if( pExcRoot->eDateiTyp == Biff5W )
210  {
211  eCurrent = Z_Biff5WPre;
212 
213  nBdshtTab = 0;
214 
215  aIn.StoreGlobalPosition(); // store position
216  }
217  else if( pExcRoot->eDateiTyp == Biff5 )
218  {
219  // #i62752# possible to have BIFF5 sheet without globals
220  NewTable();
221  eCurrent = Z_Biff5TPre; // Shrfmla Prefetch, Row-Prefetch
222  nBofLevel = 0;
223  aIn.StoreGlobalPosition(); // store position
224  }
225  break;
226  default:
227  DBG_ERROR_BIFF();
228  }
229  }
230  break;
231  }
232  }
233  break;
234 
235  case Z_Biff2: // ---------------------------------- Z_Biff2 -
236  {
237  switch( nOpcode )
238  {
239  case EXC_ID2_DIMENSIONS:
240  case EXC_ID3_DIMENSIONS: ReadDimensions(); break;
241  case EXC_ID2_BLANK:
242  case EXC_ID3_BLANK: ReadBlank(); break;
243  case EXC_ID2_INTEGER: ReadInteger(); break;
244  case EXC_ID2_NUMBER:
245  case EXC_ID3_NUMBER: ReadNumber(); break;
246  case EXC_ID2_LABEL:
247  case EXC_ID3_LABEL: ReadLabel(); break;
248  case EXC_ID2_BOOLERR:
249  case EXC_ID3_BOOLERR: ReadBoolErr(); break;
250  case EXC_ID_RK: ReadRk(); break;
251 
252  case 0x06: Formula25(); break; // FORMULA [ 2 5]
253  case 0x08: Row25(); break; // ROW [ 2 5]
254  case 0x0A: // EOF [ 2345]
255  rNumFmtBfr.CreateScFormats();
256  rNameMgr.ConvertAllTokens();
257  Eof();
258  eCurrent = Z_End;
259  break;
260  case 0x14:
261  case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
262  case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
263  case 0x18: rNameMgr.ReadName( maStrm ); break;
264  case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
265  case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
266  case 0x1E: rNumFmtBfr.ReadFormat( maStrm ); break;
267  case 0x20: Columndefault(); break; // COLUMNDEFAULT[ 2 ]
268  case 0x21: Array25(); break; // ARRAY [ 2 5]
269  case 0x23: Externname25(); break; // EXTERNNAME [ 2 5]
270  case 0x24: Colwidth(); break; // COLWIDTH [ 2 ]
271  case 0x25: Defrowheight2(); break; // DEFAULTROWHEI[ 2 ]
272  case 0x26:
273  case 0x27:
274  case 0x28:
275  case 0x29: rPageSett.ReadMargin( maStrm ); break;
276  case 0x2A: rPageSett.ReadPrintHeaders( maStrm ); break;
277  case 0x2B: rPageSett.ReadPrintGridLines( maStrm ); break;
278  case 0x2F: // FILEPASS [ 2345]
280  if( eLastErr != ERRCODE_NONE )
281  eCurrent = Z_End;
282  break;
283  case EXC_ID2_FONT: rFontBfr.ReadFont( maStrm ); break;
284  case EXC_ID_EFONT: rFontBfr.ReadEfont( maStrm ); break;
285  case 0x3E: rTabViewSett.ReadWindow2( maStrm, false );break;
286  case 0x41: rTabViewSett.ReadPane( maStrm ); break;
287  case 0x42: Codepage(); break; // CODEPAGE [ 2345]
288  case 0x43: rXFBfr.ReadXF( maStrm ); break;
289  case 0x44: Ixfe(); break; // IXFE [ 2 ]
290  }
291  }
292  break;
293 
294  case Z_Biff3: // ---------------------------------- Z_Biff3 -
295  {
296  switch( nOpcode )
297  {
298  // skip chart substream
299  case EXC_ID2_BOF:
300  case EXC_ID3_BOF:
301  case EXC_ID4_BOF:
303 
304  case EXC_ID2_DIMENSIONS:
305  case EXC_ID3_DIMENSIONS: ReadDimensions(); break;
306  case EXC_ID2_BLANK:
307  case EXC_ID3_BLANK: ReadBlank(); break;
308  case EXC_ID2_INTEGER: ReadInteger(); break;
309  case EXC_ID2_NUMBER:
310  case EXC_ID3_NUMBER: ReadNumber(); break;
311  case EXC_ID2_LABEL:
312  case EXC_ID3_LABEL: ReadLabel(); break;
313  case EXC_ID2_BOOLERR:
314  case EXC_ID3_BOOLERR: ReadBoolErr(); break;
315  case EXC_ID_RK: ReadRk(); break;
316 
317  case 0x0A: // EOF [ 2345]
318  rNumFmtBfr.CreateScFormats();
319  rNameMgr.ConvertAllTokens();
320  Eof();
321  eCurrent = Z_End;
322  break;
323  case 0x14:
324  case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
325  case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
326  case 0x1A:
327  case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
328  case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
329  case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
330  case 0x1E: rNumFmtBfr.ReadFormat( maStrm ); break;
331  case 0x22: Rec1904(); break; // 1904 [ 2345]
332  case 0x26:
333  case 0x27:
334  case 0x28:
335  case 0x29: rPageSett.ReadMargin( maStrm ); break;
336  case 0x2A: rPageSett.ReadPrintHeaders( maStrm ); break;
337  case 0x2B: rPageSett.ReadPrintGridLines( maStrm ); break;
338  case 0x2F: // FILEPASS [ 2345]
340  if( eLastErr != ERRCODE_NONE )
341  eCurrent = Z_End;
342  break;
343  case EXC_ID_FILESHARING: ReadFileSharing(); break;
344  case 0x41: rTabViewSett.ReadPane( maStrm ); break;
345  case 0x42: Codepage(); break; // CODEPAGE [ 2345]
346  case 0x56: break; // BUILTINFMTCNT[ 34 ]
347  case 0x5D: GetCurrSheetDrawing().ReadObj( maStrm );break;
348  case 0x7D: Colinfo(); break; // COLINFO [ 345]
349  case 0x8C: Country(); break; // COUNTRY [ 345]
350  case 0x92: rPal.ReadPalette( maStrm ); break;
351  case 0x0206: Formula3(); break; // FORMULA [ 3 ]
352  case 0x0208: Row34(); break; // ROW [ 34 ]
353  case 0x0218: rNameMgr.ReadName( maStrm ); break;
354  case 0x0221: Array34(); break; // ARRAY [ 34 ]
355  case 0x0223: break; // EXTERNNAME [ 34 ]
356  case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
357  case 0x0231: rFontBfr.ReadFont( maStrm ); break;
358  case 0x023E: rTabViewSett.ReadWindow2( maStrm, false );break;
359  case 0x0243: rXFBfr.ReadXF( maStrm ); break;
360  case 0x0293: rXFBfr.ReadStyle( maStrm ); break;
361  }
362  }
363  break;
364 
365  case Z_Biff4: // ---------------------------------- Z_Biff4 -
366  {
367  switch( nOpcode )
368  {
369  // skip chart substream
370  case EXC_ID2_BOF:
371  case EXC_ID3_BOF:
372  case EXC_ID4_BOF:
374 
375  case EXC_ID2_DIMENSIONS:
376  case EXC_ID3_DIMENSIONS: ReadDimensions(); break;
377  case EXC_ID2_BLANK:
378  case EXC_ID3_BLANK: ReadBlank(); break;
379  case EXC_ID2_INTEGER: ReadInteger(); break;
380  case EXC_ID2_NUMBER:
381  case EXC_ID3_NUMBER: ReadNumber(); break;
382  case EXC_ID2_LABEL:
383  case EXC_ID3_LABEL: ReadLabel(); break;
384  case EXC_ID2_BOOLERR:
385  case EXC_ID3_BOOLERR: ReadBoolErr(); break;
386  case EXC_ID_RK: ReadRk(); break;
387 
388  case 0x0A: // EOF [ 2345]
389  rNumFmtBfr.CreateScFormats();
390  rNameMgr.ConvertAllTokens();
391  Eof();
392  eCurrent = Z_End;
393  break;
394  case 0x12: SheetProtect(); break; // SHEET PROTECTION
395  case 0x14:
396  case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
397  case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
398  case 0x1A:
399  case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
400  case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
401  case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
402  case 0x22: Rec1904(); break; // 1904 [ 2345]
403  case 0x26:
404  case 0x27:
405  case 0x28:
406  case 0x29: rPageSett.ReadMargin( maStrm ); break;
407  case 0x2A: rPageSett.ReadPrintHeaders( maStrm ); break;
408  case 0x2B: rPageSett.ReadPrintGridLines( maStrm ); break;
409  case 0x2F: // FILEPASS [ 2345]
411  if( eLastErr != ERRCODE_NONE )
412  eCurrent = Z_End;
413  break;
414  case EXC_ID_FILESHARING: ReadFileSharing(); break;
415  case 0x41: rTabViewSett.ReadPane( maStrm ); break;
416  case 0x42: Codepage(); break; // CODEPAGE [ 2345]
417  case 0x55: DefColWidth(); break;
418  case 0x56: break; // BUILTINFMTCNT[ 34 ]
419  case 0x5D: GetCurrSheetDrawing().ReadObj( maStrm );break;
420  case 0x7D: Colinfo(); break; // COLINFO [ 345]
421  case 0x8C: Country(); break; // COUNTRY [ 345]
422  case 0x92: rPal.ReadPalette( maStrm ); break;
423  case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45]
424  case 0xA1: rPageSett.ReadSetup( maStrm ); break;
425  case 0x0208: Row34(); break; // ROW [ 34 ]
426  case 0x0218: rNameMgr.ReadName( maStrm ); break;
427  case 0x0221: Array34(); break; // ARRAY [ 34 ]
428  case 0x0223: break; // EXTERNNAME [ 34 ]
429  case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
430  case 0x0231: rFontBfr.ReadFont( maStrm ); break;
431  case 0x023E: rTabViewSett.ReadWindow2( maStrm, false );break;
432  case 0x0406: Formula4(); break; // FORMULA [ 4 ]
433  case 0x041E: rNumFmtBfr.ReadFormat( maStrm ); break;
434  case 0x0443: rXFBfr.ReadXF( maStrm ); break;
435  case 0x0293: rXFBfr.ReadStyle( maStrm ); break;
436  }
437  }
438  break;
439 
440  case Z_Biff4W: // --------------------------------- Z_Biff4W -
441  {
442  switch( nOpcode )
443  {
444  case 0x0A: // EOF [ 2345]
445  rNameMgr.ConvertAllTokens();
446  eCurrent = Z_End;
447  break;
448  case 0x12: DocProtect(); break; // PROTECT [ 5]
449  case 0x2F: // FILEPASS [ 2345]
451  if( eLastErr != ERRCODE_NONE )
452  eCurrent = Z_End;
453  break;
454  case EXC_ID_FILESHARING: ReadFileSharing(); break;
455  case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
456  case 0x42: Codepage(); break; // CODEPAGE [ 2345]
457  case 0x55: DefColWidth(); break;
458  case 0x56: break; // BUILTINFMTCNT[ 34 ]
459  case 0x8C: Country(); break; // COUNTRY [ 345]
460  case 0x8F: break; // BUNDLEHEADER [ 4 ]
461  case 0x92: rPal.ReadPalette( maStrm ); break;
462  case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45]
463  case 0x0218: rNameMgr.ReadName( maStrm ); break;
464  case 0x0223: break; // EXTERNNAME [ 34 ]
465  case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
466  case 0x0231: rFontBfr.ReadFont( maStrm ); break;
467  case EXC_ID4_BOF: // BOF [ 4 ]
468  Bof4();
469  if( pExcRoot->eDateiTyp == Biff4 )
470  {
471  eCurrent = Z_Biff4T;
472  NewTable();
473  }
474  else
475  eCurrent = Z_End;
476  break;
477  case 0x041E: rNumFmtBfr.ReadFormat( maStrm ); break;
478  case 0x0443: rXFBfr.ReadXF( maStrm ); break;
479  case 0x0293: rXFBfr.ReadStyle( maStrm ); break;
480  }
481 
482  }
483  break;
484 
485  case Z_Biff4T: // --------------------------------- Z_Biff4T -
486  {
487  switch( nOpcode )
488  {
489  // skip chart substream
490  case EXC_ID2_BOF:
491  case EXC_ID3_BOF:
492  case EXC_ID4_BOF:
494 
495  case EXC_ID2_DIMENSIONS:
496  case EXC_ID3_DIMENSIONS: ReadDimensions(); break;
497  case EXC_ID2_BLANK:
498  case EXC_ID3_BLANK: ReadBlank(); break;
499  case EXC_ID2_INTEGER: ReadInteger(); break;
500  case EXC_ID2_NUMBER:
501  case EXC_ID3_NUMBER: ReadNumber(); break;
502  case EXC_ID2_LABEL:
503  case EXC_ID3_LABEL: ReadLabel(); break;
504  case EXC_ID2_BOOLERR:
505  case EXC_ID3_BOOLERR: ReadBoolErr(); break;
506  case EXC_ID_RK: ReadRk(); break;
507 
508  case 0x0A: // EOF [ 2345]
509  rNameMgr.ConvertAllTokens();
510  Eof();
511  eCurrent = Z_Biff4E;
512  break;
513  case 0x12: SheetProtect(); break; // SHEET PROTECTION
514  case 0x14:
515  case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
516  case 0x1A:
517  case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
518  case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
519  case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
520  case 0x2F: // FILEPASS [ 2345]
522  if( eLastErr != ERRCODE_NONE )
523  eCurrent = Z_End;
524  break;
525  case 0x41: rTabViewSett.ReadPane( maStrm ); break;
526  case 0x42: Codepage(); break; // CODEPAGE [ 2345]
527  case 0x55: DefColWidth(); break;
528  case 0x56: break; // BUILTINFMTCNT[ 34 ]
529  case 0x5D: GetCurrSheetDrawing().ReadObj( maStrm );break;
530  case 0x7D: Colinfo(); break; // COLINFO [ 345]
531  case 0x8C: Country(); break; // COUNTRY [ 345]
532  case 0x8F: break; // BUNDLEHEADER [ 4 ]
533  case 0x92: rPal.ReadPalette( maStrm ); break;
534  case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45]
535  case 0xA1: rPageSett.ReadSetup( maStrm ); break;
536  case 0x0208: Row34(); break; // ROW [ 34 ]
537  case 0x0218: rNameMgr.ReadName( maStrm ); break;
538  case 0x0221: Array34(); break;
539  case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
540  case 0x0231: rFontBfr.ReadFont( maStrm ); break;
541  case 0x023E: rTabViewSett.ReadWindow2( maStrm, false );break;
542  case 0x0406: Formula4(); break;
543  case 0x041E: rNumFmtBfr.ReadFormat( maStrm ); break;
544  case 0x0443: rXFBfr.ReadXF( maStrm ); break;
545  case 0x0293: rXFBfr.ReadStyle( maStrm ); break;
546  }
547 
548  }
549  break;
550 
551  case Z_Biff4E: // --------------------------------- Z_Biff4E -
552  {
553  switch( nOpcode )
554  {
555  case 0x0A: // EOF [ 2345]
556  eCurrent = Z_End;
557  break;
558  case 0x8F: break; // BUNDLEHEADER [ 4 ]
559  case EXC_ID4_BOF: // BOF [ 4 ]
560  Bof4();
561  NewTable();
562  if( pExcRoot->eDateiTyp == Biff4 )
563  {
564  eCurrent = Z_Biff4T;
565  }
566  else
567  {
568  ePrev = eCurrent;
569  eCurrent = Z_Biffn0;
570  }
571  break;
572  }
573 
574  }
575  break;
576  case Z_Biff5WPre: // ------------------------------ Z_Biff5WPre -
577  {
578  switch( nOpcode )
579  {
580  case 0x0A: // EOF [ 2345]
581  eCurrent = Z_Biff5W;
582  aIn.SeekGlobalPosition(); // and back to old position
583  break;
584  case 0x12: DocProtect(); break; // PROTECT [ 5]
585  case 0x2F: // FILEPASS [ 2345]
587  if( eLastErr != ERRCODE_NONE )
588  eCurrent = Z_End;
589  break;
590  case EXC_ID_FILESHARING: ReadFileSharing(); break;
591  case 0x3D: Window1(); break;
592  case 0x42: Codepage(); break; // CODEPAGE [ 2345]
593  case 0x85: Boundsheet(); break; // BOUNDSHEET [ 5]
594  case 0x8C: Country(); break; // COUNTRY [ 345]
595  // PALETTE follows XFs, but already needed while reading the XFs
596  case 0x92: rPal.ReadPalette( maStrm ); break;
597  }
598  }
599  break;
600  case Z_Biff5W: // --------------------------------- Z_Biff5W -
601  {
602  switch( nOpcode )
603  {
604  case 0x0A: // EOF [ 2345]
605  rNumFmtBfr.CreateScFormats();
606  rXFBfr.CreateUserStyles();
607  rNameMgr.ConvertAllTokens();
608  eCurrent = Z_Biff5E;
609  break;
610  case 0x18: rNameMgr.ReadName( maStrm ); break;
611  case 0x1E: rNumFmtBfr.ReadFormat( maStrm ); break;
612  case 0x22: Rec1904(); break; // 1904 [ 2345]
613  case 0x31: rFontBfr.ReadFont( maStrm ); break;
614  case 0x56: break; // BUILTINFMTCNT[ 34 ]
615  case 0x8D: Hideobj(); break; // HIDEOBJ [ 345]
616  case 0xDE: Olesize(); break;
617  case 0xE0: rXFBfr.ReadXF( maStrm ); break;
618  case 0x0293: rXFBfr.ReadStyle( maStrm ); break;
619  case 0x041E: rNumFmtBfr.ReadFormat( maStrm ); break;
620  }
621 
622  }
623  break;
624 
625  case Z_Biff5TPre: // ------------------------------- Z_Biff5Pre -
626  {
627  if (nOpcode == EXC_ID5_BOF)
628  nBofLevel++;
629  else if( (nOpcode == 0x000A) && nBofLevel )
630  nBofLevel--;
631  else if( !nBofLevel ) // don't read chart records
632  {
633  switch( nOpcode )
634  {
635  case EXC_ID2_DIMENSIONS:
636  case EXC_ID3_DIMENSIONS: ReadDimensions(); break;
637  case 0x08: Row25(); break; // ROW [ 2 5]
638  case 0x0A: // EOF [ 2345]
639  eCurrent = Z_Biff5T;
640  aIn.SeekGlobalPosition(); // and back to old position
641  break;
642  case 0x12: SheetProtect(); break; // SHEET PROTECTION
643  case 0x1A:
644  case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
645  case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
646  case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
647  case 0x21: Array25(); break; // ARRAY [ 2 5]
648  case 0x23: Externname25(); break; // EXTERNNAME [ 2 5]
649  case 0x41: rTabViewSett.ReadPane( maStrm ); break;
650  case 0x42: Codepage(); break; // CODEPAGE [ 2345]
651  case 0x55: DefColWidth(); break;
652  case 0x7D: Colinfo(); break; // COLINFO [ 345]
653  case 0x81: Wsbool(); break; // WSBOOL [ 2345]
654  case 0x8C: Country(); break; // COUNTRY [ 345]
655  case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45]
656  case 0x0208: Row34(); break; // ROW [ 34 ]
657  case 0x0221: Array34(); break; // ARRAY [ 34 ]
658  case 0x0223: break; // EXTERNNAME [ 34 ]
659  case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
660  case 0x023E: rTabViewSett.ReadWindow2( maStrm, false );break;
661  }
662  }
663  }
664  break;
665 
666  case Z_Biff5T: // --------------------------------- Z_Biff5T -
667  {
668  switch( nOpcode )
669  {
670  case EXC_ID2_BLANK:
671  case EXC_ID3_BLANK: ReadBlank(); break;
672  case EXC_ID2_INTEGER: ReadInteger(); break;
673  case EXC_ID2_NUMBER:
674  case EXC_ID3_NUMBER: ReadNumber(); break;
675  case EXC_ID2_LABEL:
676  case EXC_ID3_LABEL: ReadLabel(); break;
677  case EXC_ID2_BOOLERR:
678  case EXC_ID3_BOOLERR: ReadBoolErr(); break;
679  case EXC_ID_RK: ReadRk(); break;
680 
681  case EXC_ID2_FORMULA:
682  case EXC_ID3_FORMULA:
683  case EXC_ID4_FORMULA: Formula25(); break;
684  case EXC_ID_SHRFMLA: Shrfmla(); break;
685  case 0x0A: Eof(); eCurrent = Z_Biff5E; break;
686  case 0x14:
687  case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
688  case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
689  case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
690  case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
691  case 0x23: Externname25(); break; // EXTERNNAME [ 2 5]
692  case 0x26:
693  case 0x27:
694  case 0x28:
695  case 0x29: rPageSett.ReadMargin( maStrm ); break;
696  case 0x2A: rPageSett.ReadPrintHeaders( maStrm ); break;
697  case 0x2B: rPageSett.ReadPrintGridLines( maStrm ); break;
698  case 0x2F: // FILEPASS [ 2345]
700  if( eLastErr != ERRCODE_NONE )
701  eCurrent = Z_End;
702  break;
703  case 0x5D: GetCurrSheetDrawing().ReadObj( maStrm );break;
704  case 0x83:
705  case 0x84: rPageSett.ReadCenter( maStrm ); break;
706  case 0xA0: rTabViewSett.ReadScl( maStrm ); break;
707  case 0xA1: rPageSett.ReadSetup( maStrm ); break;
708  case 0xBD: Mulrk(); break; // MULRK [ 5]
709  case 0xBE: Mulblank(); break; // MULBLANK [ 5]
710  case 0xD6: Rstring(); break; // RSTRING [ 5]
711  case 0x00E5: Cellmerging(); break; // #i62300#
712  case 0x0236: TableOp(); break; // TABLE [ 5]
713  case EXC_ID5_BOF: // BOF [ 5]
715  break;
716  }
717 
718  }
719  break;
720 
721  case Z_Biff5E: // --------------------------------- Z_Biff5E -
722  {
723  switch( nOpcode )
724  {
725  case EXC_ID5_BOF: // BOF [ 5]
726  Bof5();
727  NewTable();
728  switch( pExcRoot->eDateiTyp )
729  {
730  case Biff5:
731  case Biff5M4:
732  eCurrent = Z_Biff5TPre; // Shrfmla Prefetch, Row-Prefetch
733  nBofLevel = 0;
734  aIn.StoreGlobalPosition(); // store position
735  break;
736  case Biff5C: // chart sheet
738  Eof();
740  break;
741  case Biff5V:
742  default:
743  rD.SetVisible( GetCurrScTab(), false );
744  ePrev = eCurrent;
745  eCurrent = Z_Biffn0;
746  }
747  OSL_ENSURE( pExcRoot->eDateiTyp != Biff5W,
748  "+ImportExcel::Read(): Doppel-Whopper-Workbook!" );
749 
750  break;
751  }
752 
753  }
754  break;
755  case Z_Biffn0: // --------------------------------- Z_Biffn0 -
756  {
757  switch( nOpcode )
758  {
759  case 0x0A: // EOF [ 2345]
760  eCurrent = ePrev;
761  IncCurrScTab();
762  break;
763  }
764 
765  }
766  break;
767 
768  case Z_End: // ----------------------------------- Z_End -
769  OSL_FAIL( "*ImportExcel::Read(): Not possible state!" );
770  break;
771  default: OSL_FAIL( "-ImportExcel::Read(): state forgotten!" );
772  }
773  }
774 
775  if( eLastErr == ERRCODE_NONE )
776  {
777  pProgress.reset();
778 
781  AdjustRowHeight();
782  PostDocLoad();
783 
784  rD.CalcAfterLoad(false);
785 
786  const XclImpAddressConverter& rAddrConv = GetAddressConverter();
787  if( rAddrConv.IsTabTruncated() )
788  eLastErr = SCWARN_IMPORT_SHEET_OVERFLOW;
789  else if( bTabTruncated || rAddrConv.IsRowTruncated() )
790  eLastErr = SCWARN_IMPORT_ROW_OVERFLOW;
791  else if( rAddrConv.IsColTruncated() )
793  }
794  }
795  catch (const SvStreamEOFException&)
796  {
797  SAL_WARN("sc", "EOF");
798  return ERRCODE_IO_CANTREAD;
799  }
800  return eLastErr;
801 }
802 
804 {
805 #ifdef EXC_INCL_DUMPER
806  {
807  Biff8RecDumper aDumper( GetRoot(), sal_True );
808  if( aDumper.Dump( aIn ) )
809  return ERRCODE_ABORT;
810  }
811 #endif
812  // read the entire BIFF8 stream
813  // don't look too close - this stuff seriously needs to be reworked
814 
815  XclImpPageSettings& rPageSett = GetPageSettings();
816  XclImpTabViewSettings& rTabViewSett = GetTabViewSettings();
817  XclImpPalette& rPal = GetPalette();
818  XclImpFontBuffer& rFontBfr = GetFontBuffer();
819  XclImpNumFmtBuffer& rNumFmtBfr = GetNumFmtBuffer();
820  XclImpXFBuffer& rXFBfr = GetXFBuffer();
821  XclImpSst& rSst = GetSst();
822  XclImpTabInfo& rTabInfo = GetTabInfo();
823  XclImpNameManager& rNameMgr = GetNameManager();
824  XclImpLinkManager& rLinkMgr = GetLinkManager();
826  // call to GetCurrSheetDrawing() cannot be cached (changes in new sheets)
831 
832  bool bInUserView = false; // true = In USERSVIEW(BEGIN|END) record block.
833 
834  enum XclImpReadState
835  {
836  EXC_STATE_BEFORE_GLOBALS,
837  EXC_STATE_GLOBALS_PRE,
838  EXC_STATE_GLOBALS,
839  EXC_STATE_BEFORE_SHEET,
840  EXC_STATE_SHEET_PRE,
841  EXC_STATE_SHEET,
842  EXC_STATE_END
843  };
844 
845  XclImpReadState eCurrent = EXC_STATE_BEFORE_GLOBALS;
846 
847  ErrCode eLastErr = ERRCODE_NONE;
848 
849  std::unique_ptr< ScfSimpleProgressBar > pProgress( new ScfSimpleProgressBar(
850  aIn.GetSvStreamSize(), GetDocShell(), STR_LOAD_DOC ) );
851 
852  /* #i104057# Need to track a base position for progress bar calculation,
853  because sheet substreams may not be in order of sheets. */
854  std::size_t nProgressBasePos = 0;
855  std::size_t nProgressBaseSize = 0;
856 
857  bool bSheetHasCodeName = false;
858 
859  std::vector<OUString> aCodeNames;
860  std::vector < SCTAB > nTabsWithNoCodeName;
861 
862  try
863  {
864  sal_uInt16 nRecId = 0;
865 
866  for (; eCurrent != EXC_STATE_END; mnLastRecId = nRecId)
867  {
868  if( eCurrent == EXC_STATE_BEFORE_SHEET )
869  {
870  sal_uInt16 nScTab = GetCurrScTab();
871  if( nScTab < maSheetOffsets.size() )
872  {
873  nProgressBaseSize += (maStrm.GetSvStreamPos() - nProgressBasePos);
874  nProgressBasePos = maSheetOffsets[ nScTab ];
875 
876  bool bValid = TryStartNextRecord(aIn, nProgressBasePos);
877  if (!bValid)
878  {
879  // Safeguard ourselves from potential infinite loop.
880  eCurrent = EXC_STATE_END;
881  }
882 
883  // import only 256 sheets
884  if( nScTab > GetScMaxPos().Tab() )
885  {
886  if( maStrm.GetRecId() != EXC_ID_EOF )
888  // #i29930# show warning box
889  GetAddressConverter().CheckScTab( nScTab );
890  eCurrent = EXC_STATE_END;
891  }
892  else
893  {
894  // #i109800# SHEET record may point to any record inside the
895  // sheet substream
896  bool bIsBof = maStrm.GetRecId() == EXC_ID5_BOF;
897  if( bIsBof )
898  Bof5(); // read the BOF record
899  else
900  pExcRoot->eDateiTyp = Biff8; // on missing BOF, assume a standard worksheet
901  NewTable();
902  switch( pExcRoot->eDateiTyp )
903  {
904  case Biff8: // worksheet
905  case Biff8M4: // macro sheet
906  eCurrent = EXC_STATE_SHEET_PRE; // Shrfmla Prefetch, Row-Prefetch
907  // go to next record
908  if( bIsBof ) maStrm.StartNextRecord();
910  break;
911  case Biff8C: // chart sheet
913  Eof();
915  break;
916  case Biff8W: // workbook
917  OSL_FAIL( "ImportExcel8::Read - double workbook globals" );
918  [[fallthrough]];
919  case Biff8V: // VB module
920  default:
921  // TODO: do not create a sheet in the Calc document
922  rD.SetVisible( nScTab, false );
924  IncCurrScTab();
925  }
926  }
927  }
928  else
929  eCurrent = EXC_STATE_END;
930  }
931  else
933 
934  if( !aIn.IsValid() )
935  {
936  // #i63591# finalize table if EOF is missing
937  switch( eCurrent )
938  {
939  case EXC_STATE_SHEET_PRE:
940  eCurrent = EXC_STATE_SHEET;
942  continue; // next iteration in while loop
943  case EXC_STATE_SHEET:
944  Eof();
945  eCurrent = EXC_STATE_END;
946  break;
947  default:
948  eCurrent = EXC_STATE_END;
949  }
950  }
951 
952  if( eCurrent == EXC_STATE_END )
953  break;
954 
955  if( eCurrent != EXC_STATE_SHEET_PRE && eCurrent != EXC_STATE_GLOBALS_PRE )
956  pProgress->ProgressAbs( nProgressBaseSize + aIn.GetSvStreamPos() - nProgressBasePos );
957 
958  nRecId = aIn.GetRecId();
959 
960  /* #i39464# Ignore records between USERSVIEWBEGIN and USERSVIEWEND
961  completely (user specific view settings). Otherwise view settings
962  and filters are loaded multiple times, which at least causes
963  problems in auto-filters. */
964  switch( nRecId )
965  {
967  OSL_ENSURE( !bInUserView, "ImportExcel8::Read - nested user view settings" );
968  bInUserView = true;
969  break;
970  case EXC_ID_USERSVIEWEND:
971  OSL_ENSURE( bInUserView, "ImportExcel8::Read - not in user view settings" );
972  bInUserView = false;
973  break;
974  }
975 
976  if( !bInUserView ) switch( eCurrent )
977  {
978 
979  // before workbook globals: wait for initial workbook globals BOF
980  case EXC_STATE_BEFORE_GLOBALS:
981  {
982  if( nRecId == EXC_ID5_BOF )
983  {
984  OSL_ENSURE( GetBiff() == EXC_BIFF8, "ImportExcel8::Read - wrong BIFF version" );
985  Bof5();
986  if( pExcRoot->eDateiTyp == Biff8W )
987  {
988  eCurrent = EXC_STATE_GLOBALS_PRE;
990  nBdshtTab = 0;
991  }
992  else if( pExcRoot->eDateiTyp == Biff8 )
993  {
994  // #i62752# possible to have BIFF8 sheet without globals
995  NewTable();
996  eCurrent = EXC_STATE_SHEET_PRE; // Shrfmla Prefetch, Row-Prefetch
997  bSheetHasCodeName = false; // reset
999  }
1000  }
1001  }
1002  break;
1003 
1004  // prefetch for workbook globals
1005  case EXC_STATE_GLOBALS_PRE:
1006  {
1007  switch( nRecId )
1008  {
1009  case EXC_ID_EOF:
1010  case EXC_ID_EXTSST:
1011  /* #i56376# evil hack: if EOF for globals is missing,
1012  simulate it. This hack works only for the bugdoc
1013  given in the issue, where the sheet substreams
1014  start directly after the EXTSST record. A future
1015  implementation should be more robust against
1016  missing EOFs. */
1017  if( (nRecId == EXC_ID_EOF) ||
1018  ((nRecId == EXC_ID_EXTSST) && (maStrm.GetNextRecId() == EXC_ID5_BOF)) )
1019  {
1020  eCurrent = EXC_STATE_GLOBALS;
1022  }
1023  break;
1024  case 0x12: DocProtect(); break; // PROTECT [ 5678]
1025  case 0x13: DocPassword(); break;
1026  case 0x19: WinProtection(); break;
1027  case 0x2F: // FILEPASS [ 2345 ]
1029  if( eLastErr != ERRCODE_NONE )
1030  eCurrent = EXC_STATE_END;
1031  break;
1032  case EXC_ID_FILESHARING: ReadFileSharing(); break;
1033  case 0x3D: Window1(); break;
1034  case 0x42: Codepage(); break; // CODEPAGE [ 2345 ]
1035  case 0x85: Boundsheet(); break; // BOUNDSHEET [ 5 ]
1036  case 0x8C: Country(); break; // COUNTRY [ 345 ]
1037 
1038  // PALETTE follows XFs, but already needed while reading the XFs
1039  case EXC_ID_PALETTE: rPal.ReadPalette( maStrm ); break;
1040  }
1041  }
1042  break;
1043 
1044  // workbook globals
1045  case EXC_STATE_GLOBALS:
1046  {
1047  switch( nRecId )
1048  {
1049  case EXC_ID_EOF:
1050  case EXC_ID_EXTSST:
1051  /* #i56376# evil hack: if EOF for globals is missing,
1052  simulate it. This hack works only for the bugdoc
1053  given in the issue, where the sheet substreams
1054  start directly after the EXTSST record. A future
1055  implementation should be more robust against
1056  missing EOFs. */
1057  if( (nRecId == EXC_ID_EOF) ||
1058  ((nRecId == EXC_ID_EXTSST) && (maStrm.GetNextRecId() == EXC_ID5_BOF)) )
1059  {
1060  rNumFmtBfr.CreateScFormats();
1061  rXFBfr.CreateUserStyles();
1062  rPTableMgr.ReadPivotCaches( maStrm );
1063  rNameMgr.ConvertAllTokens();
1064  eCurrent = EXC_STATE_BEFORE_SHEET;
1065  }
1066  break;
1067  case 0x0E: Precision(); break; // PRECISION
1068  case 0x22: Rec1904(); break; // 1904 [ 2345 ]
1069  case 0x56: break; // BUILTINFMTCNT[ 34 ]
1070  case 0x8D: Hideobj(); break; // HIDEOBJ [ 345 ]
1071  case 0xD3: SetHasBasic(); break;
1072  case 0xDE: Olesize(); break;
1073 
1074  case EXC_ID_CODENAME: ReadCodeName( aIn, true ); break;
1075  case EXC_ID_USESELFS: ReadUsesElfs(); break;
1076 
1077  case EXC_ID2_FONT: rFontBfr.ReadFont( maStrm ); break;
1078  case EXC_ID4_FORMAT: rNumFmtBfr.ReadFormat( maStrm ); break;
1079  case EXC_ID5_XF: rXFBfr.ReadXF( maStrm ); break;
1080  case EXC_ID_STYLE: rXFBfr.ReadStyle( maStrm ); break;
1081 
1082  case EXC_ID_SST: rSst.ReadSst( maStrm ); break;
1083  case EXC_ID_TABID: rTabInfo.ReadTabid( maStrm ); break;
1084  case EXC_ID_NAME: rNameMgr.ReadName( maStrm ); break;
1085 
1086  case EXC_ID_EXTERNSHEET: rLinkMgr.ReadExternsheet( maStrm ); break;
1087  case EXC_ID_SUPBOOK: rLinkMgr.ReadSupbook( maStrm ); break;
1088  case EXC_ID_XCT: rLinkMgr.ReadXct( maStrm ); break;
1089  case EXC_ID_CRN: rLinkMgr.ReadCrn( maStrm ); break;
1090  case EXC_ID_EXTERNNAME: rLinkMgr.ReadExternname( maStrm, pFormConv.get() ); break;
1091 
1092  case EXC_ID_MSODRAWINGGROUP:rObjMgr.ReadMsoDrawingGroup( maStrm ); break;
1093 
1094  case EXC_ID_SXIDSTM: rPTableMgr.ReadSxidstm( maStrm ); break;
1095  case EXC_ID_SXVS: rPTableMgr.ReadSxvs( maStrm ); break;
1096  case EXC_ID_DCONREF: rPTableMgr.ReadDconref( maStrm ); break;
1097  case EXC_ID_DCONNAME: rPTableMgr.ReadDConName( maStrm ); break;
1098  }
1099 
1100  }
1101  break;
1102 
1103  // prefetch for worksheet
1104  case EXC_STATE_SHEET_PRE:
1105  {
1106  switch( nRecId )
1107  {
1108  // skip chart substream
1109  case EXC_ID2_BOF:
1110  case EXC_ID3_BOF:
1111  case EXC_ID4_BOF:
1112  case EXC_ID5_BOF: XclTools::SkipSubStream( maStrm ); break;
1113 
1114  case EXC_ID_WINDOW2: rTabViewSett.ReadWindow2( maStrm, false );break;
1115  case EXC_ID_SCL: rTabViewSett.ReadScl( maStrm ); break;
1116  case EXC_ID_PANE: rTabViewSett.ReadPane( maStrm ); break;
1117  case EXC_ID_SELECTION: rTabViewSett.ReadSelection( maStrm ); break;
1118 
1119  case EXC_ID2_DIMENSIONS:
1120  case EXC_ID3_DIMENSIONS: ReadDimensions(); break;
1121 
1122  case EXC_ID_CODENAME: ReadCodeName( aIn, false ); bSheetHasCodeName = true; break;
1123 
1124  case 0x0A: // EOF [ 2345 ]
1125  {
1126  eCurrent = EXC_STATE_SHEET;
1127  OUString sName;
1128  GetDoc().GetName( GetCurrScTab(), sName );
1129  if ( !bSheetHasCodeName )
1130  {
1131  nTabsWithNoCodeName.push_back( GetCurrScTab() );
1132  }
1133  else
1134  {
1135  OUString sCodeName;
1136  GetDoc().GetCodeName( GetCurrScTab(), sCodeName );
1137  aCodeNames.push_back( sCodeName );
1138  }
1139 
1140  bSheetHasCodeName = false; // reset
1141 
1142  aIn.SeekGlobalPosition(); // and back to old position
1143  break;
1144  }
1145  case 0x12: SheetProtect(); break;
1146  case 0x13: SheetPassword(); break;
1147  case 0x42: Codepage(); break; // CODEPAGE [ 2345 ]
1148  case 0x55: DefColWidth(); break;
1149  case 0x7D: Colinfo(); break; // COLINFO [ 345 ]
1150  case 0x81: Wsbool(); break; // WSBOOL [ 2345 ]
1151  case 0x8C: Country(); break; // COUNTRY [ 345 ]
1152  case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45 ]
1153  case 0x9B: FilterMode(); break; // FILTERMODE
1154  case EXC_ID_AUTOFILTERINFO: AutoFilterInfo(); break;// AUTOFILTERINFO
1155  case EXC_ID_AUTOFILTER: AutoFilter(); break; // AUTOFILTER
1156  case 0x0208: Row34(); break; // ROW [ 34 ]
1157  case EXC_ID2_ARRAY:
1158  case EXC_ID3_ARRAY: Array34(); break; // ARRAY [ 34 ]
1159  case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345 ]
1160  case 0x0867: FeatHdr(); break; // FEATHDR
1161  case 0x0868: Feat(); break; // FEAT
1162  }
1163  }
1164  break;
1165 
1166  // worksheet
1167  case EXC_STATE_SHEET:
1168  {
1169  switch( nRecId )
1170  {
1171  // skip unknown substreams
1172  case EXC_ID2_BOF:
1173  case EXC_ID3_BOF:
1174  case EXC_ID4_BOF:
1175  case EXC_ID5_BOF: XclTools::SkipSubStream( maStrm ); break;
1176 
1177  case EXC_ID_EOF: Eof(); eCurrent = EXC_STATE_BEFORE_SHEET; break;
1178 
1179  case EXC_ID2_BLANK:
1180  case EXC_ID3_BLANK: ReadBlank(); break;
1181  case EXC_ID2_INTEGER: ReadInteger(); break;
1182  case EXC_ID2_NUMBER:
1183  case EXC_ID3_NUMBER: ReadNumber(); break;
1184  case EXC_ID2_LABEL:
1185  case EXC_ID3_LABEL: ReadLabel(); break;
1186  case EXC_ID2_BOOLERR:
1187  case EXC_ID3_BOOLERR: ReadBoolErr(); break;
1188  case EXC_ID_RK: ReadRk(); break;
1189 
1190  case EXC_ID2_FORMULA:
1191  case EXC_ID3_FORMULA:
1192  case EXC_ID4_FORMULA: Formula25(); break;
1193  case EXC_ID_SHRFMLA: Shrfmla(); break;
1194  case 0x000C: Calccount(); break; // CALCCOUNT
1195  case 0x0010: Delta(); break; // DELTA
1196  case 0x0011: Iteration(); break; // ITERATION
1197  case 0x007E:
1198  case 0x00AE: Scenman(); break; // SCENMAN
1199  case 0x00AF: Scenario(); break; // SCENARIO
1200  case 0x00BD: Mulrk(); break; // MULRK [ 5 ]
1201  case 0x00BE: Mulblank(); break; // MULBLANK [ 5 ]
1202  case 0x00D6: Rstring(); break; // RSTRING [ 5 ]
1203  case 0x00E5: Cellmerging(); break; // CELLMERGING
1204  case 0x00FD: Labelsst(); break; // LABELSST [ 8 ]
1205  case 0x0236: TableOp(); break; // TABLE
1206 
1207  case EXC_ID_HORPAGEBREAKS:
1208  case EXC_ID_VERPAGEBREAKS: rPageSett.ReadPageBreaks( maStrm ); break;
1209  case EXC_ID_HEADER:
1210  case EXC_ID_FOOTER: rPageSett.ReadHeaderFooter( maStrm ); break;
1211  case EXC_ID_LEFTMARGIN:
1212  case EXC_ID_RIGHTMARGIN:
1213  case EXC_ID_TOPMARGIN:
1214  case EXC_ID_BOTTOMMARGIN: rPageSett.ReadMargin( maStrm ); break;
1215  case EXC_ID_PRINTHEADERS: rPageSett.ReadPrintHeaders( maStrm ); break;
1216  case EXC_ID_PRINTGRIDLINES: rPageSett.ReadPrintGridLines( maStrm ); break;
1217  case EXC_ID_HCENTER:
1218  case EXC_ID_VCENTER: rPageSett.ReadCenter( maStrm ); break;
1219  case EXC_ID_SETUP: rPageSett.ReadSetup( maStrm ); break;
1220  case EXC_ID8_IMGDATA: rPageSett.ReadImgData( maStrm ); break;
1221 
1223  // #i61786# weird documents: OBJ without MSODRAWING -> read in BIFF5 format
1224  case EXC_ID_OBJ: GetCurrSheetDrawing().ReadObj( maStrm ); break;
1225  case EXC_ID_NOTE: GetCurrSheetDrawing().ReadNote( maStrm ); break;
1226 
1229 
1230  case EXC_ID_CONDFMT: rCondFmtMgr.ReadCondfmt( maStrm ); break;
1231  case EXC_ID_CF: rCondFmtMgr.ReadCF( maStrm ); break;
1232 
1234  case EXC_ID_DV: rValidMgr.ReadDV( maStrm ); break;
1235 
1236  case EXC_ID_QSI: rWQBfr.ReadQsi( maStrm ); break;
1237  case EXC_ID_WQSTRING: rWQBfr.ReadWqstring( maStrm ); break;
1238  case EXC_ID_PQRY: rWQBfr.ReadParamqry( maStrm ); break;
1239  case EXC_ID_WQSETT: rWQBfr.ReadWqsettings( maStrm ); break;
1240  case EXC_ID_WQTABLES: rWQBfr.ReadWqtables( maStrm ); break;
1241 
1242  case EXC_ID_SXVIEW: rPTableMgr.ReadSxview( maStrm ); break;
1243  case EXC_ID_SXVD: rPTableMgr.ReadSxvd( maStrm ); break;
1244  case EXC_ID_SXVI: rPTableMgr.ReadSxvi( maStrm ); break;
1245  case EXC_ID_SXIVD: rPTableMgr.ReadSxivd( maStrm ); break;
1246  case EXC_ID_SXPI: rPTableMgr.ReadSxpi( maStrm ); break;
1247  case EXC_ID_SXDI: rPTableMgr.ReadSxdi( maStrm ); break;
1248  case EXC_ID_SXVDEX: rPTableMgr.ReadSxvdex( maStrm ); break;
1249  case EXC_ID_SXEX: rPTableMgr.ReadSxex( maStrm ); break;
1250  case EXC_ID_SHEETEXT: rTabViewSett.ReadTabBgColor( maStrm, rPal ); break;
1251  case EXC_ID_SXVIEWEX9: rPTableMgr.ReadSxViewEx9( maStrm ); break;
1252  case EXC_ID_SXADDL: rPTableMgr.ReadSxAddl( maStrm ); break;
1253  }
1254  }
1255  break;
1256 
1257  default:;
1258  }
1259  }
1260  }
1261  catch (const SvStreamEOFException&)
1262  {
1263  SAL_WARN("sc", "EOF");
1264  eLastErr = ERRCODE_IO_CANTREAD;
1265  }
1266 
1267  if( eLastErr == ERRCODE_NONE )
1268  {
1269  // In some strange circumstances the codename might be missing
1270  // # Create any missing Sheet CodeNames
1271  for ( const auto& rTab : nTabsWithNoCodeName )
1272  {
1273  SCTAB nTab = 1;
1274  while ( true )
1275  {
1276  OUStringBuffer aBuf;
1277  aBuf.append("Sheet");
1278  aBuf.append(static_cast<sal_Int32>(nTab++));
1279  OUString sTmpName = aBuf.makeStringAndClear();
1280 
1281  if ( std::find(aCodeNames.begin(), aCodeNames.end(), sTmpName) == aCodeNames.end() ) // generated codename not found
1282  {
1283  // Set new codename
1284  GetDoc().SetCodeName( rTab, sTmpName );
1285  // Record newly used codename
1286  aCodeNames.push_back(sTmpName);
1287  break;
1288  }
1289  }
1290  }
1291  // #i45843# Convert pivot tables before calculation, so they are available
1292  // for the GETPIVOTDATA function.
1293  if( GetBiff() == EXC_BIFF8 )
1295 
1296  ScDocumentImport& rDoc = GetDocImport();
1297  rDoc.finalize();
1298  pProgress.reset();
1299 #if 0
1300  // Excel documents look much better without this call; better in the
1301  // sense that the row heights are identical to the original heights in
1302  // Excel.
1303  if ( !rD.IsAdjustHeightLocked())
1304  AdjustRowHeight();
1305 #endif
1306  PostDocLoad();
1307 
1308  rD.CalcAfterLoad(false);
1309 
1310  // import change tracking data
1311  XclImpChangeTrack aImpChTr( GetRoot(), maStrm );
1312  aImpChTr.Apply();
1313 
1314  const XclImpAddressConverter& rAddrConv = GetAddressConverter();
1315  if( rAddrConv.IsTabTruncated() )
1316  eLastErr = SCWARN_IMPORT_SHEET_OVERFLOW;
1317  else if( bTabTruncated || rAddrConv.IsRowTruncated() )
1318  eLastErr = SCWARN_IMPORT_ROW_OVERFLOW;
1319  else if( rAddrConv.IsColTruncated() )
1320  eLastErr = SCWARN_IMPORT_COLUMN_OVERFLOW;
1321 
1322  if( GetBiff() == EXC_BIFF8 )
1324  }
1325 
1326  return eLastErr;
1327 }
1328 
1329 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_uInt16 EXC_ID_WQSETT
Definition: xlcontent.hxx:174
RootData * pExcRoot
Definition: imp_op.hxx:88
void ReadDV(XclImpStream &rStrm)
Reads a DV record and inserts validation data into the document.
Definition: xicontent.cxx:754
void AdjustRowHeight()
Definition: impop.cxx:1222
XclImpValidationManager & GetValidationManager() const
Definition: xiroot.cxx:211
void ReadCodeName(XclImpStream &rStrm, bool bGlobals)
Reads the CODENAME record and inserts the codename into the document.
Definition: xiroot.cxx:271
const sal_uInt16 EXC_ID_SXPI
Definition: xlpivot.hxx:172
void ReadXF(XclImpStream &rStrm)
Reads an XF record.
Definition: xistyle.cxx:1570
#define DBG_ERROR_BIFF()
Definition: xltools.hxx:34
const sal_uInt16 EXC_ID3_FORMULA
Definition: xltable.hxx:62
const sal_uInt16 EXC_ID2_DIMENSIONS
Definition: xltable.hxx:33
void SheetProtect()
Definition: impop.cxx:601
void ReadWindow2(XclImpStream &rStrm, bool bChart)
Reads a WINDOW2 record.
Definition: xiview.cxx:117
XclImpStream maStrm
Definition: imp_op.hxx:90
const sal_uInt16 EXC_ID_CONDFMT
Definition: xlcontent.hxx:54
const sal_uInt16 EXC_ID_LABELRANGES
Definition: xlcontent.hxx:50
void ReadPageBreaks(XclImpStream &rStrm)
Reads a HORIZONTALPAGEBREAKS or VERTICALPAGEBREAKS record.
Definition: xipage.cxx:134
sal_uInt16 GetNextRecId()
Returns the record ID of the following record.
Definition: xistream.cxx:594
ScDocumentImport & GetDocImport()
Definition: xiroot.cxx:292
void ReadCenter(XclImpStream &rStrm)
Reads a HCENTER or VCENTER record.
Definition: xipage.cxx:101
void ReadExternsheet(XclImpStream &rStrm)
Reads the EXTERNSHEET record.
Definition: xilink.cxx:901
void AutoFilterInfo()
Definition: excimp8.cxx:442
Contains all view settings for a single sheet.
Definition: xiview.hxx:59
Contains all XF records occurred in the file.
Definition: xistyle.hxx:478
XclImpTabViewSettings & GetTabViewSettings() const
Returns the view settings of the current sheet.
Definition: xiroot.cxx:258
void ReadSxvi(XclImpStream &rStrm)
Reads an SXVI record describing a new item of the current field.
Definition: xipivot.cxx:1694
const sal_uInt16 EXC_ID_SXIVD
Definition: xlpivot.hxx:164
XclImpNumFmtBuffer & GetNumFmtBuffer() const
Returns the number format buffer.
Definition: xiroot.cxx:151
XclImpPivotTableManager & GetPivotTableManager() const
Returns the pivot table manager.
Definition: xiroot.cxx:230
void ReadUsesElfs()
Definition: impop.cxx:745
void ReadSxpi(XclImpStream &rStrm)
Reads an SXPI record containing page field data.
Definition: xipivot.cxx:1682
void ConvertAllTokens()
Definition: xiname.cxx:316
void ReadQsi(XclImpStream &rStrm)
Reads the QSI record and creates a new web query in the buffer.
Definition: xicontent.cxx:1030
void ReadName(XclImpStream &rStrm)
Reads a NAME record and creates an entry in this buffer.
Definition: xiname.cxx:283
sal_uInt16 GetRecId() const
Returns the current record ID.
Definition: xistream.hxx:354
void Columndefault()
Definition: impop.cxx:471
Stores all drawing and OLE objects and additional data related to these objects.
Definition: xiescher.hxx:1145
const sal_uInt16 EXC_ID_PQRY
Definition: xlcontent.hxx:159
const sal_uInt16 EXC_ID2_LABEL
Definition: xltable.hxx:48
const sal_uInt16 EXC_ID_NOTE
Definition: xlescher.hxx:39
void Externsheet()
Definition: impop.cxx:454
const sal_uInt16 EXC_ID_EXTSST
Definition: xlcontent.hxx:46
void Row34()
Definition: impop.cxx:948
const sal_uInt16 EXC_ID_SXVS
Definition: xlpivot.hxx:297
void DocPassword()
Definition: impop.cxx:617
void ReadSxidstm(XclImpStream &rStrm)
Reads an SXIDSTM record containing a pivot cache stream identifier and the pivot cache.
Definition: xipivot.cxx:1630
virtual ErrCode Read() override
Definition: read.cxx:803
void Standardwidth()
Definition: impop.cxx:790
const sal_uInt16 EXC_ID_NAME
Definition: xlname.hxx:29
This buffer contains all internal defined names of the document.
Definition: xiname.hxx:82
const sal_uInt16 EXC_ID2_FORMULA
Definition: xltable.hxx:61
A simplified progress bar with only one segment.
const sal_uInt16 EXC_ID_MSODRAWINGGROUP
Definition: xlescher.hxx:260
void ReadCondfmt(XclImpStream &rStrm)
Reads a CONDFMT record and starts a new conditional format to be filled from CF records.
Definition: xicontent.cxx:708
bool IsValid() const
Returns record reading state: false = record overread.
Definition: xistream.hxx:352
void Country()
Definition: impop.cxx:728
void Bof2()
Definition: impop.cxx:424
void Boundsheet()
Definition: impop.cxx:695
aBuf
const sal_uInt16 EXC_ID_SELECTION
Definition: xlview.hxx:35
const sal_uInt16 EXC_ID3_BOOLERR
Definition: xltable.hxx:55
void Colwidth()
Definition: impop.cxx:576
void Feat()
Definition: excimp8.cxx:270
void Row25()
Definition: impop.cxx:394
const sal_uInt16 EXC_ID8_IMGDATA
Definition: xlescher.hxx:243
void Formula25()
Definition: excform.cxx:43
void ReadSxAddl(XclImpStream &rStrm)
Reads an SXADDL record that specifies additional info for pivot table.
Definition: xipivot.cxx:1712
const sal_uInt16 EXC_ID_USERSVIEWEND
Definition: xlconst.hxx:231
void Defrowheight2()
Definition: impop.cxx:593
XclImpObjectManager & GetObjectManager() const
Returns the drawing object manager.
Definition: xiroot.cxx:194
void Formula3()
Definition: excform.cxx:77
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Definition: xlroot.cxx:276
void Scenman()
Definition: excimp8.cxx:218
void Ixfe()
Definition: impop.cxx:630
SCTAB nBdshtTab
Definition: imp_op.hxx:112
Accessor class to ScDocument.
const sal_uInt16 EXC_ID5_BOF
Definition: xlconst.hxx:156
ScfUInt32Vec maSheetOffsets
Definition: imp_op.hxx:93
void CheckScTab(SCTAB nScTab)
Checks if the passed sheet index is valid.
Definition: xladdress.cxx:140
const sal_uInt16 EXC_ID_CODENAME
Definition: xlconst.hxx:234
void CreateScFormats()
Creates the number formats in the Calc document.
Definition: xistyle.cxx:697
const sal_uInt16 EXC_ID_DCONNAME
Definition: xlpivot.hxx:95
const sal_uInt16 EXC_ID2_INTEGER
Definition: xltable.hxx:41
void ReadStyle(XclImpStream &rStrm)
Reads a STYLE record.
Definition: xistyle.cxx:1577
void Olesize()
Definition: impop.cxx:938
SC_DLLPUBLIC void SetVisible(SCTAB nTab, bool bVisible)
Definition: document.cxx:899
const sal_uInt16 EXC_ID_PRINTHEADERS
Left/right footer default margin in 1/100mm.
Definition: xlpage.hxx:59
const XclImpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xiroot.hxx:132
void ReadNumber()
Definition: impop.cxx:297
void DocProtect()
Definition: impop.cxx:609
const sal_uInt16 EXC_ID_VCENTER
Definition: xlpage.hxx:74
bool IsAdjustHeightLocked() const
Definition: document.hxx:1532
void ReadSxvs(XclImpStream &rStrm)
Reads an SXVS record containing the source type of a pivot cache.
Definition: xipivot.cxx:1637
const sal_uInt16 EXC_ID_SCL
Single, top, left, or top-left pane.
Definition: xlview.hxx:79
const sal_uInt16 EXC_ID3_DIMENSIONS
Definition: xltable.hxx:34
const sal_uInt16 EXC_ID_DV
Definition: xlcontent.hxx:103
void Externname25()
Definition: impop.cxx:552
const sal_uInt16 EXC_ID_HEADER
Definition: xlpage.hxx:31
virtual void PostDocLoad() override
Definition: excimp8.cxx:381
XclImpPageSettings & GetPageSettings() const
Returns the page settings of the current sheet.
Definition: xiroot.cxx:248
void ReadObj(XclImpStream &rStrm)
Reads a plain OBJ record (without leading DFF data).
Definition: xiescher.cxx:3942
Provides functions to convert Excel cell addresses to Calc cell addresses.
Definition: xihelper.hxx:42
void Array25()
Definition: impop.cxx:497
void ReadTabid(XclImpStream &rStrm)
Reads the TABID record.
Definition: xilink.cxx:246
void SeekGlobalPosition()
Seeks to the stored global user position.
Definition: xistream.cxx:558
void FilterMode()
Definition: excimp8.cxx:429
void ReadFileSharing()
Definition: impop.cxx:160
ScDocument & rD
Definition: imp_op.hxx:47
XclImpPalette & GetPalette() const
Returns the color buffer.
Definition: xiroot.cxx:141
void ReadDconref(XclImpStream &rStrm)
Reads a DCONREF record containing the source range of a pivot cache.
Definition: xipivot.cxx:1643
MS Excel 4.0.
Definition: xlconst.hxx:35
void ReadExternname(XclImpStream &rStrm, ExcelToSc *pFormulaConv)
Reads an EXTERNNAME record and appends it to the current SUPBOOK.
Definition: xilink.cxx:921
void Calccount()
Definition: excimp8.cxx:157
void SetCodeName(const OUString &r)
Definition: document.hxx:596
void ReadScl(XclImpStream &rStrm)
Reads an SCL record.
Definition: xiview.cxx:181
bool IsTabTruncated() const
Returns whether the "some sheets have been cut" warning box should be shown.
Definition: xladdress.hxx:150
static bool IsFuzzing()
void Rec1904()
Definition: impop.cxx:537
XclImpSst & GetSst() const
Returns the shared string table.
Definition: xiroot.cxx:135
void ReadXct(XclImpStream &rStrm)
Reads an XCT record and appends it to the current SUPBOOK.
Definition: xilink.cxx:911
const sal_uInt16 EXC_ID_PANE
Default zoom for pagebreak preview.
Definition: xlview.hxx:70
void Bof3()
Definition: impop.cxx:978
const sal_uInt16 EXC_ID_WQTABLES
Definition: xlcontent.hxx:183
void SetHasBasic()
Called to indicate that the document contains a VB project.
Definition: xiroot.hxx:207
virtual void PostDocLoad()
Definition: impop.cxx:1232
bool StartNextRecord()
Sets stream pointer to the start of the next record content.
Definition: xistream.cxx:463
XclImpXFBuffer & GetXFBuffer() const
Returns the cell formatting attributes buffer.
Definition: xiroot.cxx:156
std::size_t GetSvStreamSize() const
Returns the stream size.
Definition: xistream.hxx:462
Imports and collects all conditional formatting of a sheet.
Definition: xicontent.hxx:148
void ReadWqtables(XclImpStream &rStrm)
Reads a WEBQRYTABLES record and sets source range list to the current web query.
Definition: xicontent.cxx:1075
const sal_uInt16 EXC_ID_SETUP
Definition: xlpage.hxx:78
void ReadSxex(XclImpStream &rStrm)
Reads an SXEX record containing additional settings for a pivot table.
Definition: xipivot.cxx:1700
const char * sName
void ReadWqsettings(XclImpStream &rStrm)
Reads a WEBQRYSETTINGS record and sets refresh rate to the current web query.
Definition: xicontent.cxx:1069
void ReadLabel()
Definition: impop.cxx:314
void TableOp()
Definition: impop.cxx:1044
const sal_uInt16 EXC_ID3_BLANK
Definition: xltable.hxx:38
const sal_uInt16 EXC_ID_EFONT
Both.
Definition: xlstyle.hxx:196
const sal_uInt16 EXC_ID_DVAL
Font escapement type modified?
Definition: xlcontent.hxx:98
const sal_uInt16 EXC_ID3_NUMBER
Definition: xltable.hxx:45
const sal_uInt16 EXC_ID_AUTOFILTERINFO
Definition: xlconst.hxx:209
const sal_uInt16 EXC_ID_TOPMARGIN
Definition: xlpage.hxx:48
void ReadDConName(XclImpStream &rStrm)
Definition: xipivot.cxx:1649
void ReadSxViewEx9(XclImpStream &rStrm)
Reads an SXVIEWEX9 record that specifies the pivot tables autoformat.
Definition: xipivot.cxx:1706
static const ErrCode & ReadFilepass(XclImpStream &rStrm)
Reads the FILEPASS record, queries a password and sets decryption algorithm.
Definition: xicontent.cxx:1229
MS Excel 5.0, MS Excel 7.0 (95)
Definition: xlconst.hxx:36
const sal_uInt16 EXC_ID_MSODRAWING
Definition: xlescher.hxx:264
bool IsColTruncated() const
Returns whether the "some columns have been cut" warning box should be shown.
Definition: xladdress.hxx:146
void ReadMargin(XclImpStream &rStrm)
Reads a ***MARGIN record (reads all 4 margin records).
Definition: xipage.cxx:89
void ReadNote(XclImpStream &rStrm)
Reads the NOTE record.
Definition: xiescher.cxx:4194
void Window1()
Definition: impop.cxx:389
A buffer containing information about names and creation order of sheets.
Definition: xilink.hxx:61
XclImpTabInfo & GetTabInfo() const
Returns the buffer that contains the sheet creation order.
Definition: xiroot.cxx:178
const sal_uInt16 EXC_ID4_BOF
Definition: xlconst.hxx:155
void Shrfmla()
Definition: impop.cxx:801
void TraceChartOnlySheet()
Definition: xltracer.cxx:106
void Mulblank()
Definition: impop.cxx:881
void CreateUserStyles()
Creates all user defined style sheets.
Definition: xistyle.cxx:1608
std::unique_ptr< ExcelToSc > pFormConv
Visible range if embedded.
Definition: imp_op.hxx:96
void Bof5()
Definition: impop.cxx:1149
const sal_uInt16 EXC_ID_SXVI
Definition: xlpivot.hxx:136
virtual ErrCode Read()
Definition: read.cxx:70
bool IsRowTruncated() const
Returns whether the "some rows have been cut" warning box should be shown.
Definition: xladdress.hxx:148
void Scenario()
Definition: excimp8.cxx:228
void ConvertPivotTables()
Inserts all pivot tables into the Calc document.
Definition: xipivot.cxx:1724
const sal_uInt16 EXC_ID_VERPAGEBREAKS
Definition: xlpage.hxx:41
const sal_uInt16 EXC_ID_HCENTER
Definition: xlpage.hxx:73
void Eof()
Definition: impop.cxx:439
XclImpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xiroot.cxx:119
void ReadSst(XclImpStream &rStrm)
Reads the entire SST record.
Definition: xicontent.cxx:73
Contains all page (print) settings for a single sheet.
Definition: xipage.hxx:30
Stores all user defined number formats occurred in the file.
Definition: xistyle.hxx:205
#define sal_True
const sal_uInt16 EXC_ID_USESELFS
Definition: xlconst.hxx:224
bool bTabTruncated
Definition: imp_op.hxx:114
void Hideobj()
Definition: impop.cxx:755
void AutoFilter()
Definition: excimp8.cxx:454
void ReadTabBgColor(XclImpStream &rStrm, const XclImpPalette &rPal)
Reads a SHEETEXT record (Tab Color).
Definition: xiview.cxx:101
MS Excel 3.0.
Definition: xlconst.hxx:34
const sal_uInt16 EXC_ID_OBJ
Definition: xlescher.hxx:45
static void ReadDval(XclImpStream &rStrm)
Reads a DVAL record and sets marks the dropdown arrow control to be ignored.
Definition: xicontent.cxx:739
const sal_uInt16 EXC_ID_STYLE
Font auto color (system window text color).
Definition: xlstyle.hxx:220
void ReadSelection(XclImpStream &rStrm)
Reads a SELECTION record.
Definition: xiview.cxx:200
void ReadHeaderFooter(XclImpStream &rStrm)
Reads a HEADER or FOOTER record.
Definition: xipage.cxx:113
const sal_uInt16 EXC_ID4_FORMULA
Definition: xltable.hxx:63
void ReadCF(XclImpStream &rStrm)
Reads a CF record and inserts the formatting data to the current conditional format.
Definition: xicontent.cxx:715
static void SkipSubStream(XclImpStream &rStrm)
Skips a substream (BOF/EOF record block).
Definition: xltools.cxx:686
void ReadWqstring(XclImpStream &rStrm)
Reads a WQSTRING record and sets URL to the current web query.
Definition: xicontent.cxx:1063
void Rstring()
Definition: impop.cxx:898
void ReadEfont(XclImpStream &rStrm)
Reads an EFONT record (BIFF2 font color).
Definition: xistyle.cxx:587
XclImpNameManager & GetNameManager() const
Returns the buffer that contains internal defined names.
Definition: xiroot.cxx:183
const sal_uInt16 EXC_ID_SXIDSTM
Definition: xlpivot.hxx:273
void ReadSxvdex(XclImpStream &rStrm)
Reads an SXVDEX record describing extended options of a field.
Definition: xipivot.cxx:1670
void ReadPalette(XclImpStream &rStrm)
Reads a PALETTE record.
Definition: xistyle.cxx:165
void ReadTabChart(XclImpStream &rStrm)
Inserts a new chart object and reads the chart substream (BOF/EOF block).
Definition: xiescher.cxx:4212
const sal_uInt16 EXC_ID_DCONREF
Definition: xlpivot.hxx:94
const sal_uInt16 EXC_ID4_FORMAT
Definition: xlstyle.hxx:66
XclTracer & GetTracer() const
Returns the filter tracer.
Definition: xlroot.cxx:424
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
Definition: xlroot.hxx:161
void Labelsst()
Definition: excimp8.cxx:233
const sal_uInt16 EXC_ID_WINDOW2
Definition: xlview.hxx:50
void Defrowheight345()
Definition: impop.cxx:1029
void ReadBlank()
Definition: impop.cxx:266
SC_DLLPUBLIC void CalcAfterLoad(bool bStartListening=true)
Definition: document.cxx:4024
const sal_uInt16 EXC_ID_SST
Definition: xlcontent.hxx:45
const sal_uInt16 EXC_ID_BOTTOMMARGIN
Definition: xlpage.hxx:49
Imports validation data.
Definition: xicontent.hxx:169
void ReadPrintHeaders(XclImpStream &rStrm)
Reads a PRINTHEADERS record.
Definition: xipage.cxx:164
XclImpSheetDrawing & GetCurrSheetDrawing() const
Returns the drawing container of the current sheet.
Definition: xiroot.cxx:199
const sal_uInt16 EXC_ID_SXDI
Definition: xlpivot.hxx:176
const sal_uInt16 EXC_ID_FOOTER
Definition: xlpage.hxx:32
void Precision()
Definition: excimp8.cxx:164
const sal_uInt16 EXC_ID_SXVD
Definition: xlpivot.hxx:109
void NewTable()
Definition: impop.cxx:1190
void ReadImgData(XclImpStream &rStrm)
Reads an IMGDATA record and creates the SvxBrushItem.
Definition: xipage.cxx:174
XclImpLinkManager & GetLinkManager() const
Returns the link manager.
Definition: xiroot.cxx:188
const sal_uInt16 EXC_ID_SXVIEW
Definition: xlpivot.hxx:99
const sal_uInt16 EXC_ID_USERSVIEWBEGIN
Definition: xlconst.hxx:230
XclImpWebQueryBuffer & GetWebQueryBuffer() const
Returns the web query buffer.
Definition: xiroot.cxx:224
const sal_uInt16 EXC_ID2_BLANK
Definition: xltable.hxx:37
void ReadFormat(XclImpStream &rStrm)
Reads a FORMAT record.
Definition: xistyle.cxx:641
const sal_uInt16 EXC_ID_PALETTE
Definition: xlstyle.hxx:200
void Cellmerging()
Definition: impop.cxx:921
void ReadSxview(XclImpStream &rStrm)
Reads an SXVIEW record describing a new pivot table.
Definition: xipivot.cxx:1657
void Delta()
Definition: excimp8.cxx:171
void ReadFont(XclImpStream &rStrm)
Reads a FONT record.
Definition: xistyle.cxx:575
void Formula4()
Definition: excform.cxx:82
void ReadMsoDrawingGroup(XclImpStream &rStrm)
Reads the MSODRAWINGGROUP record.
Definition: xiescher.cxx:4326
void ReadSupbook(XclImpStream &rStrm)
Reads a SUPBOOK record.
Definition: xilink.cxx:906
#define ERRCODE_NONE
void WinProtection()
Definition: impop.cxx:463
const sal_uInt16 EXC_ID_HORPAGEBREAKS
Definition: xlpage.hxx:42
const sal_uInt16 EXC_ID_FILESHARING
Definition: xlcontent.hxx:29
#define SCWARN_IMPORT_SHEET_OVERFLOW
Definition: scerrors.hxx:65
void IncCurrScTab()
Increases the current Calc sheet index by 1.
Definition: xlroot.hxx:261
const sal_uInt16 EXC_ID2_BOOLERR
Definition: xltable.hxx:54
void Mulrk()
Definition: impop.cxx:859
#define SCWARN_IMPORT_ROW_OVERFLOW
Definition: scerrors.hxx:63
const sal_uInt16 EXC_ID_QSI
All tables.
Definition: xlcontent.hxx:167
void Array34()
Definition: impop.cxx:996
void FeatHdr()
Definition: excimp8.cxx:253
const sal_uInt16 EXC_ID_PRINTGRIDLINES
Definition: xlpage.hxx:60
XclImpFontBuffer & GetFontBuffer() const
Returns the font buffer.
Definition: xiroot.cxx:146
The main class for pivot table import.
Definition: xipivot.hxx:372
STATE
Stores the data of all fonts occurred in an Excel file.
Definition: xistyle.hxx:153
const sal_uInt16 EXC_ID_RK
Definition: xltable.hxx:163
void ReadPrintGridLines(XclImpStream &rStrm)
Reads a PRINTGRIDLINES record.
Definition: xipage.cxx:169
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
Definition: xlroot.hxx:141
const sal_uInt16 EXC_ID_SXEX
Definition: xlpivot.hxx:310
const sal_uInt16 EXC_ID_HLINK
Definition: xlcontent.hxx:142
void ReadSxivd(XclImpStream &rStrm)
Reads an SXIVD record containing the row field or column field order.
Definition: xipivot.cxx:1676
#define SCWARN_IMPORT_COLUMN_OVERFLOW
Definition: scerrors.hxx:64
void ReadPane(XclImpStream &rStrm)
Reads a PANE record.
Definition: xiview.cxx:191
void Colinfo()
Definition: impop.cxx:654
const sal_uInt16 EXC_ID3_ARRAY
Definition: xltable.hxx:102
const sal_uInt16 EXC_ID2_FONT
Definition: xlstyle.hxx:74
const ScAddress & GetScMaxPos() const
Returns the highest possible cell address in a Calc document.
Definition: xlroot.hxx:243
The SST (shared string table) contains all strings used in a BIFF8 file.
Definition: xicontent.hxx:56
void Bof4()
Definition: impop.cxx:1132
const sal_uInt16 EXC_ID_AUTOFILTER
Definition: xlconst.hxx:212
Stores the default colors for the current BIFF version and the contents of a PALETTE record...
Definition: xistyle.hxx:45
void StoreGlobalPosition()
Stores current position.
Definition: xistream.cxx:550
const sal_uInt16 EXC_ID_SXADDL
Definition: xlpivot.hxx:362
#define ERRCODE_ABORT
void ReadInteger()
Definition: impop.cxx:280
const sal_uInt16 EXC_ID_WQSTRING
Definition: xlcontent.hxx:156
#define SAL_WARN(area, stream)
void Iteration()
Definition: excimp8.cxx:178
XclImpCondFormatManager & GetCondFormatManager() const
Returns the conditional formatting manager.
Definition: xiroot.cxx:205
const sal_uInt16 EXC_ID3_BOF
Definition: xlconst.hxx:154
const OUString & GetCodeName() const
Definition: document.hxx:595
void Codepage()
Definition: impop.cxx:625
const sal_uInt16 EXC_ID5_XF
Definition: xlstyle.hxx:135
const sal_uInt16 EXC_ID_SHRFMLA
Definition: xltable.hxx:166
SfxObjectShell * GetDocShell() const
Returns the object shell of the Calc document.
Definition: xlroot.cxx:281
void SheetPassword()
Definition: impop.cxx:446
const sal_uInt16 EXC_ID_CF
Definition: xlcontent.hxx:55
MS Excel 2.1.
Definition: xlconst.hxx:33
void Wsbool()
Definition: impop.cxx:684
This class is used to import record oriented streams.
Definition: xistream.hxx:278
sal_uInt16 mnLastRecId
Current XF identifier from IXFE record.
Definition: imp_op.hxx:110
XclImpStream & aIn
Definition: imp_op.hxx:91
const sal_uInt16 EXC_ID_SXVDEX
Definition: xlpivot.hxx:331
void ReadSxvd(XclImpStream &rStrm)
Reads an SXVD record describing a new field.
Definition: xipivot.cxx:1664
BiffTyp eDateiTyp
Definition: root.hxx:48
const sal_uInt16 EXC_ID2_ARRAY
Definition: xltable.hxx:101
void ReadPivotCaches(const XclImpStream &rStrm)
Reads all used pivot caches and creates additional sheets for external data sources.
Definition: xipivot.cxx:1718
void Boundsheet()
Definition: excimp8.cxx:185
const sal_uInt16 EXC_ID_RIGHTMARGIN
Definition: xlpage.hxx:47
void ReadSetup(XclImpStream &rStrm)
Reads a SETUP record and inserts contained data.
Definition: xipage.cxx:53
std::size_t GetSvStreamPos() const
Returns the absolute stream position.
Definition: xistream.hxx:460
const sal_uInt16 EXC_ID2_BOF
Text rotation: vertically stacked.
Definition: xlconst.hxx:153
const sal_uInt16 EXC_ID_SXVIEWEX9
Definition: xlpivot.hxx:359
void ReadSxdi(XclImpStream &rStrm)
Reads an SXDI record containing data field data.
Definition: xipivot.cxx:1688
void ReadBoolErr()
Definition: impop.cxx:344
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:211
const sal_uInt16 EXC_ID_SHEETEXT
Definition: xlview.hxx:83
void ReadParamqry(XclImpStream &rStrm)
Reads a PARAMQRY record and sets data to the current web query.
Definition: xicontent.cxx:1057
sal_uInt16 PeekRecId(std::size_t nPos)
Definition: xistream.cxx:611
const sal_uInt16 EXC_ID_LEFTMARGIN
Definition: xlpage.hxx:46
void ReadDimensions()
Definition: impop.cxx:223
void ReadMsoDrawing(XclImpStream &rStrm)
Reads the MSODRAWING or MSODRAWINGSELECTION record.
Definition: xiescher.cxx:3975
sal_Int16 SCTAB
Definition: types.hxx:23
void DefColWidth()
Definition: impop.cxx:635
static void ReadLabelranges(XclImpStream &rStrm)
Reads a LABELRANGES record and inserts the label ranges into the document.
Definition: xicontent.cxx:431
void ReadRk()
Definition: impop.cxx:372
This is the central class for the import of all internal/external links.
Definition: xilink.hxx:184
void ReadCrn(XclImpStream &rStrm)
Reads a CRN record and appends it to the current SUPBOOK.
Definition: xilink.cxx:916
const sal_uInt16 EXC_ID3_LABEL
Definition: xltable.hxx:49
#define ERRCODE_IO_CANTREAD
const sal_uInt16 EXC_ID2_NUMBER
Definition: xltable.hxx:44
const sal_uInt16 EXC_ID_EOF
Internal use only.
Definition: xlconst.hxx:173