summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel/read.cxx
blob: eba5cc7ddafdcd97569255cfb5bc706766ef5fc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
/*************************************************************************
 *
 *  $RCSfile: read.cxx,v $
 *
 *  $Revision: 1.36 $
 *
 *  last change: $Author: jmarmion $ $Date: 2002-12-10 14:07:24 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://www.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/

#ifdef PCH
#include "filt_pch.hxx"
#endif

#pragma hdrstop

//------------------------------------------------------------------------

#include <stdlib.h>
#include <stdio.h>

#include "document.hxx"
#include "docoptio.hxx"
#include "globstr.hrc"
#include "stlsheet.hxx"
#include "stlpool.hxx"
#ifndef _SCERRORS_HXX
#include "scerrors.hxx"
#endif

#ifndef SC_XILINK_HXX
#include "xilink.hxx"
#endif
#ifndef SC_XICONTENT_HXX
#include "xicontent.hxx"
#endif

#ifndef SC_XCLIMPCHARTS_HXX
#include "XclImpCharts.hxx"
#endif
#ifndef SC_XCLIMPCHANGETRACK_HXX
#include "XclImpChangeTrack.hxx"
#endif

#include "root.hxx"
#include "biffdump.hxx"
#include "imp_op.hxx"
#include "excimp8.hxx"


FltError ImportExcel::Read( void )
{
#ifdef DEBUGGING
    BOOL bDebugging = TRUE;
    if( bDebugging )
    {
        Biff8RecDumper  aDumper( *pExcRoot, FALSE );

        if( aDumper.Dump( aIn ) )
            return eERR_OK;
    }
#endif

    const BOOL  bWithDrawLayer = pD->GetDrawLayer() != NULL;

    enum Zustand {
        Z_BiffNull, // Nicht in gueltigem Biff-Format
        Z_Biff2,    // Biff2: nur eine Tabelle
        Z_Biff2C,   // Biff2: Chart

        Z_Biff3,    // Biff3: nur eine Tabelle
        Z_Biff3C,   // Biff3: Chart

        Z_Biff4,    // Biff4: nur eine Tabelle
        Z_Biff4W,   // Biff4 Workbook: Globals
        Z_Biff4I,   // Biff4 Workbook: Initiales fuer eine Tabelle
        Z_Biff4T,   // Biff4 Workbook: eine Tabelle selbst
        Z_Biff4E,   // Biff4 Workbook: zwischen den Tabellen
        Z_Biff4C,   // Biff4: Chart

        Z_Biff5WPre,// Biff5: Prefetch Workbook
        Z_Biff5W,   // Biff5: Globals
        Z_Biff5I,   // Biff5: Initiales fuer eine Tabelle
        Z_Biff5T,   // Biff5: eine Tabelle selbst
        Z_Biff5E,   // Biff5: zwischen den Tabellen
        Z_Biff5Pre, // Biff5: Prefetch fuer Shrfmla/Array Formula
        Z_Biff5C,   // Biff5: Chart
        Z_Biffn0,   // Alle Biffs: Tabelle bis naechstesss EOF ueberlesen
        Z_Ende };

    Zustand             eAkt = Z_BiffNull, ePrev = Z_BiffNull;

    FltError            eLastErr = eERR_OK;
    UINT16              nOpcode;
    UINT16              nBofLevel = 0;
    BOOL                bBiff4Workbook = FALSE;

    DBG_ASSERT( &aIn != NULL, "-ImportExcel::Read(): Kein Stream - wie dass?!" );

    ::std::auto_ptr< ScfProgressBar > pProgress( new ScfProgressBar( ScGlobal::GetRscString( STR_LOAD_DOC ) ) );
    sal_uInt32 nStreamSeg = pProgress->AddSegment( aIn.GetStreamSize() );
    pProgress->ActivateSegment( nStreamSeg );

    while( eAkt != Z_Ende )
    {
        aIn.StartNextRecord();
        nOpcode = aIn.GetRecId();

        if( !aIn.IsValid() )
        {
            eAkt = Z_Ende;
            break;
        }

        if( eAkt != Z_Biff5Pre && eAkt != Z_Biff5WPre )
            pProgress->Progress( aIn.Tell() );

        switch( eAkt )
        {
            // ----------------------------------------------------------------
            case Z_BiffNull:    // ------------------------------- Z_BiffNull -
            {
                switch( nOpcode )
                {
                    case 0x09:                          // BOF          [ 2   ]
                        Bof2();
                        if( pExcRoot->eDateiTyp == Biff2 )
                        {
                            eAkt = Z_Biff2;
                            ResetBof();
                            NeueTabelle();
                        }
                        break;
                    case 0x0209:                        // BOF          [  3  ]
                        Bof3();
                        if( pExcRoot->eDateiTyp == Biff3 )
                        {
                            eAkt = Z_Biff3;
                            ResetBof();
                            NeueTabelle();
                        }
                        break;
                    case 0x0409:                        // BOF          [   4 ]
                        Bof4();
                        if( pExcRoot->eDateiTyp == Biff4 )
                        {
                            eAkt = Z_Biff4;
                            ResetBof();
                            NeueTabelle();
                        }
                        else if( pExcRoot->eDateiTyp == Biff4W )
                        {
                            eAkt = Z_Biff4W;
                            bBiff4Workbook = TRUE;
                        }
                        break;
                    case 0x0809:                        // BOF          [    5]
                    {
                        Bof5();
                        if( pExcRoot->eDateiTyp == Biff5W )
                        {
                            eAkt = Z_Biff5WPre;

                            nBdshtTab = 0;

                            aIn.StoreGlobalPosition(); // und Position merken
                        }

                        DBG_ASSERT( pExcRoot->eDateiTyp != Biff5,
                            "+ImportExcel::Read(): Tabelle ohne Workbook!" );
                    }
                        break;
                }
            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff2:       // ---------------------------------- Z_Biff2 -
            {
                switch( nOpcode )
                {
                    case 0x00:  Dimensions(); break;    // DIMENSIONS   [ 2345]
                    case 0x01:  Blank25(); break;       // BLANK        [ 2  5]
                    case 0x02:  Integer(); break;       // INTEGER      [ 2   ]
                    case 0x03:  Number25(); break;      // NUMBER       [ 2  5]
                    case 0x04:  Label25(); break;       // LABEL        [ 2  5]
                    case 0x05:  Boolerr25(); break;     // BOOLERR      [ 2  5]
                    case 0x06:  Formula25(); break;     // FORMULA      [ 2  5]
                    case 0x07:  RecString(); break;     // STRING       [ 2345]
                    case 0x08:  Row25(); break;         // ROW          [ 2  5]
                    case 0x0A:                          // EOF          [ 2345]
                        EndSheet();
                        eAkt = Z_Ende;
                        break;
                    case 0x14:  Header(); break;        // HEADER       [ 2345]
                    case 0x15:  Footer(); break;        // FOOTER       [ 2345]
                    case 0x17:  Externsheet(); break;   // EXTERNSHEET  [ 2345]
                    case 0x18:  Name25(); break;        // NAME         [ 2  5]
                    case 0x1C:  Note(); break;          // NOTE         [ 2345]
                    case 0x1D:  Selection(); break;     // SELECTION    [ 2345]
                    case 0x1E:  GetNumFmtBuffer().ReadFormat( maStrm );         break;
                    case 0x20:  Columndefault(); break; // COLUMNDEFAULT[ 2   ]
                    case 0x21:  Array25(); break;       // ARRAY        [ 2  5]
                    case 0x23:  Externname25(); break;  // EXTERNNAME   [ 2  5]
                    case 0x24:  Colwidth(); break;      // COLWIDTH     [ 2   ]
                    case 0x25:  Defrowheight2(); break; // DEFAULTROWHEI[ 2   ]
                    case 0x26:  Leftmargin(); break;    // LEFTMARGIN   [ 2345]
                    case 0x27:  Rightmargin(); break;   // RIGHTMARGIN  [ 2345]
                    case 0x28:  Topmargin(); break;     // TOPMARGIN    [ 2345]
                    case 0x29:  Bottommargin(); break;  // BOTTOMMARGIN [ 2345]
                    case 0x2A:  Printheaders(); break;  // PRINTHEADERS [ 2345]
                    case 0x2F:                          // FILEPASS     [ 2345]
                        if( Filepass() )
                        {
                            eLastErr = eERR_FILEPASSWD;
                            eAkt = Z_Ende;
                        }
                        break;
                    case 0x31:  GetFontBuffer().ReadFont( maStrm );             break;
                    case 0x41:  Pane(); break;          // PANE         [ 2345]
                    case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345]
                    case 0x43:  GetXFBuffer().ReadXF( maStrm );                 break;
                    case 0x44:  Ixfe(); break;          // IXFE         [ 2   ]
                    case 0x0200: Dimensions(); break;   // DIMENSIONS   [ 2345]
                }
            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff3:       // ---------------------------------- Z_Biff3 -
            {
                switch( nOpcode )
                {
                    case 0x00:  Dimensions(); break;    // DIMENSIONS   [ 2345]
                    case 0x0A:                          // EOF          [ 2345]
                        EndSheet();
                        eAkt = Z_Ende;
                        break;
                    case 0x14:  Header(); break;        // HEADER       [ 2345]
                    case 0x15:  Footer(); break;        // FOOTER       [ 2345]
                    case 0x17:  Externsheet(); break;   // EXTERNSHEET  [ 2345]
                    case 0x1A:  Verticalpagebreaks(); break;
                    case 0x1B:  Horizontalpagebreaks(); break;
                    case 0x1C:  Note(); break;          // NOTE         [ 2345]
                    case 0x1D:  Selection(); break;     // SELECTION    [ 2345]
                    case 0x1E:  GetNumFmtBuffer().ReadFormat( maStrm );         break;
                    case 0x22:  Rec1904(); break;       // 1904         [ 2345]
                    case 0x26:  Leftmargin(); break;    // LEFTMARGIN   [ 2345]
                    case 0x27:  Rightmargin(); break;   // RIGHTMARGIN  [ 2345]
                    case 0x28:  Topmargin(); break;     // TOPMARGIN    [ 2345]
                    case 0x29:  Bottommargin(); break;  // BOTTOMMARGIN [ 2345]
                    case 0x2A:  Printheaders(); break;  // PRINTHEADERS [ 2345]
                    case 0x2B:  Prntgrdlns(); break;    // PRINTGRIDLINE[ 2345]
                    case 0x2F:                          // FILEPASS     [ 2345]
                        if( Filepass() )
                        {
                            eLastErr = eERR_FILEPASSWD;
                            eAkt = Z_Ende;
                        }
                        break;
                    case 0x41:  Pane(); break;          // PANE         [ 2345]
                    case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345]
                    case 0x56:  Builtinfmtcnt(); break; // BUILTINFMTCNT[  34 ]
                    case 0x7D:  Colinfo(); break;       // COLINFO      [  345]
                    case 0x8C:  Country(); break;       // COUNTRY      [  345]
                    case 0x92:  Palette(); break;       // PALETTE      [  345]
                    case 0x0200: Dimensions(); break;   // DIMENSIONS   [ 2345]
                    case 0x0201: Blank34(); break;      // BLANK        [  34 ]
                    case 0x0203: Number34(); break;     // NUMBER       [  34 ]
                    case 0x0204: Label34(); break;      // LABEL        [  34 ]
                    case 0x0205: Boolerr34(); break;    // BOOLERR      [  34 ]
                    case 0x0206: Formula3(); break;     // FORMULA      [  3  ]
                    case 0x0207: RecString(); break;    // STRING       [ 2345]
                    case 0x0208: Row34(); break;        // ROW          [  34 ]
                    case 0x0218: Name34(); break;       // NAME         [  34 ]
                    case 0x0221: Array34(); break;      // ARRAY        [  34 ]
                    case 0x0223: Externname34(); break; // EXTERNNAME   [  34 ]
                    case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[  345]
                    case 0x0231: GetFontBuffer().ReadFont( maStrm );            break;
                    case 0x023E: Window2_5(); break;    // WINDOW       [    5]
                    case 0x0243: GetXFBuffer().ReadXF( maStrm );                break;
                    case 0x027E: Rk(); break;           // RK           [  34 ]
                }
            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff4:       // ---------------------------------- Z_Biff4 -
            {
                switch( nOpcode )
                {
                    case 0x00:  Dimensions(); break;    // DIMENSIONS   [ 2345]
                    case 0x0A:                          // EOF          [ 2345]
                        EndSheet();
                        eAkt = Z_Ende;
                        break;
                    case 0x12:  Protect(); break;       // SHEET PROTECTION
                    case 0x14:  Header(); break;        // HEADER       [ 2345]
                    case 0x15:  Footer(); break;        // FOOTER       [ 2345]
                    case 0x17:  Externsheet(); break;   // EXTERNSHEET  [ 2345]
                    case 0x1A:  Verticalpagebreaks(); break;
                    case 0x1B:  Horizontalpagebreaks(); break;
                    case 0x1C:  Note(); break;          // NOTE         [ 2345]
                    case 0x1D:  Selection(); break;     // SELECTION    [ 2345]
                    case 0x22:  Rec1904(); break;       // 1904         [ 2345]
                    case 0x2F:                          // FILEPASS     [ 2345]
                        if( Filepass() )
                        {
                            eLastErr = eERR_FILEPASSWD;
                            eAkt = Z_Ende;
                        }
                    case 0x41:  Pane(); break;          // PANE         [ 2345]
                    case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345]
                    case 0x55:  DefColWidth(); break;
                    case 0x56:  Builtinfmtcnt(); break; // BUILTINFMTCNT[  34 ]
                    case 0x7D:  Colinfo(); break;       // COLINFO      [  345]
                    case 0x8C:  Country(); break;       // COUNTRY      [  345]
                    case 0x92:  Palette(); break;       // PALETTE      [  345]
                    case 0x99:  Standardwidth(); break; // STANDARDWIDTH[   45]
                    case 0xA1:  Setup(); break;         // SETUP        [   45]
                    case 0x0200: Dimensions(); break;   // DIMENSIONS   [ 2345]
                    case 0x0201: Blank34(); break;      // BLANK        [  34 ]
                    case 0x0203: Number34(); break;     // NUMBER       [  34 ]
                    case 0x0204: Label34(); break;      // LABEL        [  34 ]
                    case 0x0205: Boolerr34(); break;    // BOOLERR      [  34 ]
                    case 0x0207: RecString(); break;    // STRING       [ 2345]
                    case 0x0208: Row34(); break;        // ROW          [  34 ]
                    case 0x0218: Name34(); break;       // NAME         [  34 ]
                    case 0x0221: Array34(); break;      // ARRAY        [  34 ]
                    case 0x0223: Externname34(); break; // EXTERNNAME   [  34 ]
                    case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[  345]
                    case 0x0231: GetFontBuffer().ReadFont( maStrm );            break;
                    case 0x023E: Window2_5(); break;    // WINDOW       [    5]
                    case 0x027E: Rk(); break;           // RK           [  34 ]
                    case 0x0406: Formula4(); break;     // FORMULA      [   4 ]
                    case 0x041E: GetNumFmtBuffer().ReadFormat( maStrm );        break;
                    case 0x0443: GetXFBuffer().ReadXF( maStrm );                break;
                }
            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff4W:      // --------------------------------- Z_Biff4W -
            {
                switch( nOpcode )
                {
                    case 0x0A:                          // EOF          [ 2345]
                        eAkt = Z_Ende;
                        break;
                    case 0x12:  DocProtect(); break;    // PROTECT      [    5]
                    case 0x2F:                          // FILEPASS     [ 2345]
                        if( Filepass() )
                        {
                            eLastErr = eERR_FILEPASSWD;
                            eAkt = Z_Ende;
                        }
                        break;
                    case 0x17:  Externsheet(); break;   // EXTERNSHEET  [ 2345]
                    case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345]
                    case 0x55:  DefColWidth(); break;
                    case 0x56:  Builtinfmtcnt(); break; // BUILTINFMTCNT[  34 ]
                    case 0x8C:  Country(); break;       // COUNTRY      [  345]
                    case 0x8F:  Bundleheader(); break;  // BUNDLEHEADER [   4 ]
                    case 0x92:  Palette(); break;       // PALETTE      [  345]
                    case 0x99:  Standardwidth(); break; // STANDARDWIDTH[   45]
                    case 0x0218: Name34(); break;       // NAME         [  34 ]
                    case 0x0223: Externname34(); break; // EXTERNNAME   [  34 ]
                    case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[  345]
                    case 0x0231: GetFontBuffer().ReadFont( maStrm );            break;
                    case 0x0409:                        // BOF          [   4 ]
                        Bof4();
                        if( pExcRoot->eDateiTyp == Biff4 )
                        {
                            eAkt = Z_Biff4I;
                            NeueTabelle();
                        }
                        else
                            eAkt = Z_Ende;
                        break;
                    case 0x041E: GetNumFmtBuffer().ReadFormat( maStrm );        break;
                    case 0x0443: GetXFBuffer().ReadXF( maStrm );                break;
                }

            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff4I:      // --------------------------------- Z_Biff4I -
            {
                switch( nOpcode )
                {
                    case 0x00:  Dimensions(); break;    // DIMENSIONS   [ 2345]
                    case 0x0A:                          // EOF          [ 2345]
                        eAkt = Z_Biff4E;
                        IncScTab();
                        break;
                    case 0x12:  Protect(); break;       // SHEET PROTECTION
                    case 0x14:  Header(); break;        // HEADER       [ 2345]
                    case 0x15:  Footer(); break;        // FOOTER       [ 2345]
                    case 0x1A:  Verticalpagebreaks(); break;
                    case 0x1B:  Horizontalpagebreaks(); break;
                    case 0x1C:                          // NOTE         [ 2345]
                        Note();
                        eAkt = Z_Biff4T;
                        break;
                    case 0x1D:  Selection(); break;     // SELECTION    [ 2345]
                    case 0x2F:                          // FILEPASS     [ 2345]
                        if( Filepass() )
                        {
                            eLastErr = eERR_FILEPASSWD;
                            eAkt = Z_Ende;
                        }
                        break;
                    case 0x41:  Pane(); break;          // PANE         [ 2345]
                    case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345]
                    case 0x55:  DefColWidth(); break;
                    case 0x56:  Builtinfmtcnt(); break; // BUILTINFMTCNT[  34 ]
                    case 0x7D:  Colinfo(); break;       // COLINFO      [  345]
                    case 0x8C:  Country(); break;       // COUNTRY      [  345]
                    case 0x8F:  Bundleheader(); break;  // BUNDLEHEADER [   4 ]
                    case 0x92:  Palette(); break;       // PALETTE      [  345]
                    case 0x99:  Standardwidth(); break; // STANDARDWIDTH[   45]
                    case 0xA1:  Setup(); break;         // SETUP        [   45]
                    case 0x0200: Dimensions(); break;   // DIMENSIONS   [ 2345]
                    case 0x0201:                        // BLANK        [  34 ]
                        Blank34();
                        eAkt = Z_Biff4T;
                        break;
                    case 0x0203:                        // NUMBER       [  34 ]
                        Number34();
                        eAkt = Z_Biff4T;
                        break;
                    case 0x0204:                        // LABEL        [  34 ]
                        Label34();
                        eAkt = Z_Biff4T;
                        break;
                    case 0x0205:                        // BOOLERR      [  34 ]
                        Boolerr34();
                        eAkt = Z_Biff4T;
                        break;
                    case 0x0208: Row34(); break;        // ROW          [  34 ]
                    case 0x0218: Name34(); break;       // NAME         [  34 ]
                    case 0x0221:                        // ARRAY        [  34 ]
                        Array34();
                        eAkt = Z_Biff4T;
                        break;
                    case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[  345]
                    case 0x0231: GetFontBuffer().ReadFont( maStrm );            break;
                    case 0x027E:                        // RK           [  34 ]
                        Rk();
                        eAkt = Z_Biff4T;
                        break;
                    case 0x0406:                        // FORMULA      [   4 ]
                        Formula4();
                        eAkt = Z_Biff4T;
                    case 0x041E: GetNumFmtBuffer().ReadFormat( maStrm );        break;
                    case 0x0443: GetXFBuffer().ReadXF( maStrm );                break;
                        break;
                }

            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff4T:      // --------------------------------- Z_Biff4T -
            {
                switch( nOpcode )
                {
                    case 0x0A:                          // EOF          [ 2345]
                        EndSheet();
                        IncScTab();
                        eAkt = Z_Biff4E;
                        break;
                    case 0x1C:  Note(); break;          // NOTE         [ 2345]
                    case 0x0201: Blank34(); break;      // BLANK        [  34 ]
                    case 0x0203: Number34(); break;     // NUMBER       [  34 ]
                    case 0x0204: Label34(); break;      // LABEL        [  34 ]
                    case 0x0205: Boolerr34(); break;    // BOOLERR      [  34 ]
                    case 0x0207: RecString(); break;    // STRING       [ 2345]
                    case 0x0208: Row34(); break;        // ROW          [  34 ]
                    case 0x0221: Array34(); break;      // ARRAY        [  34 ]
                    case 0x023E: Window2_5(); break;    // WINDOW       [    5]
                    case 0x027E: Rk(); break;           // RK           [  34 ]
                    case 0x0406: Formula4(); break;     // FORMULA      [   4 ]
                }

            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff4E:      // --------------------------------- Z_Biff4E -
            {
                switch( nOpcode )
                {
                    case 0x0A:                          // EOF          [ 2345]
                        eAkt = Z_Ende;
                        break;
                    case 0x8F:  break;                  // BUNDLEHEADER [   4 ]
                    case 0x0409:                        // BOF          [   4 ]
                        Bof4();
                        NeueTabelle();
                        if( pExcRoot->eDateiTyp == Biff4 )
                        {
                            eAkt = Z_Biff4I;
                            ResetBof();
                        }
                        else
                        {
                            ePrev = eAkt;
                            eAkt = Z_Biffn0;
                        }
                        break;
                }

            }
                break;
            case Z_Biff5WPre:   // ------------------------------ Z_Biff5WPre -
            {
                switch( nOpcode )
                {
                    case 0x0A:                          // EOF          [ 2345]
                        eAkt = Z_Biff5W;
                        aIn.SeekGlobalPosition();  // und zurueck an alte Position
                        break;
                    case 0x12:  DocProtect(); break;    // PROTECT      [    5]
                    case 0x2F:                          // FILEPASS     [ 2345]
                        if( Filepass() )
                        {
                            eLastErr = eERR_FILEPASSWD;
                            eAkt = Z_Ende;
                        }
                        break;
                    case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345]
                    case 0x85:  Boundsheet(); break;    // BOUNDSHEET   [    5]
                    case 0x8C:  Country(); break;       // COUNTRY      [  345]
                        break;
                }
            }
                break;
            case Z_Biff5W:      // --------------------------------- Z_Biff5W -
            {
                switch( nOpcode )
                {
                    case 0x0A:                          // EOF          [ 2345]
                        eAkt = Z_Biff5E;
                        break;
                    case 0x18:  Name25(); break;        // NAME         [ 2  5]
                    case 0x1E:  GetNumFmtBuffer().ReadFormat( maStrm );         break;
                    case 0x22:  Rec1904(); break;       // 1904         [ 2345]
                    case 0x25:  Defrowheight2(); break; // DEFAULTROWHEI[ 2   ]
                    case 0x2F:                          // FILEPASS     [ 2345]
                        if( Filepass() )
                        {
                            eLastErr = eERR_FILEPASSWD;
                            eAkt = Z_Ende;
                        }
                        break;
                    case 0x31:  GetFontBuffer().ReadFont( maStrm );             break;
                    case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345]
                    case 0x55:  DefColWidth(); break;
                    case 0x56:  Builtinfmtcnt(); break; // BUILTINFMTCNT[  34 ]
                    case 0x8D:  Hideobj(); break;       // HIDEOBJ      [  345]
                    case 0x92:  Palette(); break;       // PALETTE      [  345]
                    case 0x99:  Standardwidth(); break; // STANDARDWIDTH[   45]
                    case 0xDE:  Olesize(); break;
                    case 0xE0:  GetXFBuffer().ReadXF( maStrm );                 break;
                    case 0x0218: Name34(); break;       // NAME         [  34 ]
                    case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[  345]
                    case 0x041E: GetNumFmtBuffer().ReadFormat( maStrm );        break;
                }

            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff5I:      // --------------------------------- Z_Biff5I -
            {
                switch( nOpcode )
                {
                    case 0x00:  Dimensions(); break;    // DIMENSIONS   [ 2345]
                    case 0x01:                          // BLANK        [ 2  5]
                        Blank25();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x03:                          // NUMBER       [ 2  5]
                        Number25();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x04:                          // LABEL        [ 2  5]
                        Label25();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x05:                          // BOOLERR      [ 2  5]
                        Boolerr25();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x06:                          // FORMULA      [ 2  5]
                        Formula25();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x0A:                          // EOF          [ 2345]
                        eAkt = Z_Biff5E;
                        IncScTab();
                        break;
                    case 0x14:  Header(); break;        // HEADER       [ 2345]
                    case 0x15:  Footer(); break;        // FOOTER       [ 2345]
                    case 0x17:  Externsheet(); break;   // EXTERNSHEET  [ 2345]
                    case 0x1C:                          // NOTE         [ 2345]
                        Note();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x1D:  Selection(); break;     // SELECTION    [ 2345]
                    case 0x23:  Externname25(); break;  // EXTERNNAME   [ 2  5]
                    case 0x26:  Leftmargin(); break;    // LEFTMARGIN   [ 2345]
                    case 0x27:  Rightmargin(); break;   // RIGHTMARGIN  [ 2345]
                    case 0x28:  Topmargin(); break;     // TOPMARGIN    [ 2345]
                    case 0x29:  Bottommargin(); break;  // BOTTOMMARGIN [ 2345]
                    case 0x2A:  Printheaders(); break;  // PRINTHEADERS [ 2345]
                    case 0x2B:  Prntgrdlns(); break;    // PRINTGRIDLINE[ 2345]
                    case 0x2F:                          // FILEPASS     [ 2345]
                        if( Filepass() )
                        {
                            eLastErr = eERR_FILEPASSWD;
                            eAkt = Z_Ende;
                        }
                        break;
                    case 0x5D:
                        if( bWithDrawLayer )
                            Obj();

                        eAkt = Z_Biff5T; break;
                    case 0x7E:                          // RK           [    5]
                        Rk();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x82:  Gridset(); break;       // GRIDSET      [  345]
                    case 0x83:  Hcenter(); break;       // HCENTER      [  345]
                    case 0x84:  Vcenter(); break;       // VCENTER      [  345]
                    case 0xA1:  Setup5(); break;        // SETUP
                    case 0xBD:                          // MULRK        [    5]
                        Mulrk();
                        eAkt = Z_Biff5T;
                        break;
                    case 0xBE:                          // MULBLANK     [    5]
                        Mulblank();
                        eAkt = Z_Biff5T;
                        break;
                    case 0xD6:                          // RSTRING      [    5]
                        Rstring();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x0200: Dimensions(); break;   // DIMENSIONS   [ 2345]
                    case 0x0201:                        // BLANK        [  34 ]
                        Blank34();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x0203:                        // NUMBER       [  34 ]
                        Number34();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x0204:                        // LABEL        [  34 ]
                        Label34();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x0205:                        // BOOLERR      [  34 ]
                        Boolerr34();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x0206:                        // FORMULA      [  3  ]
                        Formula3();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x0236:                        // TABLE        [    5]
                        TableOp();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x027E:                        // RK           [  34 ]
                        Rk();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x0406:                        // FORMULA      [   4 ]
                        Formula4();
                        eAkt = Z_Biff5T;
                        break;
                    case 0x0809:                        // BOF          [    5]
                        Bof5();
                        NeueTabelle();
                        if( pExcRoot->eDateiTyp == Biff5C )
                        {
                            ePrev = eAkt;
                            eAkt = Z_Biff5C;
                        }
                        else if( pExcRoot->eDateiTyp == Biff5M4 )
                        {
                            ePrev = eAkt;
                            eAkt = Z_Biffn0;
                        }
#ifdef DBG_UTIL
                        else
                        {
                            DBG_ASSERT( pExcRoot->eDateiTyp == Biff5C,
                                "-ImportExcel::Read(): Sofort zu mir (GT)!" );
                        }
#endif
                        break;
                }

            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff5T:      // --------------------------------- Z_Biff5T -
            {
                switch( nOpcode )
                {
                    case 0x01:  Blank25(); break;       // BLANK        [ 2  5]
                    case 0x03:  Number25(); break;      // NUMBER       [ 2  5]
                    case 0x04:  Label25(); break;       // LABEL        [ 2  5]
                    case 0x05:  Boolerr25(); break;     // BOOLERR      [ 2  5]
                    case 0x06:  Formula25(); break;     // FORMULA      [ 2  5]
                    case 0x07:  RecString(); break;     // STRING       [ 2345]
                    case 0x0A:                          // EOF          [ 2345]
                        EndSheet();
                        IncScTab();
                        eAkt = Z_Biff5E;
                        break;
                    case 0x1C:  Note(); break;          // NOTE         [ 2345]
                    case 0x5D:                          // OBJ          [ 2345]
                        if( bWithDrawLayer )
                            Obj();

                        break;
                    case 0x7E:  Rk(); break;            // RK           [    5]
                    case 0xA0:  Scl(); break;           // SCL          [   45]
                    case 0xBD:  Mulrk(); break;         // MULRK        [    5]
                    case 0xBE:  Mulblank(); break;      // MULBLANK     [    5]
                    case 0xD6:  Rstring(); break;       // RSTRING      [    5]
                    case 0x0201: Blank34(); break;      // BLANK        [  34 ]
                    case 0x0203: Number34(); break;     // NUMBER       [  34 ]
                    case 0x0204: Label34(); break;      // LABEL        [  34 ]
                    case 0x0205: Boolerr34(); break;    // BOOLERR      [  34 ]
                    case 0x0206: Formula3(); break;     // FORMULA      [  3  ]
                    case 0x0207: RecString(); break;    // STRING       [ 2345]
                    case 0x0236: TableOp(); break;      // TABLE        [    5]
                    case 0x027E: Rk(); break;           // RK           [  34 ]
                    case 0x0406: Formula4(); break;     // FORMULA      [   4 ]
                    case 0x0809:                        // BOF          [    5]
                        Bof5();
                        if( pExcRoot->eDateiTyp == Biff5C )
                        {
                            ePrev = eAkt;
                            eAkt = Z_Biff5C;
                        }
                        else
                        {
                            ePrev = eAkt;
                            eAkt = Z_Biffn0;
                        }

                        DBG_ASSERT( pExcRoot->eDateiTyp == Biff5C,
                            "-ImportExcel::Read(): Sofort zu mir (GT)!" );
                        break;
                }

            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff5E:      // --------------------------------- Z_Biff5E -
            {
                switch( nOpcode )
                {
                    case 0x0809:                        // BOF          [    5]
                        Bof5();
                        NeueTabelle();
                        switch( pExcRoot->eDateiTyp )
                        {
                            case Biff5:
                                eAkt = Z_Biff5Pre;  // Shrfmla Prefetch, Row-Prefetch
                                pColRowBuff->Reset();
                                nBofLevel = 0;

                                aIn.StoreGlobalPosition(); // und Position merken
                                break;
                            case Biff5C:
                                eAkt = Z_Biff5C;
                                ePrev = Z_Biff5E;
                                break;
                            case Biff5M4:
                            case Biff5V:
                            default:
                                NeueTabelle();
                                pD->SetVisible( GetScTab(), FALSE );
                                ePrev = eAkt;
                                eAkt = Z_Biffn0;
                        }
                        DBG_ASSERT( pExcRoot->eDateiTyp != Biff5W,
                            "+ImportExcel::Read(): Doppel-Whopper-Workbook!" );

                        break;
                }

            }
                break;
            case Z_Biff5Pre:    // ------------------------------- Z_Biff5Pre -
            {
                if( nOpcode == 0x0809 )
                    nBofLevel++;
                else if( (nOpcode == 0x000A) && nBofLevel )
                    nBofLevel--;
                else if( !nBofLevel )                       // don't read chart records
                {
                    switch( nOpcode )
                    {
                        case 0x00:  Dimensions(); break;    // DIMENSIONS   [ 2345]
                        case 0x08:  Row25(); break;         // ROW          [ 2  5]
                        case 0x0A:                          // EOF          [ 2345]
                            eAkt = Z_Biff5I;
                            aIn.SeekGlobalPosition(); // und zurueck an alte Position
                            pColRowBuff->Apply( GetScTab() );
                            break;
                        case 0x12:  Protect(); break;       // SHEET PROTECTION
                        case 0x1A:  Verticalpagebreaks(); break;
                        case 0x1B:  Horizontalpagebreaks(); break;
                        case 0x1D:  Selection(); break;     // SELECTION    [ 2345]
                        case 0x17:  Externsheet(); break;   // EXTERNSHEET  [ 2345]
                        case 0x21:  Array25(); break;       // ARRAY        [ 2  5]
                        case 0x23:  Externname25(); break;  // EXTERNNAME   [ 2  5]
                        case 0x41:  Pane(); break;          // PANE         [ 2345]
                        case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345]
                        case 0x55:  DefColWidth(); break;
                        case 0x7D:  Colinfo(); break;       // COLINFO      [  345]
                        case 0x81:  Wsbool(); break;        // WSBOOL       [ 2345]
                        case 0x8C:  Country(); break;       // COUNTRY      [  345]
                        case 0x99:  Standardwidth(); break; // STANDARDWIDTH[   45]
                        case 0x0200: Dimensions(); break;   // DIMENSIONS   [ 2345]
                        case 0x0208: Row34(); break;        // ROW          [  34 ]
                        case 0x0221: Array34(); break;      // ARRAY        [  34 ]
                        case 0x0223: Externname34(); break; // EXTERNNAME   [  34 ]
                        case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[  345]
                        case 0x023E: Window2_5(); break;    // WINDOW       [    5]
                        case 0x04BC: Shrfmla(); break;      // SHRFMLA      [    5]
                    }
                }
            }
                break;
            case Z_Biff5C:  // ------------------------------------- Z_Biff5C -
            {
                if( bWithDrawLayer )
                {
                    switch( nOpcode )
                    {
                        case 0x0A:                                          // EOF          [ 2345]
                            EndChartObj();
                            eAkt = ePrev;   // und retur (zur Tabelle?)
                            break;
                        case 0x1002:    ChartChart();               break;
                        case 0x1003:    ChartSeries();              break;
                        //case 0x1004:  ;break;
                        case 0x1006:    ChartDataformat();          break;
                        case 0x1007:    ChartLineform();            break;
                        case 0x1009:    ChartMarkerformat();        break;
                        case 0x100A:    ChartAreaformat();          break;
                        case 0x100B:    ChartPieformat();           break;
                        case 0x100C:    ChartAttachedlabel();       break;
                        case 0x100D:    ChartSeriestext();          break;  // SERIESTEXT   [ 2345]
                        case 0x1014:    ChartChartformat();         break;
                        case 0x1015:    ChartLegend();              break;
                        case 0x1016:    ChartSerieslist();          break;
                        case 0x1017:    ChartBar();                 break;
                        case 0x1018:    ChartLine();                break;
                        case 0x1019:    ChartPie();                 break;
                        case 0x101A:    ChartArea();                break;
                        //case 0x101B:  ;break;
                        case 0x101C:    ChartLine();                break;
                        case 0x101D:    ChartAxis();                break;
                        case 0x101E:    ChartTick();                break;
                        case 0x101F:    ChartValuerange();          break;
                        case 0x1020:    ChartCatserrange();         break;
                        case 0x1021:    ChartAxislineformat();      break;
                        //case 0x1022:  ; break;
                        case 0x1024:    ChartDefaulttext();         break;
                        case 0x1025:    ChartText();                break;
                        case 0x1026:    ChartFontx();               break;
                        case 0x1027:    ChartObjectLink();          break;  // OBJECTLINK   [ 2345]
                        case 0x1032:    ChartFrame();               break;
                        //case 0x1033:  ;break;
                        //case 0x1034:  ;break;
                        case 0x1035:    ChartPlotarea();            break;
                        case 0x103A:    Chart3D();                  break;
                        case 0x103C:    ChartPicf();                break;
                        case 0x103D:    ChartDropbar();             break;
                        case 0x103E:    ChartRadar();               break;
                        case 0x103F:    ChartSurface();             break;
                        case 0x1040:    ChartRadararea();           break;
                        case 0x1041:    ChartAxisparent();          break;
                        case 0x1043:    ChartLegendxn();            break;
                        case 0x1044:    ChartShtprops();            break;
                        case 0x1045:    ChartSertocrt();            break;
                        case 0x1046:    ChartAxesused();            break;
                        case 0x1048:    ChartSbaseref();            break;
                        case 0x104A:    ChartSerparent();           break;
                        case 0x104B:    ChartSerauxtrend();         break;
                        case 0x104E:    ChartIfmt();                break;
                        case 0x104F:    ChartPos();                 break;
                        case 0x1050:    ChartAlruns();              break;
                        case 0x1051:    ChartSelection();           break;  // AI           [    5]
                        case 0x105B:    ChartSerauxerrbar();        break;
                        case 0x105D:    ChartSerfmt();              break;
                    }
                }
                else if( nOpcode == 0x0A )
                    eAkt = ePrev;
            }
                break;
            case Z_Biffn0:      // --------------------------------- Z_Biffn0 -
            {
                switch( nOpcode )
                {
                    case 0x0A:                          // EOF          [ 2345]
                        eAkt = ePrev;
                        IncScTab();
                        break;
                }

            }
                break;
            // ----------------------------------------------------------------
            case Z_Ende:        // ----------------------------------- Z_Ende -
                DBG_ERROR( "*ImportExcel::Read(): Not possible state!" );
                break;
            default: DBG_ERROR( "-ImportExcel::Read(): Zustand vergessen!" );
        }
    }

    if( eLastErr == eERR_OK )
    {
        pD->CalcAfterLoad();

        ScStyleSheetPool*       pPool = pD->GetStyleSheetPool();

        UINT16                  nTabLast;// = pExcRoot->pTabNameBuff->GetLastIndex();
        if( pExcRoot->eHauptDateiTyp <= Biff3 || (pExcRoot->eHauptDateiTyp == Biff4 && !bBiff4Workbook) )
            nTabLast = 1;
        else
            nTabLast = pExcRoot->pTabNameBuff->GetLastIndex();

        UINT16                  nTabCount;
        for( nTabCount = 0 ; nTabCount < nTabLast ; nTabCount++ )
            pD->SetPageStyle( nTabCount, GetPageStyleName( nTabCount ) );

        pProgress.reset();

        AdjustRowHeight();
        PostDocLoad();

        if( bTabTruncated || IsTruncated() )
            eLastErr = eERR_RNGOVRFLW;
    }

    return eLastErr;
}


//___________________________________________________________________

FltError ImportExcel8::Read( void )
{
#ifdef DEBUGGING
    {
        Biff8RecDumper  aDumper( *pExcRoot, TRUE );
        if( aDumper.Dump( aIn ) )
            return eERR_OK;
    }
#endif

    CreateTmpCtrlStorage();

    UINT16              nOpcode;            // aktueller Opcode
    UINT16              nBofLevel = 0;

    const BOOL          bWithDrawLayer = pD->GetDrawLayer() != NULL;

    enum Zustand {
        Z_BiffNull, // Nicht in gueltigem Biff-Format
        Z_Biff8WPre,// Biff8: Prefetch Workbook
        Z_Biff8W,   // Biff8: Globals
        Z_Biff8I,   // Biff8: Initiales fuer eine Tabelle
        Z_Biff8T,   // Biff8: eine Tabelle selbst
        Z_Biff8E,   // Biff8: zwischen den Tabellen
        Z_Biff8Pre, // Biff8: Prefetch fuer Shrfmla/Array Formula
        Z_Biff8C,   // Biff8: Chart (nur noch zum Ueberlesen)

        Z_Biffn0,   // Alle Biffs: Tabelle bis naechstesss EOF ueberlesen
        Z_Ende };

    Zustand             eAkt = Z_BiffNull, ePrev = Z_BiffNull;

    FltError            eLastErr = eERR_OK;

    DBG_ASSERT( &aIn != NULL,
        "-ImportExcel8::Read(): Kein Stream - wie dass?!" );

    ::std::auto_ptr< ScfProgressBar > pProgress( new ScfProgressBar( ScGlobal::GetRscString( STR_LOAD_DOC ) ) );
    sal_uInt32 nStreamSeg = pProgress->AddSegment( aIn.GetStreamSize() );
    pProgress->ActivateSegment( nStreamSeg );

    bObjSection = FALSE;

    while( eAkt != Z_Ende )
    {
        aIn.StartNextRecord();
        nOpcode = aIn.GetRecId();
        if( !aIn.IsValid() )
        {
            eAkt = Z_Ende;
            break;
        }

        if( eAkt != Z_Biff8Pre && eAkt != Z_Biff8WPre )
            pProgress->Progress( aIn.Tell() );

        if( nOpcode != EXC_ID_CONT )
        {
            aIn.InitializeRecord( TRUE );       // enable internal CONTINUE handling
            bObjSection =
                (nOpcode == 0x005D) ||          // OBJ
                (nOpcode == 0x00EB) ||          // MSODRAWINGGROUP
                (nOpcode == 0x00EC) ||          // MSODRAWING
                (nOpcode == 0x00ED) ||          // MSODRAWINGSELECTION
                (nOpcode == 0x01B6);            // TXO
        }

        switch( eAkt )
        {
            case Z_BiffNull:    // ------------------------------- Z_BiffNull -
            {
                switch( nOpcode )
                {
                    case 0x0809:                        // BOF          [    5 8 ]
                    {
                        Bof5();
                        if( pExcRoot->eHauptDateiTyp == Biff8 )
                        {
                            eAkt = Z_Biff8WPre;

                            nBdshtTab = 0;

                            aIn.StoreGlobalPosition();
                        }

                        DBG_ASSERT( pExcRoot->eDateiTyp != Biff8,
                            "+ImportExcel8::Read(): Tabelle ohne Workbook!" );
                    }
                        break;
                }
            }
                break;
            case Z_Biff8WPre:   // ------------------------------ Z_Biff8WPre -
            {
                switch( nOpcode )
                {
                    case 0x0A:                          // EOF          [ 2345   ]
                        eAkt = Z_Biff8W;
                        aIn.SeekGlobalPosition();          // und zurueck an alte Position
                        break;
                    case 0x12:  DocProtect(); break;    // PROTECT      [    5678]
                    case 0x19:  WinProtection(); break;
                    case 0x2F:                          // FILEPASS     [ 2345   ]
                        if( Filepass() )
                        {
                            eLastErr = eERR_FILEPASSWD;
                            eAkt = Z_Ende;
                        }
                        break;
                    case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345   ]
                    case 0x85:  Boundsheet(); break;    // BOUNDSHEET   [    5   ]
                    case 0x8C:  Country(); break;       // COUNTRY      [  345   ]
                        break;
                }
            }
                break;
            case Z_Biff8W:      // --------------------------------- Z_Biff8W -
            {
                switch( nOpcode )
                {
                    case 0x0A:                          // EOF          [ 2345   ]
                        eAkt = Z_Biff8E;
                        break;
                    case 0x18:  Name(); break;          // NAME         [ 2  5 8 ]
                    case 0x22:  Rec1904(); break;       // 1904         [ 2345   ]
                    case 0x25:  Defrowheight2(); break; // DEFAULTROWHEI[ 2      ]
                    case 0x31:  GetFontBuffer().ReadFont( maStrm );             break;
                    case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345   ]
                    case 0x51:  Dconref(); break;       // DCONREF                ##++##
                    case 0x55:  DefColWidth(); break;
                    case 0x56:  Builtinfmtcnt(); break; // BUILTINFMTCNT[  34    ]
                    case 0x8D:  Hideobj(); break;       // HIDEOBJ      [  345   ]
                    case 0x92:  Palette(); break;       // PALETTE      [  345   ]
                    case 0x99:  Standardwidth(); break; // STANDARDWIDTH[   45   ]
                    case 0xD3:  bHasBasic = TRUE; break;
                    case 0xD5:  SXIdStm(); break;       // SXIDSTM                ##++##
                    case 0xDE:  Olesize(); break;
                    case 0xE0:  GetXFBuffer().ReadXF( maStrm );                 break;
                    case 0xE3:  SXVs(); break;          // SXVS                   ##++##
                    case 0xEB:  Msodrawinggroup(); break;
                    case 0x01BA: Codename( TRUE ); break;
                    case 0x0218: Name(); break;         // NAME         [      8 ]
                    case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[  345   ]
                    case 0x0293: GetXFBuffer().ReadStyle( maStrm );             break;
                    case 0x041E: GetNumFmtBuffer().ReadFormat( maStrm );        break;

                    case EXC_ID_SST:            GetSst().ReadSst( maStrm );                 break;
                    case EXC_ID_TABID:          GetTabIdBuffer().ReadTabid( maStrm );       break;
                    case EXC_ID_EXTERNSHEET:    GetLinkManager().ReadExternsheet( maStrm ); break;
                    case EXC_ID_SUPBOOK:        GetLinkManager().ReadSupbook( maStrm );     break;
                    case EXC_ID_XCT:            GetLinkManager().ReadXct( maStrm );         break;
                    case EXC_ID_CRN:            GetLinkManager().ReadCrn( maStrm, *pFormConv );break;
                    case EXC_ID_EXTERNNAME:     GetLinkManager().ReadExternname( maStrm );  break;
                }

            }
                break;
            case Z_Biff8I:      // --------------------------------- Z_Biff8I -
            case Z_Biff8T:      // --------------------------------- Z_Biff8T -
            {
                // Z_Biff8I (initial records) and Z_Biff8T (common table records) together
                BOOL bFound = FALSE;

                // 1st: read records for Z_Biff8I only
                if( (eAkt == Z_Biff8I) && !bFound )
                {
                    bFound = TRUE;
                    switch( nOpcode )
                    {
                        case 0x000C:    Calccount();            break;  // CALCCOUNT
                        case 0x0010:    Delta();                break;  // DELTA
                        case 0x0011:    Iteration();            break;  // ITERATION
                        case 0x0014:    Header();               break;  // HEADER       [ 2345   ]
                        case 0x0015:    Footer();               break;  // FOOTER       [ 2345   ]
                        case 0x001D:    Selection();            break;  // SELECTION    [ 2345   ]
                        case 0x0026:    Leftmargin();           break;  // LEFTMARGIN   [ 2345   ]
                        case 0x0027:    Rightmargin();          break;  // RIGHTMARGIN  [ 2345   ]
                        case 0x0028:    Topmargin();            break;  // TOPMARGIN    [ 2345   ]
                        case 0x0029:    Bottommargin();         break;  // BOTTOMMARGIN [ 2345   ]
                        case 0x002A:    Printheaders();         break;  // PRINTHEADERS [ 2345   ]
                        case 0x002B:    Prntgrdlns();           break;  // PRINTGRIDLINE[ 2345   ]
                        case 0x0082:    Gridset();              break;  // GRIDSET      [  345   ]
                        case 0x0083:    Hcenter();              break;  // HCENTER      [  345   ]
                        case 0x0084:    Vcenter();              break;  // VCENTER      [  345   ]
                        case 0x00A1:    Setup5();               break;  // SETUP
                        case 0x0200:    Dimensions();           break;  // DIMENSIONS   [      8 ]
                        case 0x0809:                                    // BOF          [    5   ]
                        {
                            Bof5();
                            NeueTabelle();
                            if( pExcRoot->eDateiTyp == Biff8C )
                            {
                                if( bWithDrawLayer && aObjManager.IsCurrObjChart() )
                                    ReadChart8( *pProgress, FALSE );    // zunaechst Return vergessen
                                else
                                {// Stream-Teil mit Chart ueberlesen
                                    ePrev = eAkt;
                                    eAkt = Z_Biff8C;
                                }
                            }
#ifdef DBG_UTIL
                            else
                            {
                                DBG_ASSERT( pExcRoot->eDateiTyp == Biff5C,
                                    "-ImportExcel8::Read(): Sofort zu mir (GT)!" );
                            }
#endif
                        }
                        break;
                        default:        bFound = FALSE;
                    }
                }

                // 2nd: common table records, change mode to Z_Biff8T
                if( !bFound )
                {
                    bFound = TRUE;
                    switch( nOpcode )
                    {
                        case 0x0001:    Blank25();              break;  // BLANK        [ 2  5   ]
                        case 0x0003:    Number25();             break;  // NUMBER       [ 2  5   ]
                        case 0x0004:    Label();                break;  // LABEL        [ 2  5   ]
                        case 0x0005:    Boolerr25();            break;  // BOOLERR      [ 2  5   ]
                        case 0x0006:
                        case 0x0206:
                        case 0x0406:    Formula25();            break;  // FORMULA      [ 2  5   ]
                        case 0x001C:    Note();                 break;  // NOTE         [ 2345   ]
                        case 0x005D:    if( bWithDrawLayer ) Obj(); break;  // OBJ      [ 2345   ]
                        case 0x007E:
                        case 0x027E:    Rk();                   break;  // RK           [    5   ]
                        case 0x00AE:    Scenman();              break;  // SCENMAN
                        case 0x00AF:    Scenario();             break;  // SCENARIO
                        case 0x00BD:    Mulrk();                break;  // MULRK        [    5   ]
                        case 0x00BE:    Mulblank();             break;  // MULBLANK     [    5   ]
                        case 0x00D6:    Rstring();              break;  // RSTRING      [    5   ]
                        case 0x00E5:    Cellmerging();          break;  // CELLMERGING
                        case 0x00EC:    Msodrawing();           break;  // MSODRAWING
                        case 0x00ED:    Msodrawingselection();  break;  // MSODRAWINGSELECTION
                        case 0x00FD:    Labelsst();             break;  // LABELSST     [      8 ]
                        case 0x01B0:    Condfmt();              break;  // CONDFMT
                        case 0x01B6:    Txo();                  break;  // TXO
                        case 0x0201:    Blank34();              break;  // BLANK        [  34    ]
                        case 0x0203:    Number34();             break;  // NUMBER       [  34    ]
                        case 0x0204:    Label();                break;  // LABEL        [  34    ]
                        case 0x0205:    Boolerr34();            break;  // BOOLERR      [  34    ]
                        case 0x0236:    TableOp();              break;  // TABLE
                        case 0x0021:    Array25();              break;  // ARRAY        [ 2  5   ]
                        case 0x0221:    Array34();              break;  // ARRAY        [  34    ]

                        case EXC_ID_HLINK:          XclImpHyperlink::ReadHlink( maStrm );           break;
                        case EXC_ID_LABELRANGES:    XclImpLabelranges::ReadLabelranges( maStrm );   break;
                        case EXC_ID_DVAL:           XclImpValidation::ReadDval( maStrm, *this );    break;
                        case EXC_ID_DV:             XclImpValidation::ReadDv( maStrm, *pFormConv ); break;

                        case EXC_ID_QSI:            GetWebQueryBuffer().ReadQsi( maStrm );          break;
                        case EXC_ID_SXSTRING:       GetWebQueryBuffer().ReadSxstring( maStrm );     break;
                        case EXC_ID_PQRY:           GetWebQueryBuffer().ReadParamqry( maStrm );     break;
                        case EXC_ID_WQSETT:         GetWebQueryBuffer().ReadWqsettings( maStrm );   break;
                        case EXC_ID_WQTABLES:       GetWebQueryBuffer().ReadWqtables( maStrm );     break;

                        default:
                            bFound = FALSE;
                    }
                    if( bFound )
                        eAkt = Z_Biff8T;
                }

                // 3rd: read records for Z_Biff8T only
                if( (eAkt == Z_Biff8T) && !bFound )
                {
                    bFound = TRUE;
                    switch( nOpcode )
                    {
                        case 0x0007:    RecString();            break;  // STRING       [ 2345   ]
                        case 0x003C:    Cont();                 break;  // CONTINUE
                        case 0x00A0:    Scl();                  break;  // SCL          [   45   ]
                        case 0x00B0:    SXView();               break;  // SXVIEW
                        case 0x00B1:    SXVd();                 break;  // SXVD
                        case 0x00B2:    SXVi();                 break;  // SXVI
                        case 0x00B4:    SXIvd();                break;  // SXIVD
                        case 0x00B5:    SXLi();                 break;  // SXLI
                        case 0x00B6:    SXPi();                 break;  // SXPI
                        case 0x00C5:    SXDi();                 break;  // SXDI
                        case 0x00F0:    SXRule();               break;  // SXRULE
                        case 0x00F1:    SXEx();                 break;  // SXEX
                        case 0x00F2:    SXFilt();               break;  // SXFILT
                        case 0x00F7:    SXSelect();             break;  // SXSELECT
                        case 0x0100:    SXVdex();               break;  // SXVDEX
                        case 0x01B1:    Cf();                   break;  // CF
                        case 0x0207:    RecString();            break;  // STRING       [ 2345   ]
                        case 0x0809:                                    // BOF          [    5   ]
                        {
                            Bof5();
                            if( pExcRoot->eDateiTyp == Biff8C && bWithDrawLayer &&
                                aObjManager.IsCurrObjChart() )
                                ReadChart8( *pProgress, FALSE );    // zunaechst Return vergessen
                            else
                            {
                                ePrev = eAkt;
                                eAkt = Z_Biffn0;
                            }

                            DBG_ASSERT( pExcRoot->eDateiTyp == Biff8C,
                                "-ImportExcel8::Read(): Sofort zu mir (GT)!" );
                        }
                        break;
                        default:        bFound = FALSE;
                    }
                }

                // 4th: read records for Z_Biff8I and Z_Biff8T
                if( !bFound )
                {
                    bFound = TRUE;
                    switch( nOpcode )
                    {
                        case 0x000A:                            // EOF          [ 2345   ]
                        {
                            EndSheet();
                            eAkt = Z_Biff8E;
                            IncScTab();
                        }
                        break;
                        case 0x002F:                            // FILEPASS     [ 2345   ]
                        {
                            if( Filepass() )
                            {
                                eLastErr = eERR_FILEPASSWD;
                                eAkt = Z_Ende;
                            }
                        }
                        break;
                        default:    bFound = FALSE;
                    }
                }
            }
                break;
            // ----------------------------------------------------------------
            case Z_Biff8E:      // --------------------------------- Z_Biff8E -
            {
                switch( nOpcode )
                {
                    case 0x0809:                        // BOF          [    5   ]
                    {
                        if( GetScTab() > MAXTAB )    // ignore tables >255
                        {
                            ePrev = eAkt;
                            eAkt = Z_Biffn0;
                            break;
                        }

                        Bof5();
                        NeueTabelle();

                        aObjManager.InsertDummyObj();

                        switch( pExcRoot->eDateiTyp )
                        {
                            case Biff8:
                            case Biff8M4:
                                eAkt = Z_Biff8Pre;  // Shrfmla Prefetch, Row-Prefetch
                                pColRowBuff->Reset();
                                nBofLevel = 0;

                                aIn.StoreGlobalPosition();
                                break;
                            case Biff8C:
                                aObjManager.SetNewCurrObjChart();
                                pExcRoot->bChartTab = TRUE;
                                ReadChart8( *pProgress, TRUE );
                                pExcRoot->bChartTab = FALSE;
                                EndSheet();
                                IncScTab();
                                break;
                            case Biff8V:
                            default:
                                pD->SetVisible( GetScTab(), FALSE );
                                ePrev = eAkt;
                                eAkt = Z_Biffn0;
                        }
                        DBG_ASSERT( pExcRoot->eDateiTyp != Biff8W,
                            "+ImportExcel8::Read(): Doppel-Whopper-Workbook!" );
                    }
                    break;
                }

            }
                break;
            case Z_Biff8Pre:    // ------------------------------- Z_Biff8Pre -
            {
                if( nOpcode == 0x0809 )
                    nBofLevel++;
                else if( (nOpcode == 0x000A) && nBofLevel )
                    nBofLevel--;
                else if( !nBofLevel )                       // don't read chart records
                {
                    switch( nOpcode )
                    {
                        case 0x00:  Dimensions(); break;    // DIMENSIONS   [ 2345   ]
                        case 0x08:  Row25(); break;         // ROW          [ 2  5   ]
                        case 0x0A:                          // EOF          [ 2345   ]
                            eAkt = Z_Biff8I;
                            aIn.SeekGlobalPosition();         // und zurueck an alte Position
                            pColRowBuff->Apply( GetScTab() );
                            break;
                        case 0x12:  Protect(); break;
                        case 0x1A:  Verticalpagebreaks(); break;
                        case 0x1B:  Horizontalpagebreaks(); break;
                        case 0x1D:  Selection(); break;     // SELECTION    [ 2345   ]
                        case 0x41:  Pane(); break;          // PANE         [ 2345   ]
                        case 0x42:  Codepage(); break;      // CODEPAGE     [ 2345   ]
                        case 0x55:  DefColWidth(); break;
                        case 0x7D:  Colinfo(); break;       // COLINFO      [  345   ]
                        case 0x81:  Wsbool(); break;        // WSBOOL       [ 2345   ]
                        case 0x8C:  Country(); break;       // COUNTRY      [  345   ]
                        case 0x99:  Standardwidth(); break; // STANDARDWIDTH[   45   ]
                        case 0x9B:  FilterMode(); break;    // FILTERMODE
                        case 0x9D:  AutoFilterInfo(); break;// AUTOFILTERINFO
                        case 0x9E:  AutoFilter(); break;    // AUTOFILTER
                        case 0x01BA: Codename( FALSE ); break;
                        case 0x0200: Dimensions(); break;   // DIMENSIONS   [ 2345   ]
                        case 0x0208: Row34(); break;        // ROW          [  34    ]
                        case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[  345   ]
                        case 0x023E: Window2_5(); break;    // WINDOW       [    5]
                        case 0x04BC: Shrfmla(); break;      // SHRFMLA      [    5   ]

                        case EXC_ID_BITMAP:     XclImpBitmap::ReadBitmap( maStrm );             break;
                    }
                }
            }
                break;
            case Z_Biff8C:  // ------------------------------------- Z_Biff8C -
            {
                if( nOpcode == 0x0A )
                    eAkt = ePrev;
            }
                break;
            case Z_Biffn0:      // --------------------------------- Z_Biffn0 -
            {
                switch( nOpcode )
                {
                    case 0x0809:    nBofLevel++;            break;
                    case 0x000A:
                    {
                        if( nBofLevel )
                            nBofLevel--;
                        else
                        {
                            eAkt = ePrev;
                            IncScTab();
                        }
                    }
                    break;
                }
            }
                break;
            // ----------------------------------------------------------------
            case Z_Ende:        // ----------------------------------- Z_Ende -
                DBG_ERROR( "*ImportExcel8::Read(): Not possible state!" );
                break;
            default: DBG_ERROR( "-ImportExcel8::Read(): Zustand vergessen!" );
        }
    }

    if( eLastErr == eERR_OK )
    {
        pD->CalcAfterLoad();

        ScStyleSheetPool*       pPool = pD->GetStyleSheetPool();

        UINT16                  nTabLast = pExcRoot->pTabNameBuff->GetLastIndex();

        UINT16                  nTabCount;
        for( nTabCount = 0 ; nTabCount < nTabLast ; nTabCount++ )
            pD->SetPageStyle( nTabCount, GetPageStyleName( nTabCount ) );

        pProgress.reset();

        AdjustRowHeight();
        PostDocLoad();

        // import change tracking data
        XclImpChangeTrack aImpChTr( pExcRoot );
        aImpChTr.Apply();

        if( bTabTruncated || IsTruncated() )
            eLastErr = eERR_RNGOVRFLW;
    }

    return eLastErr;
}


//___________________________________________________________________

FltError ImportExcel8::ReadChart8( ScfProgressBar& rProgress, const BOOL bOwnTab )
{
    bFirstScl   = TRUE;

    FltError    eLastErr = eERR_OK;
    BOOL        bLoop;
    UINT16      nOpcode;            // current opcode

    XclImpChart* pChart = aObjManager.GetCurrChartData();
    if( !pChart )
    {
        bLoop = TRUE;
        while( bLoop )
        {
            bLoop = aIn.StartNextRecord();
            if( bLoop )
                bLoop = (aIn.GetRecId() != 0x000A);
        }
        rProgress.Progress( aIn.Tell() );

        return eERR_OK;
    }

    bLoop = TRUE;
    while( bLoop )
    {
        bLoop = aIn.StartNextRecord();
        nOpcode = aIn.GetRecId();

        rProgress.Progress( aIn.Tell() );

        switch( nOpcode )
        {
            case 0x000A:    ChartEof(); bLoop = FALSE;                          break;  // EOF
            case 0x0014:    Header();                                           break;  // HEADER
            case 0x0015:    Footer();                                           break;  // FOOTER
            case 0x0026:    Leftmargin();                                       break;  // LEFTMARGIN
            case 0x0027:    Rightmargin();                                      break;  // RIGHTMARGIN
            case 0x0028:    Topmargin();                                        break;  // TOPMARGIN
            case 0x0029:    Bottommargin();                                     break;  // BOTTOMMARGIN
            case 0x002A:    Printheaders();                                     break;  // PRINTHEADERS
            case 0x00A0:    ChartScl();                                         break;  // SCL
            case 0x00A1:    if( bOwnTab ) Setup5();                             break;  // SETUP
            case 0x1002:    pChart->ReadChart();                                break;  // CHART
            case 0x1003:    pChart->ReadSeries();                               break;  // SERIES
            case 0x1006:    pChart->ReadDataformat( aIn );                      break;  // DATAFORMAT
            case 0x1007:    pChart->ReadLineformat( aIn );                      break;  // LINEFORMAT
            case 0x1009:    pChart->ReadMarkerformat( aIn );                    break;  // MARKERFORMAT
            case 0x100A:    pChart->ReadAreaformat( aIn );                      break;  // AREAFORMAT
            case 0x100B:    pChart->ReadPieformat( aIn );                       break;  // PIEFORMAT
            case 0x100C:    pChart->ReadAttachedlabel( aIn );                   break;  // ATTACHEDLABEL
            case 0x100D:    pChart->ReadSeriestext( aIn );                      break;  // SERIESTEXT
            case 0x1014:    pChart->ReadChartformat();                          break;  // CHARTFORMAT
            case 0x1015:    pChart->ReadLegend( aIn );                          break;  // LEGEND
            case 0x1017:    pChart = aObjManager.ReplaceChartData( aIn, ctBar );    break;  // BAR
            case 0x1018:    pChart = aObjManager.ReplaceChartData( aIn, ctLine );   break;  // LINE
            case 0x1019:    pChart = aObjManager.ReplaceChartData( aIn, ctPie );    break;  // PIE
            case 0x101A:    pChart = aObjManager.ReplaceChartData( aIn, ctArea );   break;  // AREA
            case 0x101B:    pChart = aObjManager.ReplaceChartData( aIn, ctScatter );break;  // SCATTER
            case 0x101C:    pChart->ReadChartline( aIn );                       break;  // CHARTLINE
            case 0x101D:    pChart->ReadAxis( aIn );                            break;  // AXIS
            case 0x101E:    pChart->ReadTick( aIn );                            break;  // TICK
            case 0x101F:    pChart->ReadValuerange( aIn );                      break;  // VALUERANGE
            case 0x1020:    pChart->ReadCatserrange( aIn );                     break;  // CATSERRANGE
            case 0x1021:    pChart->ReadAxislineformat( aIn );                  break;  // AXISLINEFORMAT
            case 0x1024:    pChart->ReadDefaulttext( aIn );                     break;  // DEFAULTTEXT
            case 0x1025:    pChart->ReadText( aIn );                            break;  // TEXT
            case 0x1026:    pChart->ReadFontx( aIn );                           break;  // FONTX
            case 0x1027:    pChart->ReadObjectlink( aIn );                      break;  // OBJECTLINK
            case 0x1032:    pChart->ReadFrame();                                break;  // FRAME
            case 0x1033:    pChart->ReadBegin();                                break;  // BEGIN
            case 0x1034:    pChart->ReadEnd();                                  break;  // END
            case 0x1035:    pChart->ReadPlotarea();                             break;  // PLOTAREA
            case 0x103A:    pChart->Read3D( aIn );                              break;  // 3D
            case 0x103C:    pChart->ReadPicf( aIn );                            break;  // PICF
            case 0x103D:    pChart->ReadDropbar( aIn );                         break;  // DROPBAR
            case 0x103E:    pChart = aObjManager.ReplaceChartData( aIn, ctNet );    break;  // RADAR
            case 0x103F:    pChart = aObjManager.ReplaceChartData( aIn, ctSurface );break;  // SURFACE
            case 0x1041:    pChart->ReadAxisparent( aIn );                      break;  // AXISPARENT
            case 0x1045:    pChart->ReadSertocrt( aIn );                        break;  // SERTOCRT
            case 0x1046:    pChart->ReadAxesused( aIn );                        break;  // AXESUSED
            case 0x104E:    pChart->ReadIfmt( aIn );                            break;  // IFMT
            case 0x1051:    pChart->ReadAi( aIn, (ExcelToSc8&)*pFormConv );     break;  // AI
            case 0x105D:    pChart->ReadSerfmt( aIn );                          break;  // SERFMT
            case 0x105F:    pChart->Read3DDataformat( aIn );                    break;  // 3DDATAFORMAT
            case 0x1066:    pChart->ReadGelframe( aIn );                        break;  // GELFRAME
        }
    }

    return eLastErr;
}

//___________________________________________________________________