1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: read.cxx,v $
10 * $Revision: 1.70.88.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
36 //------------------------------------------------------------------------
41 #include "document.hxx"
42 #include "scerrors.hxx"
43 #include "fprogressbar.hxx"
44 #include "xltracer.hxx"
45 #include "xltable.hxx"
46 #include "xihelper.hxx"
51 #include "xicontent.hxx"
52 #include "xiescher.hxx"
53 #include "xipivot.hxx"
54 #include "XclImpChangeTrack.hxx"
58 #include "excimp8.hxx"
60 FltError
ImportExcel::Read( void )
62 XclImpPageSettings
& rPageSett
= GetPageSettings();
63 XclImpTabViewSettings
& rTabViewSett
= GetTabViewSettings();
64 XclImpPalette
& rPal
= GetPalette();
65 XclImpFontBuffer
& rFontBfr
= GetFontBuffer();
66 XclImpNumFmtBuffer
& rNumFmtBfr
= GetNumFmtBuffer();
67 XclImpXFBuffer
& rXFBfr
= GetXFBuffer();
68 XclImpNameManager
& rNameMgr
= GetNameManager();
69 XclImpObjectManager
& rObjMgr
= GetObjectManager();
72 Z_BiffNull
, // Nicht in gueltigem Biff-Format
73 Z_Biff2
, // Biff2: nur eine Tabelle
75 Z_Biff3
, // Biff3: nur eine Tabelle
77 Z_Biff4
, // Biff4: nur eine Tabelle
78 Z_Biff4W
, // Biff4 Workbook: Globals
79 Z_Biff4T
, // Biff4 Workbook: eine Tabelle selbst
80 Z_Biff4E
, // Biff4 Workbook: zwischen den Tabellen
82 Z_Biff5WPre
,// Biff5: Prefetch Workbook
83 Z_Biff5W
, // Biff5: Globals
84 Z_Biff5TPre
,// Biff5: Prefetch fuer Shrfmla/Array Formula
85 Z_Biff5T
, // Biff5: eine Tabelle selbst
86 Z_Biff5E
, // Biff5: zwischen den Tabellen
87 Z_Biffn0
, // Alle Biffs: Tabelle bis naechstesss EOF ueberlesen
90 Zustand eAkt
= Z_BiffNull
, ePrev
= Z_BiffNull
;
92 FltError eLastErr
= eERR_OK
;
95 BOOL bBiff4Workbook
= FALSE
;
97 DBG_ASSERT( &aIn
!= NULL
, "-ImportExcel::Read(): Kein Stream - wie dass?!" );
99 ::std::auto_ptr
< ScfSimpleProgressBar
> pProgress( new ScfSimpleProgressBar(
100 aIn
.GetSvStreamSize(), GetDocShell(), STR_LOAD_DOC
) );
102 /* #i104057# Need to track a base position for progress bar calculation,
103 because sheet substreams may not be in order of sheets. */
104 sal_Size nProgressBasePos
= 0;
105 sal_Size nProgressBaseSize
= 0;
107 while( eAkt
!= Z_Ende
)
109 if( eAkt
== Z_Biff5E
)
111 sal_uInt16 nScTab
= GetCurrScTab();
112 if( nScTab
< maSheetOffsets
.size() )
114 nProgressBaseSize
+= (aIn
.GetSvStreamPos() - nProgressBasePos
);
115 nProgressBasePos
= maSheetOffsets
[ nScTab
];
116 aIn
.StartNextRecord( nProgressBasePos
);
122 aIn
.StartNextRecord();
124 nOpcode
= aIn
.GetRecId();
128 // #124240# finalize table if EOF is missing
137 rNumFmtBfr
.CreateScFormats();
149 if( eAkt
!= Z_Biff5TPre
&& eAkt
!= Z_Biff5WPre
)
150 pProgress
->ProgressAbs( nProgressBaseSize
+ aIn
.GetSvStreamPos() - nProgressBasePos
);
154 // ----------------------------------------------------------------
155 case Z_BiffNull
: // ------------------------------- Z_BiffNull -
164 // #i23425# don't rely on the record ID, but on the detected BIFF version
169 if( pExcRoot
->eDateiTyp
== Biff2
)
177 if( pExcRoot
->eDateiTyp
== Biff3
)
185 if( pExcRoot
->eDateiTyp
== Biff4
)
190 else if( pExcRoot
->eDateiTyp
== Biff4W
)
193 bBiff4Workbook
= TRUE
;
198 if( pExcRoot
->eDateiTyp
== Biff5W
)
204 aIn
.StoreGlobalPosition(); // und Position merken
206 else if( pExcRoot
->eDateiTyp
== Biff5
)
208 // #i62752# possible to have BIFF5 sheet without globals
210 eAkt
= Z_Biff5TPre
; // Shrfmla Prefetch, Row-Prefetch
212 aIn
.StoreGlobalPosition(); // und Position merken
223 // ----------------------------------------------------------------
224 case Z_Biff2
: // ---------------------------------- Z_Biff2 -
228 case EXC_ID2_DIMENSIONS
:
229 case EXC_ID3_DIMENSIONS
: ReadDimensions(); break;
231 case EXC_ID3_BLANK
: ReadBlank(); break;
232 case EXC_ID2_INTEGER
: ReadInteger(); break;
234 case EXC_ID3_NUMBER
: ReadNumber(); break;
236 case EXC_ID3_LABEL
: ReadLabel(); break;
237 case EXC_ID2_BOOLERR
:
238 case EXC_ID3_BOOLERR
: ReadBoolErr(); break;
239 case EXC_ID_RK
: ReadRk(); break;
241 case 0x06: Formula25(); break; // FORMULA [ 2 5]
242 case 0x08: Row25(); break; // ROW [ 2 5]
243 case 0x0A: // EOF [ 2345]
244 rNumFmtBfr
.CreateScFormats();
249 case 0x15: rPageSett
.ReadHeaderFooter( maStrm
); break;
250 case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
251 case 0x18: rNameMgr
.ReadName( maStrm
); break;
252 case 0x1C: rObjMgr
.ReadNote( maStrm
); break;
253 case 0x1D: rTabViewSett
.ReadSelection( maStrm
); break;
254 case 0x1E: rNumFmtBfr
.ReadFormat( maStrm
); break;
255 case 0x20: Columndefault(); break; // COLUMNDEFAULT[ 2 ]
256 case 0x21: Array25(); break; // ARRAY [ 2 5]
257 case 0x23: Externname25(); break; // EXTERNNAME [ 2 5]
258 case 0x24: Colwidth(); break; // COLWIDTH [ 2 ]
259 case 0x25: Defrowheight2(); break; // DEFAULTROWHEI[ 2 ]
263 case 0x29: rPageSett
.ReadMargin( maStrm
); break;
264 case 0x2A: rPageSett
.ReadPrintHeaders( maStrm
); break;
265 case 0x2B: rPageSett
.ReadPrintGridLines( maStrm
); break;
266 case 0x2F: // FILEPASS [ 2345]
267 eLastErr
= XclImpDecryptHelper::ReadFilepass( maStrm
);
268 if( eLastErr
!= ERRCODE_NONE
)
271 case EXC_ID2_FONT
: rFontBfr
.ReadFont( maStrm
); break;
272 case EXC_ID_EFONT
: rFontBfr
.ReadEfont( maStrm
); break;
273 case 0x3E: rTabViewSett
.ReadWindow2( maStrm
, false );break;
274 case 0x41: rTabViewSett
.ReadPane( maStrm
); break;
275 case 0x42: Codepage(); break; // CODEPAGE [ 2345]
276 case 0x43: rXFBfr
.ReadXF( maStrm
); break;
277 case 0x44: Ixfe(); break; // IXFE [ 2 ]
281 // ----------------------------------------------------------------
282 case Z_Biff3
: // ---------------------------------- Z_Biff3 -
286 // skip chart substream
290 case EXC_ID5_BOF
: XclTools::SkipSubStream( maStrm
); break;
292 case EXC_ID2_DIMENSIONS
:
293 case EXC_ID3_DIMENSIONS
: ReadDimensions(); break;
295 case EXC_ID3_BLANK
: ReadBlank(); break;
296 case EXC_ID2_INTEGER
: ReadInteger(); break;
298 case EXC_ID3_NUMBER
: ReadNumber(); break;
300 case EXC_ID3_LABEL
: ReadLabel(); break;
301 case EXC_ID2_BOOLERR
:
302 case EXC_ID3_BOOLERR
: ReadBoolErr(); break;
303 case EXC_ID_RK
: ReadRk(); break;
305 case 0x0A: // EOF [ 2345]
306 rNumFmtBfr
.CreateScFormats();
311 case 0x15: rPageSett
.ReadHeaderFooter( maStrm
); break;
312 case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
314 case 0x1B: rPageSett
.ReadPageBreaks( maStrm
); break;
315 case 0x1C: rObjMgr
.ReadNote( maStrm
); break;
316 case 0x1D: rTabViewSett
.ReadSelection( maStrm
); break;
317 case 0x1E: rNumFmtBfr
.ReadFormat( maStrm
); break;
318 case 0x22: Rec1904(); break; // 1904 [ 2345]
322 case 0x29: rPageSett
.ReadMargin( maStrm
); break;
323 case 0x2A: rPageSett
.ReadPrintHeaders( maStrm
); break;
324 case 0x2B: rPageSett
.ReadPrintGridLines( maStrm
); break;
325 case 0x2F: // FILEPASS [ 2345]
326 eLastErr
= XclImpDecryptHelper::ReadFilepass( maStrm
);
327 if( eLastErr
!= ERRCODE_NONE
)
330 case EXC_ID_FILESHARING
: ReadFileSharing(); break;
331 case 0x41: rTabViewSett
.ReadPane( maStrm
); break;
332 case 0x42: Codepage(); break; // CODEPAGE [ 2345]
333 case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
334 case 0x5D: rObjMgr
.ReadObj( maStrm
); break;
335 case 0x7D: Colinfo(); break; // COLINFO [ 345]
336 case 0x8C: Country(); break; // COUNTRY [ 345]
337 case 0x92: rPal
.ReadPalette( maStrm
); break;
338 case 0x0206: Formula3(); break; // FORMULA [ 3 ]
339 case 0x0208: Row34(); break; // ROW [ 34 ]
340 case 0x0218: rNameMgr
.ReadName( maStrm
); break;
341 case 0x0221: Array34(); break; // ARRAY [ 34 ]
342 case 0x0223: Externname34(); break; // EXTERNNAME [ 34 ]
343 case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
344 case 0x0231: rFontBfr
.ReadFont( maStrm
); break;
345 case 0x023E: rTabViewSett
.ReadWindow2( maStrm
, false );break;
346 case 0x0243: rXFBfr
.ReadXF( maStrm
); break;
347 case 0x0293: rXFBfr
.ReadStyle( maStrm
); break;
351 // ----------------------------------------------------------------
352 case Z_Biff4
: // ---------------------------------- Z_Biff4 -
356 // skip chart substream
360 case EXC_ID5_BOF
: XclTools::SkipSubStream( maStrm
); break;
362 case EXC_ID2_DIMENSIONS
:
363 case EXC_ID3_DIMENSIONS
: ReadDimensions(); break;
365 case EXC_ID3_BLANK
: ReadBlank(); break;
366 case EXC_ID2_INTEGER
: ReadInteger(); break;
368 case EXC_ID3_NUMBER
: ReadNumber(); break;
370 case EXC_ID3_LABEL
: ReadLabel(); break;
371 case EXC_ID2_BOOLERR
:
372 case EXC_ID3_BOOLERR
: ReadBoolErr(); break;
373 case EXC_ID_RK
: ReadRk(); break;
375 case 0x0A: // EOF [ 2345]
376 rNumFmtBfr
.CreateScFormats();
380 case 0x12: SheetProtect(); break; // SHEET PROTECTION
382 case 0x15: rPageSett
.ReadHeaderFooter( maStrm
); break;
383 case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
385 case 0x1B: rPageSett
.ReadPageBreaks( maStrm
); break;
386 case 0x1C: rObjMgr
.ReadNote( maStrm
); break;
387 case 0x1D: rTabViewSett
.ReadSelection( maStrm
); break;
388 case 0x22: Rec1904(); break; // 1904 [ 2345]
392 case 0x29: rPageSett
.ReadMargin( maStrm
); break;
393 case 0x2A: rPageSett
.ReadPrintHeaders( maStrm
); break;
394 case 0x2B: rPageSett
.ReadPrintGridLines( maStrm
); break;
395 case 0x2F: // FILEPASS [ 2345]
396 eLastErr
= XclImpDecryptHelper::ReadFilepass( maStrm
);
397 if( eLastErr
!= ERRCODE_NONE
)
400 case EXC_ID_FILESHARING
: ReadFileSharing(); break;
401 case 0x41: rTabViewSett
.ReadPane( maStrm
); break;
402 case 0x42: Codepage(); break; // CODEPAGE [ 2345]
403 case 0x55: DefColWidth(); break;
404 case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
405 case 0x5D: rObjMgr
.ReadObj( maStrm
); break;
406 case 0x7D: Colinfo(); break; // COLINFO [ 345]
407 case 0x8C: Country(); break; // COUNTRY [ 345]
408 case 0x92: rPal
.ReadPalette( maStrm
); break;
409 case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45]
410 case 0xA1: rPageSett
.ReadSetup( maStrm
); break;
411 case 0x0208: Row34(); break; // ROW [ 34 ]
412 case 0x0218: rNameMgr
.ReadName( maStrm
); break;
413 case 0x0221: Array34(); break; // ARRAY [ 34 ]
414 case 0x0223: Externname34(); break; // EXTERNNAME [ 34 ]
415 case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
416 case 0x0231: rFontBfr
.ReadFont( maStrm
); break;
417 case 0x023E: rTabViewSett
.ReadWindow2( maStrm
, false );break;
418 case 0x0406: Formula4(); break; // FORMULA [ 4 ]
419 case 0x041E: rNumFmtBfr
.ReadFormat( maStrm
); break;
420 case 0x0443: rXFBfr
.ReadXF( maStrm
); break;
421 case 0x0293: rXFBfr
.ReadStyle( maStrm
); break;
425 // ----------------------------------------------------------------
426 case Z_Biff4W
: // --------------------------------- Z_Biff4W -
430 case 0x0A: // EOF [ 2345]
433 case 0x12: DocProtect(); break; // PROTECT [ 5]
434 case 0x2F: // FILEPASS [ 2345]
435 eLastErr
= XclImpDecryptHelper::ReadFilepass( maStrm
);
436 if( eLastErr
!= ERRCODE_NONE
)
439 case EXC_ID_FILESHARING
: ReadFileSharing(); break;
440 case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
441 case 0x42: Codepage(); break; // CODEPAGE [ 2345]
442 case 0x55: DefColWidth(); break;
443 case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
444 case 0x8C: Country(); break; // COUNTRY [ 345]
445 case 0x8F: Bundleheader(); break; // BUNDLEHEADER [ 4 ]
446 case 0x92: rPal
.ReadPalette( maStrm
); break;
447 case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45]
448 case 0x0218: rNameMgr
.ReadName( maStrm
); break;
449 case 0x0223: Externname34(); break; // EXTERNNAME [ 34 ]
450 case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
451 case 0x0231: rFontBfr
.ReadFont( maStrm
); break;
452 case 0x0409: // BOF [ 4 ]
454 if( pExcRoot
->eDateiTyp
== Biff4
)
462 case 0x041E: rNumFmtBfr
.ReadFormat( maStrm
); break;
463 case 0x0443: rXFBfr
.ReadXF( maStrm
); break;
464 case 0x0293: rXFBfr
.ReadStyle( maStrm
); break;
469 // ----------------------------------------------------------------
470 case Z_Biff4T
: // --------------------------------- Z_Biff4T -
474 // skip chart substream
478 case EXC_ID5_BOF
: XclTools::SkipSubStream( maStrm
); break;
480 case EXC_ID2_DIMENSIONS
:
481 case EXC_ID3_DIMENSIONS
: ReadDimensions(); break;
483 case EXC_ID3_BLANK
: ReadBlank(); break;
484 case EXC_ID2_INTEGER
: ReadInteger(); break;
486 case EXC_ID3_NUMBER
: ReadNumber(); break;
488 case EXC_ID3_LABEL
: ReadLabel(); break;
489 case EXC_ID2_BOOLERR
:
490 case EXC_ID3_BOOLERR
: ReadBoolErr(); break;
491 case EXC_ID_RK
: ReadRk(); break;
493 case 0x0A: // EOF [ 2345]
497 case 0x12: SheetProtect(); break; // SHEET PROTECTION
499 case 0x15: rPageSett
.ReadHeaderFooter( maStrm
); break;
501 case 0x1B: rPageSett
.ReadPageBreaks( maStrm
); break;
502 case 0x1C: rObjMgr
.ReadNote( maStrm
); break;
503 case 0x1D: rTabViewSett
.ReadSelection( maStrm
); break;
504 case 0x2F: // FILEPASS [ 2345]
505 eLastErr
= XclImpDecryptHelper::ReadFilepass( maStrm
);
506 if( eLastErr
!= ERRCODE_NONE
)
509 case 0x41: rTabViewSett
.ReadPane( maStrm
); break;
510 case 0x42: Codepage(); break; // CODEPAGE [ 2345]
511 case 0x55: DefColWidth(); break;
512 case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
513 case 0x5D: rObjMgr
.ReadObj( maStrm
); break;
514 case 0x7D: Colinfo(); break; // COLINFO [ 345]
515 case 0x8C: Country(); break; // COUNTRY [ 345]
516 case 0x8F: Bundleheader(); break; // BUNDLEHEADER [ 4 ]
517 case 0x92: rPal
.ReadPalette( maStrm
); break;
518 case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45]
519 case 0xA1: rPageSett
.ReadSetup( maStrm
); break;
520 case 0x0208: Row34(); break; // ROW [ 34 ]
521 case 0x0218: rNameMgr
.ReadName( maStrm
); break;
522 case 0x0221: Array34(); break;
523 case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
524 case 0x0231: rFontBfr
.ReadFont( maStrm
); break;
525 case 0x023E: rTabViewSett
.ReadWindow2( maStrm
, false );break;
526 case 0x0406: Formula4(); break;
527 case 0x041E: rNumFmtBfr
.ReadFormat( maStrm
); break;
528 case 0x0443: rXFBfr
.ReadXF( maStrm
); break;
529 case 0x0293: rXFBfr
.ReadStyle( maStrm
); break;
534 // ----------------------------------------------------------------
535 case Z_Biff4E
: // --------------------------------- Z_Biff4E -
539 case 0x0A: // EOF [ 2345]
542 case 0x8F: break; // BUNDLEHEADER [ 4 ]
543 case 0x0409: // BOF [ 4 ]
546 if( pExcRoot
->eDateiTyp
== Biff4
)
560 case Z_Biff5WPre
: // ------------------------------ Z_Biff5WPre -
564 case 0x0A: // EOF [ 2345]
566 aIn
.SeekGlobalPosition(); // und zurueck an alte Position
568 case 0x12: DocProtect(); break; // PROTECT [ 5]
569 case 0x2F: // FILEPASS [ 2345]
570 eLastErr
= XclImpDecryptHelper::ReadFilepass( maStrm
);
571 if( eLastErr
!= ERRCODE_NONE
)
574 case EXC_ID_FILESHARING
: ReadFileSharing(); break;
575 case 0x3D: Window1(); break;
576 case 0x42: Codepage(); break; // CODEPAGE [ 2345]
577 case 0x85: Boundsheet(); break; // BOUNDSHEET [ 5]
578 case 0x8C: Country(); break; // COUNTRY [ 345]
579 // PALETTE follows XFs, but already needed while reading the XFs
580 case 0x92: rPal
.ReadPalette( maStrm
); break;
584 case Z_Biff5W
: // --------------------------------- Z_Biff5W -
588 case 0x0A: // EOF [ 2345]
589 rNumFmtBfr
.CreateScFormats();
590 rXFBfr
.CreateUserStyles();
593 case 0x18: rNameMgr
.ReadName( maStrm
); break;
594 case 0x1E: rNumFmtBfr
.ReadFormat( maStrm
); break;
595 case 0x22: Rec1904(); break; // 1904 [ 2345]
596 case 0x31: rFontBfr
.ReadFont( maStrm
); break;
597 case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
598 case 0x8D: Hideobj(); break; // HIDEOBJ [ 345]
599 case 0xDE: Olesize(); break;
600 case 0xE0: rXFBfr
.ReadXF( maStrm
); break;
601 case 0x0293: rXFBfr
.ReadStyle( maStrm
); break;
602 case 0x041E: rNumFmtBfr
.ReadFormat( maStrm
); break;
607 // ----------------------------------------------------------------
608 case Z_Biff5TPre
: // ------------------------------- Z_Biff5Pre -
610 if( nOpcode
== 0x0809 )
612 else if( (nOpcode
== 0x000A) && nBofLevel
)
614 else if( !nBofLevel
) // don't read chart records
618 case EXC_ID2_DIMENSIONS
:
619 case EXC_ID3_DIMENSIONS
: ReadDimensions(); break;
620 case 0x08: Row25(); break; // ROW [ 2 5]
621 case 0x0A: // EOF [ 2345]
623 aIn
.SeekGlobalPosition(); // und zurueck an alte Position
625 case 0x12: SheetProtect(); break; // SHEET PROTECTION
627 case 0x1B: rPageSett
.ReadPageBreaks( maStrm
); break;
628 case 0x1D: rTabViewSett
.ReadSelection( maStrm
); break;
629 case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
630 case 0x21: Array25(); break; // ARRAY [ 2 5]
631 case 0x23: Externname25(); break; // EXTERNNAME [ 2 5]
632 case 0x41: rTabViewSett
.ReadPane( maStrm
); break;
633 case 0x42: Codepage(); break; // CODEPAGE [ 2345]
634 case 0x55: DefColWidth(); break;
635 case 0x7D: Colinfo(); break; // COLINFO [ 345]
636 case 0x81: Wsbool(); break; // WSBOOL [ 2345]
637 case 0x8C: Country(); break; // COUNTRY [ 345]
638 case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45]
639 case 0x0208: Row34(); break; // ROW [ 34 ]
640 case 0x0221: Array34(); break; // ARRAY [ 34 ]
641 case 0x0223: Externname34(); break; // EXTERNNAME [ 34 ]
642 case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345]
643 case 0x023E: rTabViewSett
.ReadWindow2( maStrm
, false );break;
644 case 0x04BC: Shrfmla(); break; // SHRFMLA [ 5]
649 // ----------------------------------------------------------------
650 case Z_Biff5T
: // --------------------------------- Z_Biff5T -
655 case EXC_ID3_BLANK
: ReadBlank(); break;
656 case EXC_ID2_INTEGER
: ReadInteger(); break;
658 case EXC_ID3_NUMBER
: ReadNumber(); break;
660 case EXC_ID3_LABEL
: ReadLabel(); break;
661 case EXC_ID2_BOOLERR
:
662 case EXC_ID3_BOOLERR
: ReadBoolErr(); break;
663 case EXC_ID_RK
: ReadRk(); break;
667 case 0x0406: Formula25(); break;
668 case 0x0A: Eof(); eAkt
= Z_Biff5E
; break;
670 case 0x15: rPageSett
.ReadHeaderFooter( maStrm
); break;
671 case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
672 case 0x1C: rObjMgr
.ReadNote( maStrm
); break;
673 case 0x1D: rTabViewSett
.ReadSelection( maStrm
); break;
674 case 0x23: Externname25(); break; // EXTERNNAME [ 2 5]
678 case 0x29: rPageSett
.ReadMargin( maStrm
); break;
679 case 0x2A: rPageSett
.ReadPrintHeaders( maStrm
); break;
680 case 0x2B: rPageSett
.ReadPrintGridLines( maStrm
); break;
681 case 0x2F: // FILEPASS [ 2345]
682 eLastErr
= XclImpDecryptHelper::ReadFilepass( maStrm
);
683 if( eLastErr
!= ERRCODE_NONE
)
686 case 0x5D: rObjMgr
.ReadObj( maStrm
); break;
688 case 0x84: rPageSett
.ReadCenter( maStrm
); break;
689 case 0xA0: rTabViewSett
.ReadScl( maStrm
); break;
690 case 0xA1: rPageSett
.ReadSetup( maStrm
); break;
691 case 0xBD: Mulrk(); break; // MULRK [ 5]
692 case 0xBE: Mulblank(); break; // MULBLANK [ 5]
693 case 0xD6: Rstring(); break; // RSTRING [ 5]
694 case 0x00E5: Cellmerging(); break; // #i62300#
695 case 0x0236: TableOp(); break; // TABLE [ 5]
696 case 0x0809: // BOF [ 5]
697 XclTools::SkipSubStream( maStrm
);
703 // ----------------------------------------------------------------
704 case Z_Biff5E
: // --------------------------------- Z_Biff5E -
708 case 0x0809: // BOF [ 5]
711 switch( pExcRoot
->eDateiTyp
)
715 eAkt
= Z_Biff5TPre
; // Shrfmla Prefetch, Row-Prefetch
717 aIn
.StoreGlobalPosition(); // und Position merken
719 case Biff5C
: // chart sheet
720 GetObjectManager().ReadTabChart( maStrm
);
722 GetTracer().TraceChartOnlySheet();
726 pD
->SetVisible( GetCurrScTab(), FALSE
);
730 DBG_ASSERT( pExcRoot
->eDateiTyp
!= Biff5W
,
731 "+ImportExcel::Read(): Doppel-Whopper-Workbook!" );
738 case Z_Biffn0
: // --------------------------------- Z_Biffn0 -
742 case 0x0A: // EOF [ 2345]
750 // ----------------------------------------------------------------
751 case Z_Ende
: // ----------------------------------- Z_Ende -
752 DBG_ERROR( "*ImportExcel::Read(): Not possible state!" );
754 default: DBG_ERROR( "-ImportExcel::Read(): Zustand vergessen!" );
758 if( eLastErr
== eERR_OK
)
767 const XclImpAddressConverter
& rAddrConv
= GetAddressConverter();
768 if( rAddrConv
.IsTabTruncated() )
769 eLastErr
= SCWARN_IMPORT_SHEET_OVERFLOW
;
770 else if( bTabTruncated
|| rAddrConv
.IsRowTruncated() )
771 eLastErr
= SCWARN_IMPORT_ROW_OVERFLOW
;
772 else if( rAddrConv
.IsColTruncated() )
773 eLastErr
= SCWARN_IMPORT_COLUMN_OVERFLOW
;
780 //___________________________________________________________________
782 FltError
ImportExcel8::Read( void )
786 Biff8RecDumper
aDumper( GetRoot(), TRUE
);
787 if( aDumper
.Dump( aIn
) )
788 return ERRCODE_ABORT
;
791 // read the entire BIFF8 stream
792 // don't look too close - this stuff seriously needs to be reworked
794 XclImpPageSettings
& rPageSett
= GetPageSettings();
795 XclImpTabViewSettings
& rTabViewSett
= GetTabViewSettings();
796 XclImpPalette
& rPal
= GetPalette();
797 XclImpFontBuffer
& rFontBfr
= GetFontBuffer();
798 XclImpNumFmtBuffer
& rNumFmtBfr
= GetNumFmtBuffer();
799 XclImpXFBuffer
& rXFBfr
= GetXFBuffer();
800 XclImpSst
& rSst
= GetSst();
801 XclImpTabInfo
& rTabInfo
= GetTabInfo();
802 XclImpNameManager
& rNameMgr
= GetNameManager();
803 XclImpLinkManager
& rLinkMgr
= GetLinkManager();
804 XclImpObjectManager
& rObjMgr
= GetObjectManager();
805 XclImpCondFormatManager
& rCondFmtMgr
= GetCondFormatManager();
806 XclImpPivotTableManager
& rPTableMgr
= GetPivotTableManager();
807 XclImpWebQueryBuffer
& rWQBfr
= GetWebQueryBuffer();
809 bool bInUserView
= false; // true = In USERSVIEW(BEGIN|END) record block.
813 EXC_STATE_BEFORE_GLOBALS
, /// Before workbook globals (wait for initial BOF).
814 EXC_STATE_GLOBALS_PRE
, /// Prefetch for workbook globals.
815 EXC_STATE_GLOBALS
, /// Workbook globals.
816 EXC_STATE_BEFORE_SHEET
, /// Before worksheet (wait for new worksheet BOF).
817 EXC_STATE_SHEET_PRE
, /// Prefetch for worksheet.
818 EXC_STATE_SHEET
, /// Worksheet.
819 EXC_STATE_END
/// Stop reading.
822 XclImpReadState eAkt
= EXC_STATE_BEFORE_GLOBALS
;
824 FltError eLastErr
= eERR_OK
;
826 ::std::auto_ptr
< ScfSimpleProgressBar
> pProgress( new ScfSimpleProgressBar(
827 aIn
.GetSvStreamSize(), GetDocShell(), STR_LOAD_DOC
) );
829 /* #i104057# Need to track a base position for progress bar calculation,
830 because sheet substreams may not be in order of sheets. */
831 sal_Size nProgressBasePos
= 0;
832 sal_Size nProgressBaseSize
= 0;
834 bool bSheetHasCodeName
= false;
836 std::vector
< String
> CodeNames
;
838 std::vector
< SCTAB
> nTabsWithNoCodeName
;
840 while( eAkt
!= EXC_STATE_END
)
842 if( eAkt
== EXC_STATE_BEFORE_SHEET
)
844 sal_uInt16 nScTab
= GetCurrScTab();
845 if( nScTab
< maSheetOffsets
.size() )
847 nProgressBaseSize
+= (aIn
.GetSvStreamPos() - nProgressBasePos
);
848 nProgressBasePos
= maSheetOffsets
[ nScTab
];
849 aIn
.StartNextRecord( nProgressBasePos
);
852 eAkt
= EXC_STATE_END
;
855 aIn
.StartNextRecord();
859 // #124240# #i63591# finalize table if EOF is missing
862 case EXC_STATE_SHEET_PRE
:
863 eAkt
= EXC_STATE_SHEET
;
864 aIn
.SeekGlobalPosition();
865 continue; // next iteration in while loop
866 // break; // unxsols warning: statement unreachable
867 case EXC_STATE_SHEET
:
869 eAkt
= EXC_STATE_END
;
872 eAkt
= EXC_STATE_END
;
876 if( eAkt
== EXC_STATE_END
)
879 if( eAkt
!= EXC_STATE_SHEET_PRE
&& eAkt
!= EXC_STATE_GLOBALS_PRE
)
880 pProgress
->ProgressAbs( nProgressBaseSize
+ aIn
.GetSvStreamPos() - nProgressBasePos
);
882 sal_uInt16 nRecId
= aIn
.GetRecId();
884 /* #i39464# Ignore records between USERSVIEWBEGIN and USERSVIEWEND
885 completely (user specific view settings). Otherwise view settings
886 and filters are loaded multiple times, which at least causes
887 problems in auto-filters. */
890 case EXC_ID_USERSVIEWBEGIN
:
891 DBG_ASSERT( !bInUserView
, "ImportExcel8::Read - nested user view settings" );
894 case EXC_ID_USERSVIEWEND
:
895 DBG_ASSERT( bInUserView
, "ImportExcel8::Read - not in user view settings" );
900 if( !bInUserView
) switch( eAkt
)
902 // ----------------------------------------------------------------
903 // before workbook globals: wait for initial workbook globals BOF
904 case EXC_STATE_BEFORE_GLOBALS
:
906 if( nRecId
== EXC_ID5_BOF
)
908 DBG_ASSERT( GetBiff() == EXC_BIFF8
, "ImportExcel8::Read - wrong BIFF version" );
910 if( pExcRoot
->eDateiTyp
== Biff8W
)
912 eAkt
= EXC_STATE_GLOBALS_PRE
;
913 maStrm
.StoreGlobalPosition();
916 else if( pExcRoot
->eDateiTyp
== Biff8
)
918 // #i62752# possible to have BIFF8 sheet without globals
920 eAkt
= EXC_STATE_SHEET_PRE
; // Shrfmla Prefetch, Row-Prefetch
921 bSheetHasCodeName
= false; // reset
922 aIn
.StoreGlobalPosition();
928 // ----------------------------------------------------------------
929 // prefetch for workbook globals
930 case EXC_STATE_GLOBALS_PRE
:
936 /* #i56376# evil hack: if EOF for globals is missing,
937 simulate it. This hack works only for the bugdoc
938 given in the issue, where the sheet substreams
939 start directly after the EXTSST record. A future
940 implementation should be more robust against
942 if( (nRecId
== EXC_ID_EOF
) ||
943 ((nRecId
== EXC_ID_EXTSST
) && (maStrm
.GetNextRecId() == EXC_ID5_BOF
)) )
945 eAkt
= EXC_STATE_GLOBALS
;
946 aIn
.SeekGlobalPosition();
949 case 0x12: DocProtect(); break; // PROTECT [ 5678]
950 case 0x13: DocPasssword(); break;
951 case 0x19: WinProtection(); break;
952 case 0x2F: // FILEPASS [ 2345 ]
953 eLastErr
= XclImpDecryptHelper::ReadFilepass( maStrm
);
954 if( eLastErr
!= ERRCODE_NONE
)
955 eAkt
= EXC_STATE_END
;
957 case EXC_ID_FILESHARING
: ReadFileSharing(); break;
958 case 0x3D: Window1(); break;
959 case 0x42: Codepage(); break; // CODEPAGE [ 2345 ]
960 case 0x85: Boundsheet(); break; // BOUNDSHEET [ 5 ]
961 case 0x8C: Country(); break; // COUNTRY [ 345 ]
963 // PALETTE follows XFs, but already needed while reading the XFs
964 case EXC_ID_PALETTE
: rPal
.ReadPalette( maStrm
); break;
969 // ----------------------------------------------------------------
971 case EXC_STATE_GLOBALS
:
977 /* #i56376# evil hack: if EOF for globals is missing,
978 simulate it. This hack works only for the bugdoc
979 given in the issue, where the sheet substreams
980 start directly after the EXTSST record. A future
981 implementation should be more robust against
983 if( (nRecId
== EXC_ID_EOF
) ||
984 ((nRecId
== EXC_ID_EXTSST
) && (maStrm
.GetNextRecId() == EXC_ID5_BOF
)) )
986 rNumFmtBfr
.CreateScFormats();
987 rXFBfr
.CreateUserStyles();
988 rPTableMgr
.ReadPivotCaches( maStrm
);
989 eAkt
= EXC_STATE_BEFORE_SHEET
;
992 case 0x0E: Precision(); break; // PRECISION
993 case 0x22: Rec1904(); break; // 1904 [ 2345 ]
994 case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
995 case 0x8D: Hideobj(); break; // HIDEOBJ [ 345 ]
996 case 0xD3: /*ReadBasic()*/bHasBasic
= true; break;
997 // case 0xD3: ReadBasic(); break;
998 case 0xDE: Olesize(); break;
999 case 0x01BA: Codename( TRUE
); break;
1001 case EXC_ID_USESELFS
: ReadUsesElfs(); break;
1003 case EXC_ID2_FONT
: rFontBfr
.ReadFont( maStrm
); break;
1004 case EXC_ID4_FORMAT
: rNumFmtBfr
.ReadFormat( maStrm
); break;
1005 case EXC_ID5_XF
: rXFBfr
.ReadXF( maStrm
); break;
1006 case EXC_ID_STYLE
: rXFBfr
.ReadStyle( maStrm
); break;
1008 case EXC_ID_SST
: rSst
.ReadSst( maStrm
); break;
1009 case EXC_ID_TABID
: rTabInfo
.ReadTabid( maStrm
); break;
1010 case EXC_ID_NAME
: rNameMgr
.ReadName( maStrm
); break;
1012 case EXC_ID_EXTERNSHEET
: rLinkMgr
.ReadExternsheet( maStrm
); break;
1013 case EXC_ID_SUPBOOK
: rLinkMgr
.ReadSupbook( maStrm
); break;
1014 case EXC_ID_XCT
: rLinkMgr
.ReadXct( maStrm
); break;
1015 case EXC_ID_CRN
: rLinkMgr
.ReadCrn( maStrm
); break;
1016 case EXC_ID_EXTERNNAME
: rLinkMgr
.ReadExternname( maStrm
, pFormConv
); break;
1018 case EXC_ID_MSODRAWINGGROUP
:rObjMgr
.ReadMsoDrawingGroup( maStrm
); break;
1020 case EXC_ID_SXIDSTM
: rPTableMgr
.ReadSxidstm( maStrm
); break;
1021 case EXC_ID_SXVS
: rPTableMgr
.ReadSxvs( maStrm
); break;
1022 case EXC_ID_DCONREF
: rPTableMgr
.ReadDconref( maStrm
); break;
1028 // ----------------------------------------------------------------
1029 // before worksheet: wait for new worksheet BOF
1030 case EXC_STATE_BEFORE_SHEET
:
1032 if( nRecId
== EXC_ID5_BOF
)
1034 // #94191# import only 256 sheets
1035 if( GetCurrScTab() > GetScMaxPos().Tab() )
1037 XclTools::SkipSubStream( maStrm
);
1038 // #i29930# show warning box
1039 GetAddressConverter().CheckScTab( GetCurrScTab(), true );
1040 eAkt
= EXC_STATE_END
;
1046 switch( pExcRoot
->eDateiTyp
)
1048 case Biff8
: // worksheet
1049 case Biff8M4
: // macro sheet
1050 eAkt
= EXC_STATE_SHEET_PRE
; // Shrfmla Prefetch, Row-Prefetch
1051 aIn
.StoreGlobalPosition();
1053 case Biff8C
: // chart sheet
1054 rObjMgr
.ReadTabChart( maStrm
);
1056 GetTracer().TraceChartOnlySheet();
1058 case Biff8W
: // workbook
1059 DBG_ERRORFILE( "ImportExcel8::Read - double workbook globals" );
1061 case Biff8V
: // VB module
1063 // TODO: do not create a sheet in the Calc document
1064 pD
->SetVisible( GetCurrScTab(), FALSE
);
1065 XclTools::SkipSubStream( maStrm
);
1073 // ----------------------------------------------------------------
1074 // prefetch for worksheet
1075 case EXC_STATE_SHEET_PRE
:
1079 // skip chart substream
1083 case EXC_ID5_BOF
: XclTools::SkipSubStream( maStrm
); break;
1085 case EXC_ID_WINDOW2
: rTabViewSett
.ReadWindow2( maStrm
, false );break;
1086 case EXC_ID_SCL
: rTabViewSett
.ReadScl( maStrm
); break;
1087 case EXC_ID_PANE
: rTabViewSett
.ReadPane( maStrm
); break;
1088 case EXC_ID_SELECTION
: rTabViewSett
.ReadSelection( maStrm
); break;
1090 case EXC_ID2_DIMENSIONS
:
1091 case EXC_ID3_DIMENSIONS
: ReadDimensions(); break;
1093 case 0x0A: // EOF [ 2345 ]
1095 eAkt
= EXC_STATE_SHEET
;
1097 GetDoc().GetName( GetCurrScTab(), sName
);
1098 if ( !bSheetHasCodeName
)
1100 nTabsWithNoCodeName
.push_back( GetCurrScTab() );
1101 OSL_TRACE("No Codename for %d", GetCurrScTab() );
1106 GetDoc().GetCodeName( GetCurrScTab(), sCodeName
);
1107 OSL_TRACE("Have CodeName %s for SheetName %s",
1108 rtl::OUStringToOString( sCodeName
, RTL_TEXTENCODING_UTF8
).getStr(), rtl::OUStringToOString( sName
, RTL_TEXTENCODING_UTF8
).getStr() );
1109 CodeNames
.push_back( sCodeName
);
1112 bSheetHasCodeName
= false; // reset
1115 aIn
.SeekGlobalPosition(); // und zurueck an alte Position
1118 case 0x12: SheetProtect(); break;
1119 case 0x13: SheetPassword(); break;
1120 case 0x42: Codepage(); break; // CODEPAGE [ 2345 ]
1121 case 0x55: DefColWidth(); break;
1122 case 0x7D: Colinfo(); break; // COLINFO [ 345 ]
1123 case 0x81: Wsbool(); break; // WSBOOL [ 2345 ]
1124 case 0x8C: Country(); break; // COUNTRY [ 345 ]
1125 case 0x99: Standardwidth(); break; // STANDARDWIDTH[ 45 ]
1126 case 0x9B: FilterMode(); break; // FILTERMODE
1127 case 0x9D: AutoFilterInfo(); break;// AUTOFILTERINFO
1128 case 0x9E: AutoFilter(); break; // AUTOFILTER
1129 case 0x01BA: Codename( FALSE
); bSheetHasCodeName
= true; break;
1130 case 0x0208: Row34(); break; // ROW [ 34 ]
1132 case 0x0221: Array34(); break; // ARRAY [ 34 ]
1133 case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345 ]
1134 case 0x04BC: Shrfmla(); break; // SHRFMLA [ 5 ]
1135 case 0x0867: SheetProtection(); break; // SHEETPROTECTION
1140 // ----------------------------------------------------------------
1142 case EXC_STATE_SHEET
:
1146 // skip unknown substreams
1150 case EXC_ID5_BOF
: XclTools::SkipSubStream( maStrm
); break;
1152 case EXC_ID_EOF
: Eof(); eAkt
= EXC_STATE_BEFORE_SHEET
; break;
1155 case EXC_ID3_BLANK
: ReadBlank(); break;
1156 case EXC_ID2_INTEGER
: ReadInteger(); break;
1157 case EXC_ID2_NUMBER
:
1158 case EXC_ID3_NUMBER
: ReadNumber(); break;
1160 case EXC_ID3_LABEL
: ReadLabel(); break;
1161 case EXC_ID2_BOOLERR
:
1162 case EXC_ID3_BOOLERR
: ReadBoolErr(); break;
1163 case EXC_ID_RK
: ReadRk(); break;
1167 case 0x0406: Formula25(); break; // FORMULA [ 2 5 ]
1168 case 0x000C: Calccount(); break; // CALCCOUNT
1169 case 0x0010: Delta(); break; // DELTA
1170 case 0x0011: Iteration(); break; // ITERATION
1172 case 0x00AE: Scenman(); break; // SCENMAN
1173 case 0x00AF: Scenario(); break; // SCENARIO
1174 case 0x00BD: Mulrk(); break; // MULRK [ 5 ]
1175 case 0x00BE: Mulblank(); break; // MULBLANK [ 5 ]
1176 case 0x00D6: Rstring(); break; // RSTRING [ 5 ]
1177 case 0x00E5: Cellmerging(); break; // CELLMERGING
1178 case 0x00FD: Labelsst(); break; // LABELSST [ 8 ]
1179 case 0x0236: TableOp(); break; // TABLE
1181 case EXC_ID_HORPAGEBREAKS
:
1182 case EXC_ID_VERPAGEBREAKS
: rPageSett
.ReadPageBreaks( maStrm
); break;
1184 case EXC_ID_FOOTER
: rPageSett
.ReadHeaderFooter( maStrm
); break;
1185 case EXC_ID_LEFTMARGIN
:
1186 case EXC_ID_RIGHTMARGIN
:
1187 case EXC_ID_TOPMARGIN
:
1188 case EXC_ID_BOTTOMMARGIN
: rPageSett
.ReadMargin( maStrm
); break;
1189 case EXC_ID_PRINTHEADERS
: rPageSett
.ReadPrintHeaders( maStrm
); break;
1190 case EXC_ID_PRINTGRIDLINES
: rPageSett
.ReadPrintGridLines( maStrm
); break;
1191 case EXC_ID_HCENTER
:
1192 case EXC_ID_VCENTER
: rPageSett
.ReadCenter( maStrm
); break;
1193 case EXC_ID_SETUP
: rPageSett
.ReadSetup( maStrm
); break;
1194 case EXC_ID8_IMGDATA
: rPageSett
.ReadImgData( maStrm
); break;
1196 case EXC_ID_MSODRAWING
: rObjMgr
.ReadMsoDrawing( maStrm
); break;
1197 // #i61786# weird documents: OBJ without MSODRAWING -> read in BIFF5 format
1198 case EXC_ID_OBJ
: rObjMgr
.ReadObj( maStrm
); break;
1199 case EXC_ID_NOTE
: rObjMgr
.ReadNote( maStrm
); break;
1201 case EXC_ID_HLINK
: XclImpHyperlink::ReadHlink( maStrm
); break;
1202 case EXC_ID_LABELRANGES
: XclImpLabelranges::ReadLabelranges( maStrm
); break;
1204 case EXC_ID_CONDFMT
: rCondFmtMgr
.ReadCondfmt( maStrm
); break;
1205 case EXC_ID_CF
: rCondFmtMgr
.ReadCF( maStrm
); break;
1207 case EXC_ID_DVAL
: XclImpValidation::ReadDval( maStrm
); break;
1208 case EXC_ID_DV
: XclImpValidation::ReadDV( maStrm
); break;
1210 case EXC_ID_QSI
: rWQBfr
.ReadQsi( maStrm
); break;
1211 case EXC_ID_WQSTRING
: rWQBfr
.ReadWqstring( maStrm
); break;
1212 case EXC_ID_PQRY
: rWQBfr
.ReadParamqry( maStrm
); break;
1213 case EXC_ID_WQSETT
: rWQBfr
.ReadWqsettings( maStrm
); break;
1214 case EXC_ID_WQTABLES
: rWQBfr
.ReadWqtables( maStrm
); break;
1216 case EXC_ID_SXVIEW
: rPTableMgr
.ReadSxview( maStrm
); break;
1217 case EXC_ID_SXVD
: rPTableMgr
.ReadSxvd( maStrm
); break;
1218 case EXC_ID_SXVI
: rPTableMgr
.ReadSxvi( maStrm
); break;
1219 case EXC_ID_SXIVD
: rPTableMgr
.ReadSxivd( maStrm
); break;
1220 case EXC_ID_SXPI
: rPTableMgr
.ReadSxpi( maStrm
); break;
1221 case EXC_ID_SXDI
: rPTableMgr
.ReadSxdi( maStrm
); break;
1222 case EXC_ID_SXVDEX
: rPTableMgr
.ReadSxvdex( maStrm
); break;
1223 case EXC_ID_SXEX
: rPTableMgr
.ReadSxex( maStrm
); break;
1224 case EXC_ID_SXVIEWEX9
: rPTableMgr
.ReadSxViewEx9( maStrm
); break;
1226 // 0x0862 (SHEETEXT)
1227 case EXC_ID_SHEETEXT
: rTabViewSett
.ReadTabBgColor( maStrm
, rPal
); break;
1232 // ----------------------------------------------------------------
1237 if( eLastErr
== eERR_OK
)
1239 // In some strange circumstances a the codename might be missing
1240 // # Create any missing Sheet CodeNames
1241 std::vector
< SCTAB
>::iterator it_end
= nTabsWithNoCodeName
.end();
1242 for ( std::vector
< SCTAB
>::iterator it
= nTabsWithNoCodeName
.begin(); it
!= it_end
; ++it
)
1244 bool bGotCodeName
= false;
1246 OSL_TRACE("Trying to find suitable codename for %d", *it
);
1249 String
sTmpName( RTL_CONSTASCII_USTRINGPARAM("Sheet" ) );
1250 sTmpName
+= String::CreateFromInt32( sal_Int32(nTab
++) );
1251 std::vector
< String
>::iterator codeName_It
= CodeNames
.begin();
1252 std::vector
< String
>::iterator codeName_It_end
= CodeNames
.end();
1253 // search for codename
1254 for ( ; codeName_It
!= codeName_It_end
; ++codeName_It
)
1256 if ( *codeName_It
== sTmpName
)
1260 if ( codeName_It
== codeName_It_end
) // generated codename not found
1262 OSL_TRACE("Using generated codename %s", rtl::OUStringToOString( sTmpName
, RTL_TEXTENCODING_UTF8
).getStr() );
1264 GetDoc().SetCodeName( *it
, sTmpName
);
1265 // Record newly used codename
1266 CodeNames
.push_back( sTmpName
);
1267 // Record those we have created so they can be created in
1269 AutoGeneratedCodeNames
.push_back( sTmpName
);
1275 // #i45843# Convert pivot tables before calculation, so they are available
1276 // for the GETPIVOTDATA function.
1277 if( GetBiff() == EXC_BIFF8
)
1278 GetPivotTableManager().ConvertPivotTables();
1283 // Excel documents look much better without this call; better in the
1284 // sense that the row heights are identical to the original heights in
1290 pD
->CalcAfterLoad();
1292 // import change tracking data
1293 XclImpChangeTrack
aImpChTr( GetRoot(), maStrm
);
1296 const XclImpAddressConverter
& rAddrConv
= GetAddressConverter();
1297 if( rAddrConv
.IsTabTruncated() )
1298 eLastErr
= SCWARN_IMPORT_SHEET_OVERFLOW
;
1299 else if( bTabTruncated
|| rAddrConv
.IsRowTruncated() )
1300 eLastErr
= SCWARN_IMPORT_ROW_OVERFLOW
;
1301 else if( rAddrConv
.IsColTruncated() )
1302 eLastErr
= SCWARN_IMPORT_COLUMN_OVERFLOW
;
1304 if( GetBiff() == EXC_BIFF8
)
1305 GetPivotTableManager().MaybeRefreshPivotTables();
1311 //___________________________________________________________________