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
|
/*************************************************************************
*
* $RCSfile: xcl97rec.hxx,v $
*
* $Revision: 1.17 $
*
* last change: $Author: dr $ $Date: 2001-05-10 17:26:23 $
*
* 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): _______________________________________
*
*
************************************************************************/
#ifndef _XCL97REC_HXX
#define _XCL97REC_HXX
#include "excrecds.hxx"
#include "xcl97esc.hxx"
#ifndef SC_RANGELST_HXX
#include "rangelst.hxx"
#endif
struct SingleRefData;
struct ScExtTabOptions;
// --- class XclSstList ----------------------------------------------
class XclSstList : public List, public ExcEmptyRec
{
private:
inline XclExpUniString* _First() { return (XclExpUniString*) List::First(); }
inline XclExpUniString* _Next() { return (XclExpUniString*) List::Next(); }
public:
inline XclSstList() {}
virtual ~XclSstList();
UINT32 Add( XclExpUniString* pStr );
virtual void Save( XclExpStream& rStrm );
};
// --- class XclCrn --------------------------------------------------
class XclCrn : public ExcRecord
{
private:
UINT16 nCol;
UINT16 nRow;
UINT8 nId;
protected:
virtual void SaveCont( XclExpStream& rStrm );
virtual void SaveDiff( XclExpStream& rStrm ) = 0;
virtual ULONG GetDiffLen() const = 0;
public:
inline XclCrn( UINT16 nC, UINT16 nR, UINT8 nI ) :
nCol( nC ), nRow( nR ), nId( nI ) {}
inline BOOL IsAddress( UINT16 nC, UINT16 nR )
{ return (nC == nCol) && (nR == nRow); }
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class XclCrnDouble ---------------------------------------------
class XclCrnDouble : public XclCrn
{
private:
double fVal;
virtual void SaveDiff( XclExpStream& rStrm );
virtual ULONG GetDiffLen() const;
protected:
public:
XclCrnDouble( UINT16 nC, UINT16 nR, double fV );
};
// --- class XclCrnString ---------------------------------------------
class XclCrnString : public XclCrn
{
private:
XclExpUniString sText;
virtual void SaveDiff( XclExpStream& rStrm );
virtual ULONG GetDiffLen() const;
protected:
public:
XclCrnString( UINT16 nC, UINT16 nR, const String& rTxt );
};
// --- class XclCrnBool -----------------------------------------------
class XclCrnBool : public XclCrn
{
private:
UINT16 nBool;
virtual void SaveDiff( XclExpStream& rStrm );
virtual ULONG GetDiffLen() const;
protected:
public:
XclCrnBool( UINT16 nC, UINT16 nR, BOOL b );
};
// --- class XclXct --------------------------------------------------
class XclXct : public ExcRecord, private List
{
private:
XclExpUniString sTable;
UINT16 nTabNum;
inline XclCrn* _First() { return (XclCrn*) List::First(); }
inline XclCrn* _Next() { return (XclCrn*) List::Next(); }
BOOL Exists( UINT16 nCol, UINT16 nRow );
inline void Append( XclCrn* pCrn )
{ List::Insert( pCrn, LIST_APPEND ); }
virtual void SaveCont( XclExpStream& rStrm );
protected:
public:
inline XclXct( const String& rTab ) :
sTable( rTab ) { }
virtual ~XclXct();
inline UINT16 GetTableBytes() const { return ( UINT16 ) sTable.GetByteCount(); }
inline const XclExpUniString& GetTableName() const { return sTable; }
inline void SetTableNum( UINT16 nTab ) { nTabNum = nTab; }
void StoreCellRange( RootData& rRoot, const ScRange& rRange );
virtual void Save( XclExpStream& rStrm );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class XclSupbook ----------------------------------------------
class XclExternNameList;
class XclSupbook : public ExcRecord, private List
{
private:
UINT16 nTables;
String sDocName;
XclExpUniString sEncoded;
ULONG nLen;
BOOL bSelf;
XclExternNameList* pExtNameList;
inline XclXct* _First() { return (XclXct*) List::First(); }
inline XclXct* _Next() { return (XclXct*) List::Next(); }
inline XclXct* _Get( UINT16 nTab ) const
{ return (XclXct*) List::GetObject( nTab ); }
virtual void SaveCont( XclExpStream& rStrm );
public:
XclSupbook( UINT16 nTabs ); // own book
XclSupbook( const String& rDocName ); // ext book
virtual ~XclSupbook();
inline const String& GetName() const { return sDocName; }
inline const XclExpUniString& GetEncName() const { return sEncoded; }
const XclExpUniString* GetTableName( UINT16 nIndex ) const;
UINT16 AddTableName( const String& rTabName );
void StoreCellRange( RootData& rRoot, const ScRange& rRange,
UINT16 nXct );
virtual void Save( XclExpStream& rStrm );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
// void SetExtNameList( XclExternNameList* pNew );
// inline XclExternNameList* GetExtNameList( void ) const;
UINT16 GetAddinIndex( const String& rName );
};
// --- class XclSupbookList ------------------------------------------
class XclSupbookList : public ExcEmptyRec, public ExcRoot, private List
{
private:
UINT16* pSupbookBuffer; // supbook number for every xcl table
UINT16* pTableBuffer; // table numbers in supbook
UINT16 nRefdCnt; // array size for p***Buffer
inline XclSupbook* _First() { return (XclSupbook*) List::First(); }
inline XclSupbook* _Next() { return (XclSupbook*) List::Next(); }
inline XclSupbook* _Get( ULONG nInd )
{ return (XclSupbook*) List::GetObject( nInd ); }
inline XclSupbook* GetSupbook( UINT16 nExcTab ) const;
ULONG Append( XclSupbook* pBook );
void AddExt( UINT16 nScTab );
public:
XclSupbookList( RootData* pRoot );
virtual ~XclSupbookList();
// get external document name - expects Excel tabnums
const XclExpUniString* GetDocumentName( UINT16 nExcTab );
// get external table name - expects Excel tabnums
const XclExpUniString* GetTableName( UINT16 nExcTab );
void StoreCellRange( const ScRange& rRange );
void WriteXtiInfo( XclExpStream& rStrm, UINT16 nTabFirst, UINT16 nTabLast );
virtual void Save( XclExpStream& rStrm );
inline UINT16 GetAddinIndex( const String& rName, UINT16 nTab );
};
inline XclSupbook* XclSupbookList::GetSupbook( UINT16 nExcTab ) const
{
return (XclSupbook*) List::GetObject( pSupbookBuffer[ nExcTab ] );
}
inline UINT16 XclSupbookList::GetAddinIndex( const String& rName, UINT16 nTab )
{
XclSupbook* p = _Get( nTab );
if( p )
return p->GetAddinIndex( rName );
else
return 0xFFFF;
}
// --- class XclXti --------------------------------------------------
class XclXti
{
private:
UINT16 nTabFirst;
UINT16 nTabLast;
public:
inline XclXti( UINT16 nFirst, UINT16 nLast ) :
nTabFirst( nFirst ), nTabLast( nLast ) {}
static inline UINT16 GetSize() { return 6; }
inline UINT16 GetTabFirst() const { return nTabFirst; }
inline UINT16 GetTabLast() const { return nTabLast; }
};
// --- class XclExternsheetList --------------------------------------
class XclExternsheetList : public ExcRecord, ExcRoot, private List
{
private:
XclSupbookList aSupbookList;
inline XclXti* _First() { return (XclXti*) List::First(); }
inline XclXti* _Next() { return (XclXti*) List::Next(); }
static inline UINT16 GetVal16( UINT32 nVal )
{ return (nVal <= 0xFFFF) ? (UINT16) nVal : 0xFFFF; }
inline void WriteXtiInfo( XclExpStream& rStrm, XclXti& rXti );
virtual void SaveCont( XclExpStream& rStrm );
public:
XclExternsheetList( RootData* pRoot );
virtual ~XclExternsheetList();
// Xcl design error
inline UINT16 GetCount16() const { return GetVal16( List::Count() ); }
UINT16 Add( XclXti* pXti );
// add new XclXti if not found - expects Excel tabnums
UINT16 Find( UINT16 nTabFirst, UINT16 nTabLast );
// get external document name - expects Excel tabnums
inline const XclExpUniString* GetDocumentName( UINT16 nExcTab )
{ return aSupbookList.GetDocumentName( nExcTab ); }
// get external table name - expects Excel tabnums
inline const XclExpUniString* GetTableName( UINT16 nExcTab )
{ return aSupbookList.GetTableName( nExcTab ); }
// cell contents -> CRN - expects SC tabnums
void StoreCellCont( const SingleRefData& rRef );
void StoreCellRange( const SingleRefData& rRef1, const SingleRefData& rRef2 );
virtual void Save( XclExpStream& rStrm );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
inline UINT16 GetAddinIndex( const String& rName, UINT16 nTab )
{ return aSupbookList.GetAddinIndex( rName, nTab ); }
};
inline void XclExternsheetList::WriteXtiInfo( XclExpStream& rStrm, XclXti& rXti )
{
aSupbookList.WriteXtiInfo( rStrm, rXti.GetTabFirst(), rXti.GetTabLast() );
}
// --- class XclMsodrawing_Base --------------------------------------
class XclMsodrawing_Base
{
protected:
XclEscher* pEscher;
ULONG nStartPos; // position in OffsetMap
ULONG nStopPos; // position in OffsetMap
public:
XclMsodrawing_Base( XclEscher& rEscher );
virtual ~XclMsodrawing_Base();
inline XclEscher* GetEscher() const { return pEscher; }
inline XclEscherEx* GetEscherEx() const { return pEscher->GetEx(); }
void UpdateStopPos();
ULONG GetDataLen() const;
};
// --- class XclMsodrawinggroup --------------------------------------
class XclMsodrawinggroup : public XclMsodrawing_Base, public ExcRecord
{
private:
virtual void SaveCont( XclExpStream& rStrm );
public:
XclMsodrawinggroup( RootData& rRoot,
UINT16 nEscherType = 0 );
virtual ~XclMsodrawinggroup();
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class XclMsodrawing -------------------------------------------
class XclMsodrawing : public XclMsodrawing_Base, public ExcRecord
{
private:
virtual void SaveCont( XclExpStream& rStrm );
public:
XclMsodrawing( RootData& rRoot,
UINT16 nEscherType = 0 );
virtual ~XclMsodrawing();
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class XclObjList ----------------------------------------------
class XclObj;
class XclMsodrawing;
class XclObjList : public List, public ExcEmptyRec
{
private:
XclMsodrawing* pMsodrawingPerSheet;
public:
XclObjList( RootData& rRoot );
virtual ~XclObjList();
XclObj* First() { return (XclObj*) List::First(); }
XclObj* Next() { return (XclObj*) List::Next(); }
/// return: 1-based ObjId
///! count>=0xFFFF: Obj will be deleted, return 0
UINT16 Add( XclObj* );
inline XclMsodrawing* GetMsodrawingPerSheet() { return pMsodrawingPerSheet; }
/// close groups and DgContainer opened in ctor
void EndSheet();
virtual void Save( XclExpStream& rStrm );
};
// --- class XclObj --------------------------------------------------
class XclTxo;
class SdrTextObj;
class XclObj : public ExcRecord
{
protected:
enum FtType {
ftEnd = 0x0000,
// reserved: 0x01-0x03
ftMacro = 0x0004,
ftButton = 0x0005,
ftGmo = 0x0006,
ftCf = 0x0007,
ftPioGrbit = 0x0008,
ftPictFmla = 0x0009,
ftCbls = 0x000A,
ftRbo = 0x000B,
ftSbs = 0x000C,
ftNts = 0x000D,
ftSbsFmla = 0x000E,
ftGboData = 0x000F,
ftEdoData = 0x0010,
ftRboData = 0x0011,
ftCblsdata = 0x0012,
ftLbsData = 0x0013,
ftCbsFmls = 0x0014,
ftCmo = 0x0015
};
enum ObjType {
otGroup = 0x0000,
otLine = 0x0001,
otRectangle = 0x0002,
otOval = 0x0003,
otArc = 0x0004,
otChart = 0x0005,
otText = 0x0006,
otButton = 0x0007,
otPicture = 0x0008,
otPolygon = 0x0009,
// reserved: 0x0A
otCheckBox = 0x000B,
otOptionButtton = 0x000C,
otEditBox = 0x000D,
otLabel = 0x000E,
otDialogBox = 0x000F,
otSpinner = 0x0010,
otScrollBar = 0x0011,
otListBox = 0x0012,
otGroupBox = 0x0013,
otComboBox = 0x0014,
// reserved: 0x15-0x18
otComment = 0x0019,
// reserved: 0x1A-0x1D
otMsOffDrawing = 0x001E,
// SC internal
otUnknown = 0xFFFF // only for temporary use
};
XclMsodrawing* pMsodrawing;
XclMsodrawing* pClientTextbox;
XclTxo* pTxo;
ObjType eObjType;
UINT16 nObjId;
UINT16 nGrbit;
BOOL bFirstOnSheet;
XclObj( ObjType eObjType, RootData& rRoot );
// overwritten for writing MSODRAWING record
virtual void SaveCont( XclExpStream& rStrm );
void SaveTextRecs( XclExpStream& rStrm );
public:
virtual ~XclObj();
inline void SetId( UINT16 nId ) { nObjId = nId; }
inline void SetLocked( BOOL b )
{ b ? nGrbit |= 0x0001 : nGrbit &= ~0x0001; }
inline void SetPrintable( BOOL b )
{ b ? nGrbit |= 0x0010 : nGrbit &= ~0x0010; }
inline void SetAutoFill( BOOL b )
{ b ? nGrbit |= 0x2000 : nGrbit &= ~0x2000; }
inline void SetAutoLine( BOOL b )
{ b ? nGrbit |= 0x4000 : nGrbit &= ~0x4000; }
// set corresponding ObjType
void SetEscherShapeType( UINT16 nType );
inline void SetEscherShapeTypeGroup() { eObjType = otGroup; }
//! actually writes ESCHER_ClientTextbox
void SetText( RootData& rRoot, const SdrTextObj& rObj );
inline void UpdateStopPos();
virtual void Save( XclExpStream& rStrm );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
inline void XclObj::UpdateStopPos()
{
if ( pClientTextbox )
pClientTextbox->UpdateStopPos();
else
pMsodrawing->UpdateStopPos();
}
// --- class XclObjComment -------------------------------------------
class XclObjComment : public XclObj
{
private:
virtual void SaveCont( XclExpStream& rStrm );
public:
XclObjComment( RootData& rRoot,
const ScAddress& rPos, const String& rStr );
virtual ~XclObjComment();
virtual void Save( XclExpStream& rStrm );
virtual ULONG GetLen() const;
};
// --- class XclObjDropDown ------------------------------------------
class XclObjDropDown : public XclObj
{
private:
BOOL bIsFiltered;
virtual void SaveCont( XclExpStream& rStrm );
protected:
public:
XclObjDropDown( RootData& rRoot, const ScAddress& rPos, BOOL bFilt );
virtual ~XclObjDropDown();
virtual ULONG GetLen() const; // GetNum() done by XclObj
};
// --- class XclTxo --------------------------------------------------
class SdrTextObj;
class XclTxo : public ExcRecord
{
friend void XclObjComment::SaveCont( XclExpStream& );
private:
XclExpUniString aText;
UINT16 nGrbit;
UINT16 nRot;
virtual void SaveCont( XclExpStream& rStrm );
public:
XclTxo( const String& rStr );
XclTxo( const SdrTextObj& rEditObj );
virtual ~XclTxo();
virtual void Save( XclExpStream& rStrm );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class XclObjOle -----------------------------------------------
class XclObjOle : public XclObj
{
private:
const SdrObject& rOleObj;
SvStorage* pRootStorage;
virtual void SaveCont( XclExpStream& rStrm );
public:
XclObjOle( RootData& rRoot, const SdrObject& rObj );
virtual ~XclObjOle();
virtual void Save( XclExpStream& rStrm );
virtual ULONG GetLen() const;
};
// --- class XclObjAny -----------------------------------------------
class XclObjAny : public XclObj
{
private:
virtual void SaveCont( XclExpStream& rStrm );
public:
XclObjAny( RootData& rRoot );
virtual ~XclObjAny();
virtual void Save( XclExpStream& rStrm );
virtual ULONG GetLen() const;
};
// --- class XclNoteList ---------------------------------------------
class XclNote;
class XclNoteList : public List, public ExcEmptyRec
{
private:
public:
XclNoteList();
virtual ~XclNoteList();
XclNote* First() { return (XclNote*) List::First(); }
XclNote* Next() { return (XclNote*) List::Next(); }
void Add( XclNote* );
virtual void Save( XclExpStream& rStrm );
};
// --- class XclNote -------------------------------------------------
class XclNote : public ExcRecord
{
private:
XclExpUniString aAuthor;
ScAddress aPos;
UINT16 nGrbit;
UINT16 nObjId;
virtual void SaveCont( XclExpStream& rStrm );
public:
XclNote( RootData& rD, const ScAddress& rPos,
const String& rNoteText, const String& rNoteAuthor );
virtual ~XclNote();
virtual void Save( XclExpStream& rStrm );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class ExcBof8_Base --------------------------------------------
class ExcBof8_Base : public ExcBof_Base
{
protected:
UINT32 nFileHistory; // bfh
UINT32 nLowestBiffVer; // sfo
virtual void SaveCont( XclExpStream& rStrm );
public:
ExcBof8_Base();
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class ExcBofW8 ------------------------------------------------
// Header Record fuer WORKBOOKS
class ExcBofW8 : public ExcBof8_Base
{
public:
ExcBofW8();
};
// --- class ExcBof8 -------------------------------------------------
// Header Record fuer WORKSHEETS
class ExcBof8 : public ExcBof8_Base
{
public:
ExcBof8();
};
// --- class ExcBofC8 ------------------------------------------------
// Header Record fuer CHARTs
class ExcBofC8 : public ExcBof8_Base
{
public:
ExcBofC8();
};
#if 0
//! unused
// --- class ExcLabel8 -----------------------------------------------
class ExcLabel8 : public ExcCell
{
private:
XclExpRichString aText;
virtual void SaveDiff( XclExpStream& rStrm ); // instead of SaveCont()
virtual ULONG GetDiffLen() const;
public:
ExcLabel8(
const ScAddress& rPos,
const ScPatternAttr* pAttr,
RootData& rRoot,
const String& rText );
ExcLabel8(
const ScAddress& rPos,
const ScPatternAttr* pAttr,
RootData& rRoot,
const ScEditCell& rEdCell );
virtual ~ExcLabel8();
virtual UINT16 GetNum() const;
};
#endif
// --- class ExcLabelSst ---------------------------------------------
class ExcLabelSst : public ExcCell
{
private:
UINT32 nIsst; // Index in SST
virtual void SaveDiff( XclExpStream& rStrm ); // instead of SaveCont()
virtual ULONG GetDiffLen() const;
public:
ExcLabelSst(
const ScAddress& rPos,
const ScPatternAttr* pAttr,
RootData& rRoot,
const String& rText );
ExcLabelSst(
const ScAddress& rPos,
const ScPatternAttr* pAttr,
RootData& rRoot,
const ScEditCell& rEdCell );
virtual ~ExcLabelSst();
virtual UINT16 GetNum() const;
};
// --- class ExcXf8 --------------------------------------------------
class ExcXf8 : public ExcXf
{
private:
UINT16 nTrot;
UINT16 nCIndent;
UINT16 nIReadingOrder;
UINT16 nGrbitDiag;
UINT32 nIcvDiagSer;
UINT16 nDgDiag;
BOOL bFShrinkToFit;
BOOL bFMergeCell;
virtual void SaveCont( XclExpStream& rStrm );
public:
ExcXf8( UINT16 nFont, UINT16 nForm,
const ScPatternAttr* pPattAttr,
BOOL& rbLineBreak, BOOL bStyle = FALSE );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class ExcBundlesheet8 -----------------------------------------
class ExcBundlesheet8 : public ExcBundlesheetBase
{
private:
XclExpUniString aUnicodeName;
virtual void SaveCont( XclExpStream& rStrm );
public:
ExcBundlesheet8( RootData& rRootData, UINT16 nTab );
ExcBundlesheet8( const String& rString );
virtual ULONG GetLen() const;
};
// --- class ExcWindow18 ---------------------------------------------
class ExcWindow18 : public ExcRecord
{
private:
UINT16 nCurrTable;
UINT16 nSelTabs;
virtual void SaveCont( XclExpStream& rStrm );
public:
ExcWindow18( RootData& rRootData );
virtual UINT16 GetNum( void ) const;
virtual ULONG GetLen( void ) const;
};
// --- class ExcPane8 ------------------------------------------------
class ExcPane8 : public ExcRecord
{
private:
UINT16 nSplitX;
UINT16 nSplitY;
UINT16 nLeftCol;
UINT16 nTopRow;
UINT16 nActivePane;
virtual void SaveCont( XclExpStream& rStrm );
public:
ExcPane8( const ScExtTabOptions& rTabOptions );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class ExcWindow28 ---------------------------------------------
class ExcWindow28 : public ExcRecord
{
private:
ExcPalette2& rPalette;
ExcPane8* pPaneRec;
UINT32 nGridColorSer;
UINT16 nFlags;
UINT16 nLeftCol;
UINT16 nTopRow;
UINT16 nActiveCol;
UINT16 nActiveRow;
BOOL bHorSplit : 1;
BOOL bVertSplit : 1;
virtual void SaveCont( XclExpStream& rStrm );
public:
ExcWindow28( RootData& rRootData, UINT16 nTab );
virtual ~ExcWindow28();
virtual void Save( XclExpStream& rStrm );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class XclCondFormat -------------------------------------------
class ScConditionalFormat;
class ScCondFormatEntry;
class ScRangeList;
struct RootData;
class XclCf;
class XclCondFormat : public ExcEmptyRec, protected List
{
// writes multiple cf _and_ condfmt records!
private:
const ScConditionalFormat& rCF;
ScRangeList* pRL;
UINT16 nTabNum;
ULONG nComplLen;
inline XclCf* _First() { return (XclCf*) List::First(); }
inline XclCf* _Next() { return (XclCf*) List::Next(); }
void WriteCondfmt( XclExpStream& rStrm );
public:
XclCondFormat( const ScConditionalFormat&, ScRangeList*, RootData& );
// takes ScRangeList, don't use it after this Ctor!
virtual ~XclCondFormat();
virtual void Save( XclExpStream& rStrm );
};
class XclCf : public ExcRecord
{
private:
friend XclCondFormat;
ExcPalette2& rPalette2;
sal_Char* pVarData; // formats + formulas
UINT16 nVarLen; // len of attributes + formulas
UINT16 nFormatLen;
UINT16 nFormLen1;
UINT16 nFormLen2;
UINT8 nType; // formatting type
UINT8 nOp; // formatting operator
BOOL bHasStyle;
UINT32 nStart;
BOOL bHasFont;
UINT32 nFontData1;
UINT32 nFontData2;
UINT32 nFontData3;
UINT32 nFontData4;
UINT32 nFontData5;
UINT8 nFontData6;
BOOL bHasColor;
UINT32 nIcvTextSer;
BOOL bHasLine;
UINT8 nLineData1;
UINT8 nLineData2;
UINT32 nIcvTopSer;
UINT32 nIcvBotSer;
UINT32 nIcvLftSer;
UINT32 nIcvRigSer;
BOOL bHasPattern;
UINT16 nPatt;
UINT32 nIcvForeSer;
UINT32 nIcvBackSer;
virtual void SaveCont( XclExpStream& rStrm );
public:
XclCf( const ScCondFormatEntry&, RootData& );
virtual ~XclCf();
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class XclObproj -----------------------------------------------
class XclObproj : public ExcRecord
{
public:
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class XclDConRef ----------------------------------------------
class XclDConRef : public ExcRecord
{
private:
ScRange aSourceRange;
XclExpUniString* pWorkbook;
virtual void SaveCont( XclExpStream& rStrm );
public:
XclDConRef( const ScRange& rSrcR, const String& rWB );
virtual ~XclDConRef();
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// --- class XclExpCellMerging ---------------------------------------
struct XclExpMergedCell
{
UINT16 nCol1;
UINT16 nCol2;
UINT16 nRow1;
UINT16 nRow2;
UINT16 nXF;
inline XclExpMergedCell( UINT16 nC1, UINT16 nC2, UINT16 nR1, UINT16 nR2, UINT16 _nXF ) :
nCol1( nC1 ), nCol2( nC2 ), nRow1( nR1 ), nRow2( nR2 ), nXF( _nXF ) {}
};
inline XclExpStream& operator<<( XclExpStream& rStrm, const XclExpMergedCell& rCell )
{
return (rStrm << rCell.nRow1 << rCell.nRow2 << rCell.nCol1 << rCell.nCol2);
}
class XclExpCellMerging : public ExcEmptyRec
{
private:
List aCellList;
inline XclExpMergedCell* FirstCell() { return (XclExpMergedCell*) aCellList.First(); }
inline XclExpMergedCell* NextCell() { return (XclExpMergedCell*) aCellList.Next(); }
inline XclExpMergedCell* GetCell( ULONG nIndex )
{ return (XclExpMergedCell*) aCellList.GetObject( nIndex ); }
inline void AppendCell( XclExpMergedCell* pNewCell )
{ aCellList.Insert( pNewCell, LIST_APPEND ); }
public:
void Append( UINT16 nCol1, UINT16 nColCnt, UINT16 nRow1, UINT16 nRowCnt, UINT16 nXF );
BOOL FindNextMerge( const ScAddress& rPos, UINT16& rnCol );
BOOL FindMergeBaseXF( const ScAddress& rPos, UINT16& rnXF, UINT16& rnColCount );
inline BOOL FindMergeBaseXF( const ScAddress& rPos, UINT16& rnXF );
virtual void Save( XclExpStream& rStrm );
};
inline BOOL XclExpCellMerging::FindMergeBaseXF( const ScAddress& rPos, UINT16& rnXF )
{
UINT16 nCols;
return FindMergeBaseXF( rPos, rnXF, nCols );
}
// ---- class XclCodename --------------------------------------------
class XclCodename : public ExcRecord
{
private:
XclExpUniString aName;
virtual void SaveCont( XclExpStream& rStrm );
public:
XclCodename( const String& );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// ---- class XclBuildInName -----------------------------------------
class XclBuildInName : public ExcNameListEntry, private ExcRoot
{
private:
UINT8 nKey;
UINT8* pData;
UINT16 nFormLen;
UINT16 nTabNum;
ScRangeList aRL;
inline ScRange* _First() { return (ScRange*) aRL.First(); }
inline ScRange* _Next() { return (ScRange*) aRL.Next(); }
virtual void SaveCont( XclExpStream& rStrm );
protected:
void CreateFormula( void );
public:
XclBuildInName( RootData*, UINT16 nTabNum, UINT8 nKey );
virtual ~XclBuildInName();
inline void Append( const ScRange& rNew ) { aRL.Append( rNew ); }
virtual void Save( XclExpStream& rStrm );
virtual ULONG GetLen() const;
};
// ---- class XclPrintRange, class XclTitleRange ---------------------
class XclPrintRange : public XclBuildInName
{
public:
XclPrintRange( RootData*, UINT16 nTabNum, ScDocument& rDoc );
};
class XclTitleRange : public XclBuildInName
{
public:
XclTitleRange( RootData*, UINT16 nTabNum, ScDocument& rDoc );
};
// ---- Scenarios ----------------------------------------------------
// - ExcEScenarioCell a cell of a scenario range
// - ExcEScenario all ranges of a scenario table
// - ExcEScenarioManager list of scenario tables
class ExcEScenarioCell
{
private:
UINT16 nCol;
UINT16 nRow;
XclExpUniString sText;
protected:
public:
ExcEScenarioCell( UINT16 nC, UINT16 nR, const String& rTxt );
inline ULONG GetStringBytes()
{ return sText.GetByteCount(); }
void WriteAddress( XclExpStream& rStrm );
void WriteText( XclExpStream& rStrm );
};
class ExcEScenario : public ExcRecord, private List
{
private:
ULONG nRecLen;
XclExpUniString sName;
XclExpUniString sComment;
static XclExpUniString sUsername;
inline ExcEScenarioCell* _First() { return (ExcEScenarioCell*) List::First(); }
inline ExcEScenarioCell* _Next() { return (ExcEScenarioCell*) List::Next(); }
BOOL Append( UINT16 nCol, UINT16 nRow, const String& rTxt );
virtual void SaveCont( XclExpStream& rStrm );
protected:
public:
ExcEScenario( ScDocument& rDoc, UINT16 nTab );
virtual ~ExcEScenario();
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
class ExcEScenarioManager : public ExcRecord, private List
{
private:
UINT16 nActive;
inline ExcEScenario* _First() { return (ExcEScenario*) List::First(); }
inline ExcEScenario* _Next() { return (ExcEScenario*) List::Next(); }
inline void Append( ExcEScenario* pScen )
{ List::Insert( pScen, LIST_APPEND ); }
virtual void SaveCont( XclExpStream& rStrm );
protected:
public:
ExcEScenarioManager( ScDocument& rDoc, UINT16 nTab );
virtual ~ExcEScenarioManager();
virtual void Save( XclExpStream& rStrm );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
// ---- class XclHlink -----------------------------------------------
class SvMemoryStream;
class SvxURLField;
class XclHlink : public ExcRecord
{
private:
UINT16 nColFirst;
UINT16 nRowFirst;
UINT32 nFlags;
String* pRepr;
static const BYTE pStaticData[];
SvMemoryStream* pVarData;
static inline ULONG GetStaticLen(); // -> xcl97rec.cxx!
inline ULONG GetVarLen() const; // -> xcl97rec.cxx!
virtual void SaveCont( XclExpStream& rStrm );
public:
XclHlink( RootData& rRootData, const SvxURLField& rField );
virtual ~XclHlink();
inline void SetPosition( const ScAddress& rPos );
inline const String* GetRepr() const { return pRepr; }
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
inline void XclHlink::SetPosition( const ScAddress& rPos )
{
nColFirst = rPos.Col();
nRowFirst = rPos.Row();
}
// ---- class XclProtection ------------------------------------------
class XclProtection : public ExcDummyRec
{
// replacement for records PROTECT, SCENPROTECT, OBJPROTECT...
private:
static const BYTE pMyData[];
static const ULONG nMyLen;
public:
virtual ULONG GetLen( void ) const;
virtual const BYTE* GetData( void ) const;
};
// ---- class XclBGPic -----------------------------------------------
class XclBGPic : public ExcEmptyRec
{
private:
const Graphic* pGr;
public:
XclBGPic( RootData& );
virtual ~XclBGPic();
virtual void Save( XclExpStream& rStrm );
};
// ---- class XclExpPageBreaks8 --------------------------------------
class XclExpPageBreaks8 : public XclExpPageBreaks
{
private:
UINT16 nRangeMax;
virtual void SaveCont( XclExpStream& rStrm );
public:
XclExpPageBreaks8( RootData& rRootData, UINT16 nScTab, ExcPBOrientation eOrient );
virtual ~XclExpPageBreaks8();
virtual ULONG GetLen() const;
};
// ---- class XclExternName ------------------------------------------
class XclExternName : public ExcRecord
{
private:
String aName;
XclExpUniString* pExpStr;
virtual void SaveCont( XclExpStream& rStrm );
public:
XclExternName( const String& );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
inline BOOL operator ==( const String& rRef ) const
{ return aName == rRef; }
};
class XclExternNameList : protected List
{
private:
inline XclExternName* First( void ) { return ( XclExternName* ) List::First(); }
inline XclExternName* Next( void ) { return ( XclExternName* ) List::Next(); }
public:
virtual ~XclExternNameList();
UINT16 GetIndex( const String& rName );
void Save( XclExpStream& rStrm );
};
// ---- class XclExpWebQuery -----------------------------------------
class XclExpWebQuery : public ExcEmptyRec
{
private:
XclExpUniString aRangeName;
XclExpUniString aURL;
XclExpUniString* pQryTables;
INT16 nRefresh;
BOOL bEntireDoc;
// mode 1 - entire document: pQryTables==NULL, bEntireDoc==TRUE
// mode 2 - all tables: pQryTables==NULL, bEntireDoc==FALSE
// mode 3 - range list: pQryTables!=NULL, bEntireDoc==FALSE
public:
XclExpWebQuery(
const String& rRangeName,
const String& rURL,
const String& rSource,
sal_Int32 nRefrSecs );
virtual ~XclExpWebQuery();
virtual void Save( XclExpStream& rStrm );
};
#endif // _XCL97REC_HXX
|