xref: /aoo41x/main/sw/source/filter/ww1/w1struct.hxx (revision 1d2dbeb0)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef W1STRUCT_HXX
25cdf0e10cSrcweir #define W1STRUCT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // star view
28cdf0e10cSrcweir #include <string.h>
29cdf0e10cSrcweir #include <tools/solar.h>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class Ww1Shell;
32cdf0e10cSrcweir class Ww1Manager;
33cdf0e10cSrcweir 
34cdf0e10cSrcweir struct W1_FIB /////////////////////////////////////////////////////////
35cdf0e10cSrcweir {
36cdf0e10cSrcweir 	SVBT16 wIdent;// 0x0 int magic number
wIdentGetW1_FIB37cdf0e10cSrcweir 	sal_uInt16 wIdentGet() {
38cdf0e10cSrcweir 		return SVBT16ToShort(wIdent); }
39cdf0e10cSrcweir 	SVBT16 nFib;// 0x2 FIB version written
nFibGetW1_FIB40cdf0e10cSrcweir 	sal_uInt16 nFibGet() {
41cdf0e10cSrcweir 		return SVBT16ToShort(nFib); }
42cdf0e10cSrcweir 	SVBT16 nProduct;// 0x4 product version written by
nProductGetW1_FIB43cdf0e10cSrcweir 	sal_uInt16 nProductGet() {
44cdf0e10cSrcweir 		return SVBT16ToShort(nProduct); }
45cdf0e10cSrcweir 	SVBT16 nlocale;// 0x6 language stamp---localized version;
nlocaleGetW1_FIB46cdf0e10cSrcweir 	sal_uInt16 nlocaleGet() {
47cdf0e10cSrcweir 		return SVBT16ToShort(nlocale); }
48cdf0e10cSrcweir 	SVBT16 pnNext;// 0x8
pnNextGetW1_FIB49cdf0e10cSrcweir 	sal_uInt16 pnNextGet() {
50cdf0e10cSrcweir 		return SVBT16ToShort(pnNext); }
51cdf0e10cSrcweir 	SVBT16 fFlags;
fFlagsGetW1_FIB52cdf0e10cSrcweir 	sal_uInt16 fFlagsGet() {
53cdf0e10cSrcweir 		return SVBT16ToShort(fFlags); }
54cdf0e10cSrcweir 	// SVBT16 fDot :1;// 0xa	0001
fDotGetW1_FIB55cdf0e10cSrcweir 	sal_Bool fDotGet() {
56cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 0) & 1); }
57cdf0e10cSrcweir 	// SVBT16 fGlsy :1;//		0002
fGlsyGetW1_FIB58cdf0e10cSrcweir 	sal_Bool fGlsyGet() {
59cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 1) & 1); }
60cdf0e10cSrcweir 	// SVBT16 fComplex :1;//		0004 when 1, file is in complex, fast-saved format.
fComplexGetW1_FIB61cdf0e10cSrcweir 	sal_Bool fComplexGet() {
62cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 2) & 1); }
63cdf0e10cSrcweir 	// SVBT16 fHasPic :1;//		0008 file contains 1 or more pictures
fHasPicGetW1_FIB64cdf0e10cSrcweir 	sal_Bool fHasPicGet() {
65cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 3) & 1); }
66cdf0e10cSrcweir 	// SVBT16 cQuickSaves :4;//		00F0 count of times file was quicksaved
cQuickSavesGetW1_FIB67cdf0e10cSrcweir 	sal_uInt16 cQuickSavesGet() {
68cdf0e10cSrcweir 		return (sal_uInt16)((fFlagsGet() >> 4) & 0xf); }
69cdf0e10cSrcweir 	// SVBT16 u1 :8;//		FF00 unused
u1GetW1_FIB70cdf0e10cSrcweir 	sal_uInt16 u1Get() {
71cdf0e10cSrcweir 		return (sal_uInt16)((fFlagsGet() >> 8) & 0xff); }
72cdf0e10cSrcweir 	SVBT16 nFibBack;// 0xc
nFibBackGetW1_FIB73cdf0e10cSrcweir 	sal_uInt16 nFibBackGet() {
74cdf0e10cSrcweir 		return SVBT16ToShort(nFibBack); }
75cdf0e10cSrcweir 	SVBT16 u2[5];// 0xe reserved
76cdf0e10cSrcweir 	SVBT32 fcMin;// 0x18 file offset of first character of text
fcMinGetW1_FIB77cdf0e10cSrcweir 	sal_uLong fcMinGet() {
78cdf0e10cSrcweir 		return SVBT32ToUInt32(fcMin); }
79cdf0e10cSrcweir 	SVBT32 fcMac;// 0x1c file offset of last character of text + 1
fcMacGetW1_FIB80cdf0e10cSrcweir 	sal_uLong fcMacGet() {
81cdf0e10cSrcweir 		return SVBT32ToUInt32(fcMac); }
82cdf0e10cSrcweir 	SVBT32 cbMac;// 0x20 file offset of last byte written to file + 1.
cbMacGetW1_FIB83cdf0e10cSrcweir 	sal_uLong cbMacGet() {
84cdf0e10cSrcweir 		return SVBT32ToUInt32(cbMac); }
85cdf0e10cSrcweir 	SVBT32 u4[4];// 0x24 reserved
86cdf0e10cSrcweir 	SVBT32 ccpText;// 0x34 length of main document text stream
ccpTextGetW1_FIB87cdf0e10cSrcweir 	sal_uLong ccpTextGet() {
88cdf0e10cSrcweir 		return SVBT32ToUInt32(ccpText); }
89cdf0e10cSrcweir 	SVBT32 ccpFtn;// 0x38 length of footnote subdocument text stream
ccpFtnGetW1_FIB90cdf0e10cSrcweir 	sal_uLong ccpFtnGet() {
91cdf0e10cSrcweir 		return SVBT32ToUInt32(ccpFtn); }
92cdf0e10cSrcweir 	SVBT32 ccpHdd;// 0x3c length of header subdocument text stream
ccpHddGetW1_FIB93cdf0e10cSrcweir 	sal_uLong ccpHddGet() {
94cdf0e10cSrcweir 		return SVBT32ToUInt32(ccpHdd); }
95cdf0e10cSrcweir 	SVBT32 ccpMcr;// 0x40 length of macro subdocument text stream
ccpMcrGetW1_FIB96cdf0e10cSrcweir 	sal_uLong ccpMcrGet() {
97cdf0e10cSrcweir 		return SVBT32ToUInt32(ccpMcr); }
98cdf0e10cSrcweir 	SVBT32 ccpAtn;// 0x44 length of annotation subdocument text stream
ccpAtnGetW1_FIB99cdf0e10cSrcweir 	sal_uLong ccpAtnGet() {
100cdf0e10cSrcweir 		return SVBT32ToUInt32(ccpAtn); }
101cdf0e10cSrcweir 	SVBT32 cp5[4];// 0x48
102cdf0e10cSrcweir 	SVBT32 fcStshfOrig;// 0x58 file offset of original allocation for STSH in file
fcStshfOrigGetW1_FIB103cdf0e10cSrcweir 	sal_uLong fcStshfOrigGet() {
104cdf0e10cSrcweir 		return SVBT32ToUInt32(fcStshfOrig); }
105cdf0e10cSrcweir 	SVBT16 cbStshfOrig;// 0x5c count of bytes of original STSH allocation
cbStshfOrigGetW1_FIB106cdf0e10cSrcweir 	sal_uInt16 cbStshfOrigGet() {
107cdf0e10cSrcweir 		return SVBT16ToShort(cbStshfOrig); }
108cdf0e10cSrcweir 	SVBT32 fcStshf;// 0x5e file offset of STSH in file.
fcStshfGetW1_FIB109cdf0e10cSrcweir 	sal_uLong fcStshfGet() {
110cdf0e10cSrcweir 		return SVBT32ToUInt32(fcStshf); }
111cdf0e10cSrcweir 	SVBT16 cbStshf;// 0x62 count of bytes of current STSH allocation
cbStshfGetW1_FIB112cdf0e10cSrcweir 	sal_uInt16 cbStshfGet() {
113cdf0e10cSrcweir 		return SVBT16ToShort(cbStshf); }
114cdf0e10cSrcweir 	SVBT32 fcPlcffndRef;// 0x64 file offset of footnote reference PLC.
fcPlcffndRefGetW1_FIB115cdf0e10cSrcweir 	sal_uLong fcPlcffndRefGet() {
116cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcffndRef); }
117cdf0e10cSrcweir 	SVBT16 cbPlcffndRef;// 0x68 count of bytes of footnote reference PLC
cbPlcffndRefGetW1_FIB118cdf0e10cSrcweir 	sal_uInt16 cbPlcffndRefGet() {
119cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcffndRef); }
120cdf0e10cSrcweir 							// == 0 if no footnotes defined in document.
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 	SVBT32 fcPlcffndTxt;// 0x6a file offset of footnote text PLC.
fcPlcffndTxtGetW1_FIB123cdf0e10cSrcweir 	sal_uLong fcPlcffndTxtGet() {
124cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcffndTxt); }
125cdf0e10cSrcweir 	SVBT16 cbPlcffndTxt;// 0x6e count of bytes of footnote text PLC.
cbPlcffndTxtGetW1_FIB126cdf0e10cSrcweir 	sal_uInt16 cbPlcffndTxtGet() {
127cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcffndTxt); }
128cdf0e10cSrcweir 							// == 0 if no footnotes defined in document
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 	SVBT32 fcPlcfandRef;// 0x70 file offset of annotation reference PLC.
fcPlcfandRefGetW1_FIB131cdf0e10cSrcweir 	sal_uLong fcPlcfandRefGet() {
132cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfandRef); }
133cdf0e10cSrcweir 	SVBT16 cbPlcfandRef;// 0x74 count of bytes of annotation reference PLC.
cbPlcfandRefGetW1_FIB134cdf0e10cSrcweir 	sal_uInt16 cbPlcfandRefGet() {
135cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfandRef); }
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	SVBT32 fcPlcfandTxt;// 0x76 file offset of annotation text PLC.
fcPlcfandTxtGetW1_FIB138cdf0e10cSrcweir 	sal_uLong fcPlcfandTxtGet() {
139cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfandTxt); }
140cdf0e10cSrcweir 	SVBT16 cbPlcfandTxt;// 0x7a count of bytes of the annotation text PLC
cbPlcfandTxtGetW1_FIB141cdf0e10cSrcweir 	sal_uInt16 cbPlcfandTxtGet() {
142cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfandTxt); }
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 	SVBT32 fcPlcfsed;// 8x7c file offset of section descriptor PLC.
fcPlcfsedGetW1_FIB145cdf0e10cSrcweir 	sal_uLong fcPlcfsedGet() {
146cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfsed); }
147cdf0e10cSrcweir 	SVBT16 cbPlcfsed;// 0x80 count of bytes of section descriptor PLC.
cbPlcfsedGetW1_FIB148cdf0e10cSrcweir 	sal_uInt16 cbPlcfsedGet() {
149cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfsed); }
150cdf0e10cSrcweir 
151cdf0e10cSrcweir 	SVBT32 fcPlcfpgd;// 0x82 file offset of paragraph descriptor PLC
fcPlcfpgdGetW1_FIB152cdf0e10cSrcweir 	sal_uLong fcPlcfpgdGet() {
153cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfpgd); }
154cdf0e10cSrcweir 	SVBT16 cbPlcfpgd;// 0x86 count of bytes of paragraph descriptor PLC.
cbPlcfpgdGetW1_FIB155cdf0e10cSrcweir 	sal_uInt16 cbPlcfpgdGet() {
156cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfpgd); }
157cdf0e10cSrcweir 							// ==0 if file was never repaginated
158cdf0e10cSrcweir 							// Should not be written by third party creators
159cdf0e10cSrcweir 
160cdf0e10cSrcweir 	SVBT32 fcPlcfphe;// 0x88 file offset of PLC of paragraph heights.
fcPlcfpheGetW1_FIB161cdf0e10cSrcweir 	sal_uLong fcPlcfpheGet() {
162cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfphe); }
163cdf0e10cSrcweir 	SVBT16 cbPlcfphe;// 0x8c count of bytes of paragraph height PLC.
cbPlcfpheGetW1_FIB164cdf0e10cSrcweir 	sal_uInt16 cbPlcfpheGet() {
165cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfphe); }
166cdf0e10cSrcweir 							// ==0 when file is non-complex.
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 	SVBT32 fcSttbfglsy;// 0x8e file offset of glossary string table.
fcSttbfglsyGetW1_FIB169cdf0e10cSrcweir 	sal_uLong fcSttbfglsyGet() {
170cdf0e10cSrcweir 		return SVBT32ToUInt32(fcSttbfglsy); }
171cdf0e10cSrcweir 	SVBT16 cbSttbfglsy;// 0x92 count of bytes of glossary string table.
cbSttbfglsyGetW1_FIB172cdf0e10cSrcweir 	sal_uInt16 cbSttbfglsyGet() {
173cdf0e10cSrcweir 		return SVBT16ToShort(cbSttbfglsy); }
174cdf0e10cSrcweir 							// == 0 for non-glossary documents.
175cdf0e10cSrcweir 							// !=0 for glossary documents.
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	SVBT32 fcPlcfglsy;// 0x94 file offset of glossary PLC.
fcPlcfglsyGetW1_FIB178cdf0e10cSrcweir 	sal_uLong fcPlcfglsyGet() {
179cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfglsy); }
180cdf0e10cSrcweir 	SVBT16 cbPlcfglsy;// 0x98 count of bytes of glossary PLC.
cbPlcfglsyGetW1_FIB181cdf0e10cSrcweir 	sal_uInt16 cbPlcfglsyGet() {
182cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfglsy); }
183cdf0e10cSrcweir 							// == 0 for non-glossary documents.
184cdf0e10cSrcweir 							// !=0 for glossary documents.
185cdf0e10cSrcweir 
186cdf0e10cSrcweir 	SVBT32 fcPlcfhdd;// 0x9a byte offset of header PLC.
fcPlcfhddGetW1_FIB187cdf0e10cSrcweir 	sal_uLong fcPlcfhddGet() {
188cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfhdd); }
189cdf0e10cSrcweir 	SVBT16 cbPlcfhdd;// 0x9e count of bytes of header PLC.
cbPlcfhddGetW1_FIB190cdf0e10cSrcweir 	sal_uInt16 cbPlcfhddGet() {
191cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfhdd); }
192cdf0e10cSrcweir 							// == 0 if document contains no headers
193cdf0e10cSrcweir 
194cdf0e10cSrcweir 	SVBT32 fcPlcfbteChpx;// 0xa0 file offset of character property bin table.PLC.
fcPlcfbteChpxGetW1_FIB195cdf0e10cSrcweir 	sal_uLong fcPlcfbteChpxGet() {
196cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfbteChpx); }
197cdf0e10cSrcweir 	SVBT16 cbPlcfbteChpx;// 0xa4 count of bytes of character property bin table PLC.
cbPlcfbteChpxGetW1_FIB198cdf0e10cSrcweir 	sal_uInt16 cbPlcfbteChpxGet() {
199cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfbteChpx); }
200cdf0e10cSrcweir 
201cdf0e10cSrcweir 	SVBT32 fcPlcfbtePapx;// 0xa6 file offset of paragraph property bin table.PLC.
fcPlcfbtePapxGetW1_FIB202cdf0e10cSrcweir 	sal_uLong fcPlcfbtePapxGet() {
203cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfbtePapx); }
204cdf0e10cSrcweir 	SVBT16 cbPlcfbtePapx;// 0xaa count of bytes of paragraph property bin table PLC.
cbPlcfbtePapxGetW1_FIB205cdf0e10cSrcweir 	sal_uInt16 cbPlcfbtePapxGet() {
206cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfbtePapx); }
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 	SVBT32 fcPlcfsea;// 0xac file offset of PLC reserved for private use. The SEA is 6 bytes long.
fcPlcfseaGetW1_FIB209cdf0e10cSrcweir 	sal_uLong fcPlcfseaGet() {
210cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfsea); }
211cdf0e10cSrcweir 	SVBT16 cbPlcfsea;// 0xb0	count of bytes of private use PLC.
cbPlcfseaGetW1_FIB212cdf0e10cSrcweir 	sal_uInt16 cbPlcfseaGet() {
213cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfsea); }
214cdf0e10cSrcweir 
215cdf0e10cSrcweir 	SVBT32 fcSttbfffn;// 0xb2	file offset of font information STTBF. See the FFN file structure definition.
fcSttbfffnGetW1_FIB216cdf0e10cSrcweir 	sal_uLong fcSttbfffnGet() {
217cdf0e10cSrcweir 		return SVBT32ToUInt32(fcSttbfffn); }
218cdf0e10cSrcweir 	SVBT16 cbSttbfffn;// 0xb6	count of bytes in sttbfffn.
cbSttbfffnGetW1_FIB219cdf0e10cSrcweir 	sal_uInt16 cbSttbfffnGet() {
220cdf0e10cSrcweir 		return SVBT16ToShort(cbSttbfffn); }
221cdf0e10cSrcweir 
222cdf0e10cSrcweir 	SVBT32 fcPlcffldMom;// 0xb8	offset in doc stream to the PLC of field positions in the main document.
fcPlcffldMomGetW1_FIB223cdf0e10cSrcweir 	sal_uLong fcPlcffldMomGet() {
224cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcffldMom); }
225cdf0e10cSrcweir 	SVBT16 cbPlcffldMom;// 0xbc
cbPlcffldMomGetW1_FIB226cdf0e10cSrcweir 	sal_uInt16 cbPlcffldMomGet() {
227cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcffldMom); }
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 	SVBT32 fcPlcffldHdr;// 0xbe	offset in doc stream to the PLC of field positions in the header subdocument.
fcPlcffldHdrGetW1_FIB230cdf0e10cSrcweir 	sal_uLong fcPlcffldHdrGet() {
231cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcffldHdr); }
232cdf0e10cSrcweir 	SVBT16 cbPlcffldHdr;// 0xc2
cbPlcffldHdrGetW1_FIB233cdf0e10cSrcweir 	sal_uInt16 cbPlcffldHdrGet() {
234cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcffldHdr); }
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 	SVBT32 fcPlcffldFtn;// 0xc4	offset in doc stream to the PLC of field positions in the footnote subdocument.
fcPlcffldFtnGetW1_FIB237cdf0e10cSrcweir 	sal_uLong fcPlcffldFtnGet() {
238cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcffldFtn); }
239cdf0e10cSrcweir 	SVBT16 cbPlcffldFtn;// 0xc8
cbPlcffldFtnGetW1_FIB240cdf0e10cSrcweir 	sal_uInt16 cbPlcffldFtnGet() {
241cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcffldFtn); }
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 	SVBT32 fcPlcffldAtn;// 0xca	offset in doc stream to the PLC of field positions in the annotation subdocument.
fcPlcffldAtnGetW1_FIB244cdf0e10cSrcweir 	sal_uLong fcPlcffldAtnGet() {
245cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcffldAtn); }
246cdf0e10cSrcweir 	SVBT16 cbPlcffldAtn;// 0xce
cbPlcffldAtnGetW1_FIB247cdf0e10cSrcweir 	sal_uInt16 cbPlcffldAtnGet() {
248cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcffldAtn); }
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 	SVBT32 fcPlcffldMcr;// 0xd0	offset in doc stream to the PLC of field positions in the macro subdocument.
fcPlcffldMcrGetW1_FIB251cdf0e10cSrcweir 	sal_uLong fcPlcffldMcrGet() {
252cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcffldMcr); }
253cdf0e10cSrcweir 	SVBT16 cbPlcffldMcr;// 0xd4
cbPlcffldMcrGetW1_FIB254cdf0e10cSrcweir 	sal_uInt16 cbPlcffldMcrGet() {
255cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcffldMcr); }
256cdf0e10cSrcweir 
257cdf0e10cSrcweir 	SVBT32 fcSttbfbkmk;// 0xd6 offset in document stream of the STTBF that records bookmark names in the main document
fcSttbfbkmkGetW1_FIB258cdf0e10cSrcweir 	sal_uLong fcSttbfbkmkGet() {
259cdf0e10cSrcweir 		return SVBT32ToUInt32(fcSttbfbkmk); }
260cdf0e10cSrcweir 	SVBT16 cbSttbfbkmk;// 0xda
cbSttbfbkmkGetW1_FIB261cdf0e10cSrcweir 	sal_uInt16 cbSttbfbkmkGet() {
262cdf0e10cSrcweir 		return SVBT16ToShort(cbSttbfbkmk); }
263cdf0e10cSrcweir 
264cdf0e10cSrcweir 	SVBT32 fcPlcfbkf;// 0xdc offset in document stream of the PLCF that records the beginning CP offsets of bookmarks in the main document. See BKF
fcPlcfbkfGetW1_FIB265cdf0e10cSrcweir 	sal_uLong fcPlcfbkfGet() {
266cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfbkf); }
267cdf0e10cSrcweir 	SVBT16 cbPlcfbkf;// 0xe0
cbPlcfbkfGetW1_FIB268cdf0e10cSrcweir 	sal_uInt16 cbPlcfbkfGet() {
269cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfbkf); }
270cdf0e10cSrcweir 
271cdf0e10cSrcweir 	SVBT32 fcPlcfbkl;// 0xe2 offset in document stream of the PLCF that records the ending CP offsets of bookmarks recorded in the main document. See the BKL structure definition.
fcPlcfbklGetW1_FIB272cdf0e10cSrcweir 	sal_uLong fcPlcfbklGet() {
273cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfbkl); }
274cdf0e10cSrcweir 	SVBT16 cbPlcfbkl;// 0xe6 SVBT16
cbPlcfbklGetW1_FIB275cdf0e10cSrcweir 	sal_uInt16 cbPlcfbklGet() {
276cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfbkl); }
277cdf0e10cSrcweir 
278cdf0e10cSrcweir 	SVBT32 fcCmds;// 0xe8 FC
fcCmdsGetW1_FIB279cdf0e10cSrcweir 	sal_uLong fcCmdsGet() {
280cdf0e10cSrcweir 		return SVBT32ToUInt32(fcCmds); }
281cdf0e10cSrcweir 	SVBT16 cbCmds;// 0xec
cbCmdsGetW1_FIB282cdf0e10cSrcweir 	sal_uInt16 cbCmdsGet() {
283cdf0e10cSrcweir 		return SVBT16ToShort(cbCmds); }
284cdf0e10cSrcweir 
285cdf0e10cSrcweir 	SVBT32 fcPlcmcr;// 0xee FC
fcPlcmcrGetW1_FIB286cdf0e10cSrcweir 	sal_uLong fcPlcmcrGet() {
287cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcmcr); }
288cdf0e10cSrcweir 	SVBT16 cbPlcmcr;// 0xf2
cbPlcmcrGetW1_FIB289cdf0e10cSrcweir 	sal_uInt16 cbPlcmcrGet() {
290cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcmcr); }
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 	SVBT32 fcSttbfmcr;// 0xf4 FC
fcSttbfmcrGetW1_FIB293cdf0e10cSrcweir 	sal_uLong fcSttbfmcrGet() {
294cdf0e10cSrcweir 		return SVBT32ToUInt32(fcSttbfmcr); }
295cdf0e10cSrcweir 	SVBT16 cbSttbfmcr;// 0xf8
cbSttbfmcrGetW1_FIB296cdf0e10cSrcweir 	sal_uInt16 cbSttbfmcrGet() {
297cdf0e10cSrcweir 		return SVBT16ToShort(cbSttbfmcr); }
298cdf0e10cSrcweir 
299cdf0e10cSrcweir 	SVBT32 fcPrEnv;// 0xfa
fcPrEnvGetW1_FIB300cdf0e10cSrcweir 	sal_uLong fcPrEnvGet() {
301cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPrEnv); }
302cdf0e10cSrcweir 	SVBT16 cbPrEnv;// 0xfe
cbPrEnvGetW1_FIB303cdf0e10cSrcweir 	sal_uInt16 cbPrEnvGet() {
304cdf0e10cSrcweir 		return SVBT16ToShort(cbPrEnv); }
305cdf0e10cSrcweir 
306cdf0e10cSrcweir 	SVBT32 fcWss;// 0x100 file offset of Window Save State data structure. See WSS.
fcWssGetW1_FIB307cdf0e10cSrcweir 	sal_uLong fcWssGet() {
308cdf0e10cSrcweir 		return SVBT32ToUInt32(fcWss); }
309cdf0e10cSrcweir 	SVBT16 cbWss;// 0x100 count of bytes of WSS. ==0 if unable to store the window state.
cbWssGetW1_FIB310cdf0e10cSrcweir 	sal_uInt16 cbWssGet() {
311cdf0e10cSrcweir 		return SVBT16ToShort(cbWss); }
312cdf0e10cSrcweir 
313cdf0e10cSrcweir 	SVBT32 fcDop;// 0x106 file offset of document property data structure.
fcDopGetW1_FIB314cdf0e10cSrcweir 	sal_uLong fcDopGet() {
315cdf0e10cSrcweir 		return SVBT32ToUInt32(fcDop); }
316cdf0e10cSrcweir 	SVBT16 cbDop;// 0x10a count of bytes of document properties.
cbDopGetW1_FIB317cdf0e10cSrcweir 	sal_uInt16 cbDopGet() {
318cdf0e10cSrcweir 		return SVBT16ToShort(cbDop); }
319cdf0e10cSrcweir 
320cdf0e10cSrcweir 
321cdf0e10cSrcweir 	SVBT32 fcSttbfAssoc;// 0x10c offset to STTBF of associated strings. See STTBFASSOC.
fcSttbfAssocGetW1_FIB322cdf0e10cSrcweir 	sal_uLong fcSttbfAssocGet() {
323cdf0e10cSrcweir 		return SVBT32ToUInt32(fcSttbfAssoc); }
324cdf0e10cSrcweir 	SVBT16 cbSttbfAssoc;// 0x110
cbSttbfAssocGetW1_FIB325cdf0e10cSrcweir 	sal_uInt16 cbSttbfAssocGet() {
326cdf0e10cSrcweir 		return SVBT16ToShort(cbSttbfAssoc); }
327cdf0e10cSrcweir 
328cdf0e10cSrcweir 	SVBT32 fcClx;// 0x112 file offset of beginning of information for complex files.
fcClxGetW1_FIB329cdf0e10cSrcweir 	sal_uLong fcClxGet() {
330cdf0e10cSrcweir 		return SVBT32ToUInt32(fcClx); }
331cdf0e10cSrcweir 	SVBT16 cbClx;// 0x116 count of bytes of complex file information. 0 if file is non-complex.
cbClxGetW1_FIB332cdf0e10cSrcweir 	sal_uInt16 cbClxGet() {
333cdf0e10cSrcweir 		return SVBT16ToShort(cbClx); }
334cdf0e10cSrcweir 
335cdf0e10cSrcweir 	SVBT32 fcPlcfpgdFtn;// 0x118 file offset of page descriptor PLC for footnote subdocument.
fcPlcfpgdFtnGetW1_FIB336cdf0e10cSrcweir 	sal_uLong fcPlcfpgdFtnGet() {
337cdf0e10cSrcweir 		return SVBT32ToUInt32(fcPlcfpgdFtn); }
338cdf0e10cSrcweir 	SVBT16 cbPlcfpgdFtn;// 0x11C count of bytes of page descriptor PLC for footnote subdocument.
cbPlcfpgdFtnGetW1_FIB339cdf0e10cSrcweir 	sal_uInt16 cbPlcfpgdFtnGet() {
340cdf0e10cSrcweir 		return SVBT16ToShort(cbPlcfpgdFtn); }
341cdf0e10cSrcweir 							// ==0 if document has not been paginated. The length of the PGD is 8 bytes.
342cdf0e10cSrcweir 
343cdf0e10cSrcweir 	SVBT32 fcSpare1;// 0x11e file offset of the name of the original file.
fcSpare1GetW1_FIB344cdf0e10cSrcweir 	sal_uLong fcSpare1Get() {
345cdf0e10cSrcweir 		return SVBT32ToUInt32(fcSpare1); }
346cdf0e10cSrcweir 	SVBT16 cbSpare1;// 0x122 count of bytes of the name of the original file.
cbSpare1GetW1_FIB347cdf0e10cSrcweir 	sal_uInt16 cbSpare1Get() {
348cdf0e10cSrcweir 		return SVBT16ToShort(cbSpare1); }
349cdf0e10cSrcweir 	SVBT32 fcSpare2;// 0x124 file offset of the name of the original file.
fcSpare2GetW1_FIB350cdf0e10cSrcweir 	sal_uLong fcSpare2Get() {
351cdf0e10cSrcweir 		return SVBT32ToUInt32(fcSpare2); }
352cdf0e10cSrcweir 	SVBT16 cbSpare2;// 0x128 count of bytes of the name of the original file.
cbSpare2GetW1_FIB353cdf0e10cSrcweir 	sal_uInt16 cbSpare2Get() {
354cdf0e10cSrcweir 		return SVBT16ToShort(cbSpare2); }
355cdf0e10cSrcweir 	SVBT32 fcSpare3;// 0x12a file offset of the name of the original file.
fcSpare3GetW1_FIB356cdf0e10cSrcweir 	sal_uLong fcSpare3Get() {
357cdf0e10cSrcweir 		return SVBT32ToUInt32(fcSpare3); }
358cdf0e10cSrcweir 	SVBT16 cbSpare3;// 0x12e count of bytes of the name of the original file.
cbSpare3GetW1_FIB359cdf0e10cSrcweir 	sal_uInt16 cbSpare3Get() {
360cdf0e10cSrcweir 		return SVBT16ToShort(cbSpare3); }
361cdf0e10cSrcweir 	SVBT32 fcSpare4;// 0x130 file offset of the name of the original file.
fcSpare4GetW1_FIB362cdf0e10cSrcweir 	sal_uLong fcSpare4Get() {
363cdf0e10cSrcweir 		return SVBT32ToUInt32(fcSpare4); }
364cdf0e10cSrcweir 	SVBT16 cbSpare4;// 0x134 count of bytes of the name of the original file.
cbSpare4GetW1_FIB365cdf0e10cSrcweir 	sal_uInt16 cbSpare4Get() {
366cdf0e10cSrcweir 		return SVBT16ToShort(cbSpare4); }
367cdf0e10cSrcweir 
368cdf0e10cSrcweir 	SVBT16 cpnBteChp;// 0x18E count of CHPX FKPs recorded in file. In non-complex files if the number of
cpnBteChpGetW1_FIB369cdf0e10cSrcweir 	sal_uInt16 cpnBteChpGet() {
370cdf0e10cSrcweir 		return SVBT16ToShort(cpnBteChp); }
371cdf0e10cSrcweir 							// entries in the plcfbteChpx is less than this, the plcfbteChpx is incomplete.
372cdf0e10cSrcweir 	SVBT16 cpnBtePap;// 0x190 count of PAPX FKPs recorded in file. In non-complex files if the number of
cpnBtePapGetW1_FIB373cdf0e10cSrcweir 	sal_uInt16 cpnBtePapGet() {
374cdf0e10cSrcweir 		return SVBT16ToShort(cpnBtePap); }
375cdf0e10cSrcweir 							// entries in the plcfbtePapx is less than this, the plcfbtePapx is incomplete.
376cdf0e10cSrcweir };
377cdf0e10cSrcweir 
378cdf0e10cSrcweir struct W1_DOP ///////////////////////////////////// Document Properties
379cdf0e10cSrcweir {
380cdf0e10cSrcweir 	SVBT16 fFlags;
fFlagsGetW1_DOP381cdf0e10cSrcweir 	sal_uInt16 fFlagsGet() {
382cdf0e10cSrcweir 		return SVBT16ToShort(fFlags); }
383cdf0e10cSrcweir 	// SVBT16 fFacingPages : 1;// 1 when facing pages should be printed
fFacingPagesGetW1_DOP384cdf0e10cSrcweir 	sal_Bool fFacingPagesGet() {
385cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 0) & 1); }
386cdf0e10cSrcweir 	// SVBT16 fWidowControl : 1;// 1 when widow control is in effect. 0 when widow control disabled.
fWidowControlGetW1_DOP387cdf0e10cSrcweir 	sal_Bool fWidowControlGet() {
388cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 1) & 1); }
389cdf0e10cSrcweir 	// SVBT16 : 3;// unused
390cdf0e10cSrcweir 	// SVBT16 fpc : 2;// 1 footnote position code: 0 as endnotes, 1 at bottom of page, 2 immediately beneath text
fpcGetW1_DOP391cdf0e10cSrcweir 	sal_uInt16 fpcGet() {
392cdf0e10cSrcweir 		return (sal_uInt16)((fFlagsGet() >> 5) & 3); }
393cdf0e10cSrcweir 	// SVBT16 fWide : 1;// Landscape
fWideGetW1_DOP394cdf0e10cSrcweir 	sal_Bool fWideGet() {
395cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 7) & 1); }
396cdf0e10cSrcweir 	// SVBT16 grpfIhdt : 8;// 0 specification of document headers and footers. See explanation under Headers and Footers topic.
grpfIhdtGetW1_DOP397cdf0e10cSrcweir 	sal_uInt16 grpfIhdtGet() {
398cdf0e10cSrcweir 		return (sal_uInt16)((fFlagsGet() >> 8) & 0xff); }
399cdf0e10cSrcweir 	SVBT16 fFtnFlags;
fFtnFlagsGetW1_DOP400cdf0e10cSrcweir 	sal_uInt16 fFtnFlagsGet() {
401cdf0e10cSrcweir 		return SVBT16ToShort(fFtnFlags); }
402cdf0e10cSrcweir 	// SVBT16 fFtnRestart : 1;
fFtnRestartGetW1_DOP403cdf0e10cSrcweir 	sal_Bool fFtnRestartGet() {
404cdf0e10cSrcweir 		return 0 != ((fFtnFlagsGet() >> 0) & 1); }
405cdf0e10cSrcweir 	// SVBT16 nFtn : 15;// 1 initial footnote number for document
nFtnGetW1_DOP406cdf0e10cSrcweir 	sal_uInt16 nFtnGet() {
407cdf0e10cSrcweir 		return (sal_uInt16)((fFtnFlagsGet() >> 1) & 0x7fff); }
408cdf0e10cSrcweir 	SVBT16 fRvsFlags;
fRvsFlagsGetW1_DOP409cdf0e10cSrcweir 	sal_uInt16 fRvsFlagsGet() {
410cdf0e10cSrcweir 		return SVBT16ToShort(fRvsFlags); }
411cdf0e10cSrcweir 	// SVBT16 irmBar : 8;
irmBarGetW1_DOP412cdf0e10cSrcweir 	sal_uInt16 irmBarGet() {
413cdf0e10cSrcweir 		return (sal_uInt16)((fRvsFlagsGet() >> 0) & 0xff); }
414cdf0e10cSrcweir 	// SVBT16 irmProps : 7;
irmPropsGetW1_DOP415cdf0e10cSrcweir 	sal_uInt16 irmPropsGet() {
416cdf0e10cSrcweir 		return (sal_uInt16)((fRvsFlagsGet() >> 8) & 0x7f); }
417cdf0e10cSrcweir 	// SVBT16 fRevMarking	: 1;//	 when 1, Word will mark revisions as the document is edited
fRevMarkingGetW1_DOP418cdf0e10cSrcweir 	sal_Bool fRevMarkingGet() {
419cdf0e10cSrcweir 		return 0 != ((fRvsFlagsGet() >> 15) & 1); }
420cdf0e10cSrcweir 	SVBT16 fSveFlags;
fSveFlagsGetW1_DOP421cdf0e10cSrcweir 	sal_uInt16 fSveFlagsGet() {
422cdf0e10cSrcweir 		return SVBT16ToShort(fSveFlags); }
423cdf0e10cSrcweir 	// SVBT16 fBackup : 1;//	 always make backup when document saved when 1.
fBackupGetW1_DOP424cdf0e10cSrcweir 	sal_Bool fBackupGet() {
425cdf0e10cSrcweir 		return 0 != ((fSveFlagsGet() >> 0) & 1); }
426cdf0e10cSrcweir 	// SVBT16 fExactCWords : 1;
fExactCWordsGetW1_DOP427cdf0e10cSrcweir 	sal_Bool fExactCWordsGet() {
428cdf0e10cSrcweir 		return 0 != ((fSveFlagsGet() >> 1) & 1); }
429cdf0e10cSrcweir 	// SVBT16 fPagHidden : 1;//
fPagHiddenGetW1_DOP430cdf0e10cSrcweir 	sal_Bool fPagHiddenGet() {
431cdf0e10cSrcweir 		return 0 != ((fSveFlagsGet() >> 2) & 1); }
432cdf0e10cSrcweir 	// SVBT16 fPagResults : 1;
fPagResultsGetW1_DOP433cdf0e10cSrcweir 	sal_Bool fPagResultsGet() {
434cdf0e10cSrcweir 		return 0 != ((fSveFlagsGet() >> 3) & 1); }
435cdf0e10cSrcweir 	// SVBT16 fLockAtn : 1;//	 when 1, annotations are locked for editing
fLockAtnGetW1_DOP436cdf0e10cSrcweir 	sal_Bool fLockAtnGet() {
437cdf0e10cSrcweir 		return 0 != ((fSveFlagsGet() >> 4) & 1); }
438cdf0e10cSrcweir 	// SVBT16 fMirrorMargins : 1;//	 swap margins on left/right pages when 1.
fMirrorMarginsGetW1_DOP439cdf0e10cSrcweir 	sal_Bool fMirrorMarginsGet() {
440cdf0e10cSrcweir 		return 0 != ((fSveFlagsGet() >> 5) & 1); }
441cdf0e10cSrcweir 	// SVBT16 : 10;// unused
442cdf0e10cSrcweir 	SVBT16 fSpares;
fSparesGetW1_DOP443cdf0e10cSrcweir 	sal_uInt16 fSparesGet() {
444cdf0e10cSrcweir 		return SVBT16ToShort(fSpares); }
445cdf0e10cSrcweir 	SVBT16 yaPage;
yaPageGetW1_DOP446cdf0e10cSrcweir 	sal_uInt16 yaPageGet() {
447cdf0e10cSrcweir 		return SVBT16ToShort(yaPage); }
448cdf0e10cSrcweir 	SVBT16 xaPage;
xaPageGetW1_DOP449cdf0e10cSrcweir 	sal_uInt16 xaPageGet() {
450cdf0e10cSrcweir 		return SVBT16ToShort(xaPage); }
451cdf0e10cSrcweir 	SVBT16 dyaTop;
dyaTopGetW1_DOP452cdf0e10cSrcweir 	sal_uInt16 dyaTopGet() {
453cdf0e10cSrcweir 		return SVBT16ToShort(dyaTop); }
454cdf0e10cSrcweir 	SVBT16 dxaLeft;
dxaLeftGetW1_DOP455cdf0e10cSrcweir 	sal_uInt16 dxaLeftGet() {
456cdf0e10cSrcweir 		return SVBT16ToShort(dxaLeft); }
457cdf0e10cSrcweir 	SVBT16 dyaBottom;
dyaBottomGetW1_DOP458cdf0e10cSrcweir 	sal_uInt16 dyaBottomGet() {
459cdf0e10cSrcweir 		return SVBT16ToShort(dyaBottom); }
460cdf0e10cSrcweir 	SVBT16 dxaRight;
dxaRightGetW1_DOP461cdf0e10cSrcweir 	sal_uInt16 dxaRightGet() {
462cdf0e10cSrcweir 		return SVBT16ToShort(dxaRight); }
463cdf0e10cSrcweir 	SVBT16 dxaGutter;
dxaGutterGetW1_DOP464cdf0e10cSrcweir 	sal_uInt16 dxaGutterGet() {
465cdf0e10cSrcweir 		return SVBT16ToShort(dxaGutter); }
466cdf0e10cSrcweir 	SVBT16	dxaTab;// 720 twips	default tab width
dxaTabGetW1_DOP467cdf0e10cSrcweir 	sal_uInt16 dxaTabGet() {
468cdf0e10cSrcweir 		return SVBT16ToShort(dxaTab); }
469cdf0e10cSrcweir 	SVBT16	wSpare;//
wSpareGetW1_DOP470cdf0e10cSrcweir 	sal_uInt16 wSpareGet() {
471cdf0e10cSrcweir 		return SVBT16ToShort(wSpare); }
472cdf0e10cSrcweir 	SVBT16	dxaHotZ;// width of hyphenation hot zone measured in twips
dxaHotZGetW1_DOP473cdf0e10cSrcweir 	sal_uInt16 dxaHotZGet() {
474cdf0e10cSrcweir 		return SVBT16ToShort(dxaHotZ); }
475cdf0e10cSrcweir 	SVBT16	rgwSpare[2];// reserved
476cdf0e10cSrcweir 	SVBT32	dttmCreated;// DTTM date and time document was created
dttmCreatedGetW1_DOP477cdf0e10cSrcweir 	sal_uLong dttmCreatedGet() {
478cdf0e10cSrcweir 		return SVBT32ToUInt32(dttmCreated); }
479cdf0e10cSrcweir 	SVBT32	dttmRevised;// DTTM date and time document was last revised
dttmRevisedGetW1_DOP480cdf0e10cSrcweir 	sal_uLong dttmRevisedGet() {
481cdf0e10cSrcweir 		return SVBT32ToUInt32(dttmRevised); }
482cdf0e10cSrcweir 	SVBT32	dttmLastPrint;// DTTM date and time document was last printed
dttmLastPrintGetW1_DOP483cdf0e10cSrcweir 	sal_uLong dttmLastPrintGet() {
484cdf0e10cSrcweir 		return SVBT32ToUInt32(dttmLastPrint); }
485cdf0e10cSrcweir 	SVBT16	nRevision;// number of times document has been revised since its creation
nRevisionGetW1_DOP486cdf0e10cSrcweir 	sal_uInt16 nRevisionGet() {
487cdf0e10cSrcweir 		return SVBT16ToShort(nRevision); }
488cdf0e10cSrcweir 	SVBT32	tmEdited;// time document was last edited
tmEditedGetW1_DOP489cdf0e10cSrcweir 	sal_uLong tmEditedGet() {
490cdf0e10cSrcweir 		return SVBT32ToUInt32(tmEdited); }
491cdf0e10cSrcweir 	SVBT32	cWords;// count of words tallied by last Word Count execution
cWordsGetW1_DOP492cdf0e10cSrcweir 	sal_uLong cWordsGet() {
493cdf0e10cSrcweir 		return SVBT32ToUInt32(cWords); }
494cdf0e10cSrcweir 	SVBT32	cCh;// count of characters tallied by last Word Count execution
cChGetW1_DOP495cdf0e10cSrcweir 	sal_uLong cChGet() {
496cdf0e10cSrcweir 		return SVBT32ToUInt32(cCh); }
497cdf0e10cSrcweir 	SVBT16	cPg;// count of pages tallied by last Word Count execution
cPgGetW1_DOP498cdf0e10cSrcweir 	sal_uInt16 cPgGet() {
499cdf0e10cSrcweir 		return SVBT16ToShort(cPg); }
500cdf0e10cSrcweir 	SVBT16	rgwSpareDocSum[2];
501cdf0e10cSrcweir };
502cdf0e10cSrcweir // cbDOP is 66.
503cdf0e10cSrcweir 
504cdf0e10cSrcweir struct W1_CHP /////////////////////////////////////////////////////////
505cdf0e10cSrcweir {
506cdf0e10cSrcweir 	SVBT16	fChar;
507cdf0e10cSrcweir 	SVBT16	ftc;// Font Code
508cdf0e10cSrcweir 	SVBT8	hps;// Font size in half points
509cdf0e10cSrcweir 	SVBT8	hpsPos;// Sub/Superscript ( signed number, 0 = normal )
510cdf0e10cSrcweir 	SVBT16	fText;
511cdf0e10cSrcweir 	SVBT32	fcPic;// not stored in File
512cdf0e10cSrcweir 	SVBT8	fnPic;// internal
513cdf0e10cSrcweir 	SVBT16	hpsLargeChp;// ???
514cdf0e10cSrcweir 
W1_CHPW1_CHP515cdf0e10cSrcweir 	W1_CHP() { memset( this, 0, sizeof( *this)); }
516cdf0e10cSrcweir 
fCharGetW1_CHP517cdf0e10cSrcweir 	sal_uInt16 fCharGet() 		{ return SVBT16ToShort(fChar); }
fCharSetW1_CHP518cdf0e10cSrcweir 	void fCharSet(sal_uInt16 n) { ShortToSVBT16(n, fChar); }
fBoldGetW1_CHP519cdf0e10cSrcweir 	sal_Bool fBoldGet() 		{ return 0 != ((fCharGet() >> 0) & 1); }
fBoldSetW1_CHP520cdf0e10cSrcweir 	void fBoldSet(sal_Bool b) 	{ fCharSet( ( fCharGet() & 0xfffe ) | ( b << 0 ) ); }
fItalicGetW1_CHP521cdf0e10cSrcweir 	sal_Bool fItalicGet() 		{ return 0 != ((fCharGet() >> 1) & 1); }
fItalicSetW1_CHP522cdf0e10cSrcweir 	void fItalicSet(sal_Bool b) { fCharSet( ( fCharGet() & 0xfffd ) | ( b << 1 ) ); }
fStrikeGetW1_CHP523cdf0e10cSrcweir 	sal_Bool fStrikeGet() 		{ return 0 != ((fCharGet() >> 2) & 1); }
fOutlineGetW1_CHP524cdf0e10cSrcweir 	sal_Bool fOutlineGet() 		{ return 0 != ((fCharGet() >> 3) & 1); }
fFldVanishGetW1_CHP525cdf0e10cSrcweir 	sal_Bool fFldVanishGet() 	{ return 0 != ((fCharGet() >> 4) & 1); }
fSmallCapsGetW1_CHP526cdf0e10cSrcweir 	sal_Bool fSmallCapsGet() 	{ return 0 != ((fCharGet() >> 5) & 1); }
fCapsGetW1_CHP527cdf0e10cSrcweir 	sal_Bool fCapsGet() 		{ return 0 != ((fCharGet() >> 6) & 1); }
fVanishGetW1_CHP528cdf0e10cSrcweir 	sal_Bool fVanishGet() 		{ return 0 != ((fCharGet() >> 7) & 1); }
fRMarkGetW1_CHP529cdf0e10cSrcweir 	sal_Bool fRMarkGet() 		{ return 0 != ((fCharGet() >> 8) & 1); }
fSpecGetW1_CHP530cdf0e10cSrcweir 	sal_Bool fSpecGet() 		{ return 0 != ((fCharGet() >> 9) & 1); }
fsIcoGetW1_CHP531cdf0e10cSrcweir 	sal_Bool fsIcoGet() 		{ return 0 != ((fCharGet() >> 10) & 1); }
fsFtcGetW1_CHP532cdf0e10cSrcweir 	sal_Bool fsFtcGet() 		{ return 0 != ((fCharGet() >> 11) & 1); }
fsFtcSetW1_CHP533cdf0e10cSrcweir 	void fsFtcSet(sal_Bool b) 	{ fCharSet( ( fCharGet() & 0xf7ff ) | ( b << 11 ) ); }
fsHpsGetW1_CHP534cdf0e10cSrcweir 	sal_Bool fsHpsGet() 		{ return 0 != ((fCharGet() >> 12) & 1); }
fsHpsSetW1_CHP535cdf0e10cSrcweir 	void fsHpsSet(sal_Bool b) 	{ fCharSet( ( fCharGet() & 0xefff ) | ( b << 12 ) ); }
fsKulGetW1_CHP536cdf0e10cSrcweir 	sal_Bool fsKulGet() 		{ return 0 != ((fCharGet() >> 13) & 1); }
fsKulSetW1_CHP537cdf0e10cSrcweir 	void fsKulSet(sal_Bool b) 	{ fCharSet( ( fCharGet() & 0xdfff ) | ( b << 13 ) ); }
fsPosGetW1_CHP538cdf0e10cSrcweir 	sal_Bool fsPosGet() 		{ return 0 != ((fCharGet() >> 14) & 1); }
fsSpaceGetW1_CHP539cdf0e10cSrcweir 	sal_Bool fsSpaceGet() 		{ return 0 != ((fCharGet() >> 15) & 1); }
540cdf0e10cSrcweir 	// SVBT16 fBold :1;// 1 == opposite boldness of style
541cdf0e10cSrcweir 	// SVBT16 fItalic :1;// 1 == opposite of style
542cdf0e10cSrcweir 	// SVBT16 fStrike :1;// 1 == opposite of style
543cdf0e10cSrcweir 	// SVBT16 fOutline :1;// 1 == opposite of style
544cdf0e10cSrcweir 	// SVBT16 fFldVanish :1;// 1 == opposite of style
545cdf0e10cSrcweir 	// SVBT16 fSmallCaps :1;// 1 == opposite of style
546cdf0e10cSrcweir 	// SVBT16 fCaps :1;// 1 == opposite of style
547cdf0e10cSrcweir 	// SVBT16 fVanish :1;// 1 == opposite of style
548cdf0e10cSrcweir 	// SVBT16 fRMark :1;// ???
549cdf0e10cSrcweir 	// SVBT16 fSpec :1;// 1 == opposite of style
550cdf0e10cSrcweir 	// SVBT16 fsIco :1;// 1 == Color (ico) different to style
551cdf0e10cSrcweir 	// SVBT16 fsFtc :1;// 1 == FontCode (ftc) different to style
552cdf0e10cSrcweir 	// SVBT16 fsHps :1;// 1 == FontSize (hps) different to style
553cdf0e10cSrcweir 	// SVBT16 fsKul :1;// 1 == Underline Code (kul) different to style
554cdf0e10cSrcweir 	// SVBT16 fsPos :1;// 1 == Char position (hpsPos) different to style
555cdf0e10cSrcweir 	// SVBT16 fsSpace :1;// 1 == Char Spacing (qpsSpace) different to style
556cdf0e10cSrcweir 
ftcGetW1_CHP557cdf0e10cSrcweir 	sal_uInt16 ftcGet() 		{ return SVBT16ToShort(ftc); }
ftcSetW1_CHP558cdf0e10cSrcweir 	void ftcSet(sal_uInt16 n) 	{ ShortToSVBT16(n, ftc); }
hpsSetW1_CHP559cdf0e10cSrcweir 	void hpsSet(sal_uInt8 n) 	{ ByteToSVBT8(n, hps); }
hpsGetW1_CHP560cdf0e10cSrcweir 	sal_uInt8 hpsGet() 			{ return SVBT8ToByte(hps); }
561cdf0e10cSrcweir 
hpsPosGetW1_CHP562cdf0e10cSrcweir 	sal_uInt8 hpsPosGet() 		{ return SVBT8ToByte(hpsPos); }
fTextGetW1_CHP563cdf0e10cSrcweir 	sal_uInt16 fTextGet() 		{ return SVBT16ToShort(fText); }
fTextSetW1_CHP564cdf0e10cSrcweir 	void fTextSet(sal_uInt16 n) { ShortToSVBT16(n, fText); }
qpsSpaceGetW1_CHP565cdf0e10cSrcweir 	sal_uInt16 qpsSpaceGet() 	{ return (sal_uInt16)((fTextGet() >> 0) & 0x3f); }
wSpare2GetW1_CHP566cdf0e10cSrcweir 	sal_uInt16 wSpare2Get() 	{ return (sal_uInt16)((fTextGet() >> 6) & 3); }
icoGetW1_CHP567cdf0e10cSrcweir 	sal_uInt16 icoGet() 		{ return (sal_uInt16)((fTextGet() >> 8) & 0xf); }
kulGetW1_CHP568cdf0e10cSrcweir 	sal_uInt16 kulGet() 		{ return (sal_uInt16)((fTextGet() >> 12) & 7); }
kulSetW1_CHP569cdf0e10cSrcweir 	void kulSet(sal_uInt16 n) 	{ fTextSet( ( fTextGet() & 0x8fff ) | ( ( n & 7 ) << 12 ) ); }
fSysVanishGetW1_CHP570cdf0e10cSrcweir 	sal_Bool fSysVanishGet() 	{ return 0 != ((fTextGet() >> 15) & 1); }
571cdf0e10cSrcweir 	// SVBT16 qpsSpace :6;// Char Spacing, -7 .. 56; 57 = -7, 63 = -1
572cdf0e10cSrcweir 	// SVBT16 wSpare2 : 2;// reserved
573cdf0e10cSrcweir 	// SVBT16 ico :4;// color of Text: 0=black, 1=blue, 2=cyan, 3=green, 4=magenta, 5=red, 6=yellow, 7=white
574cdf0e10cSrcweir 	// SVBT16 kul: 3;// Underline code: 0=none, 1=single, 2=by word, 3=double, 4=dotted
575cdf0e10cSrcweir 	// SVBT16 fSysVanish: 1;// used internally
576cdf0e10cSrcweir 
fcPicGetW1_CHP577cdf0e10cSrcweir 	sal_uLong fcPicGet() 		{ return SVBT32ToUInt32(fcPic); }
fnPicGetW1_CHP578cdf0e10cSrcweir 	sal_uInt16 fnPicGet() 		{ return SVBT8ToByte(fnPic); }
hpsLargeChpGetW1_CHP579cdf0e10cSrcweir 	sal_uInt16 hpsLargeChpGet() { return SVBT16ToShort(hpsLargeChp); }
580cdf0e10cSrcweir 
581cdf0e10cSrcweir 	void Out(Ww1Shell&, Ww1Manager&);
582cdf0e10cSrcweir };
583cdf0e10cSrcweir 
584cdf0e10cSrcweir struct W1_FFN ///////////////////////////////////////// Font Descriptor
585cdf0e10cSrcweir {
586cdf0e10cSrcweir 	SVBT8 cbFfnM1;// 0x0 	total length of FFN - 1.
cbFfnM1GetW1_FFN587cdf0e10cSrcweir 	sal_uInt16 cbFfnM1Get() {
588cdf0e10cSrcweir 		return SVBT8ToByte(cbFfnM1); }
589cdf0e10cSrcweir 	SVBT8 fFlags;
fFlagsGetW1_FFN590cdf0e10cSrcweir 	sal_uInt16 fFlagsGet() {
591cdf0e10cSrcweir 		return SVBT8ToByte(fFlags); }
592cdf0e10cSrcweir 	// SVBT8 prg : 2;//	0x1:03	pitch request
prgGetW1_FFN593cdf0e10cSrcweir 	sal_uInt16 prgGet() {
594cdf0e10cSrcweir 		return (sal_uInt16)((fFlagsGet() >> 0) & 3); }
595cdf0e10cSrcweir 	// SVBT8 fTrueType : 1;//	0x1:04	when 1, font is a TrueType font
fTrueTypeGetW1_FFN596cdf0e10cSrcweir 	sal_Bool fTrueTypeGet() {
597cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 2) & 1); }
598cdf0e10cSrcweir 	// SVBT8 : 1;//	0x1:08	reserved
599cdf0e10cSrcweir 	// SVBT8 ff : 3;//	0x1:70	font family id
ffGetW1_FFN600cdf0e10cSrcweir 	sal_uInt16 ffGet() {
601cdf0e10cSrcweir 		return (sal_uInt16)((fFlagsGet() >> 4) & 7); }
602cdf0e10cSrcweir 	// SVBT8 : 1;//	0x1:80	reserved
603cdf0e10cSrcweir 	sal_uInt8 szFfn[65];// 0x6		zero terminated string that records name of font.
604cdf0e10cSrcweir 							// Vorsicht: Dieses Array kann auch kleiner sein!!!
605cdf0e10cSrcweir 							// Possibly followed by a second sz which records the name of an
606cdf0e10cSrcweir 							// alternate font to use if the first named font does not exist
607cdf0e10cSrcweir 							// on this system. Maximal size of szFfn is 65 characters.
szFfnGetW1_FFN608cdf0e10cSrcweir 	sal_uInt8* szFfnGet() { return szFfn; }
609cdf0e10cSrcweir };
610cdf0e10cSrcweir 
611cdf0e10cSrcweir struct W1_PHE /////////////////////////////////////// Paragraph Height
612cdf0e10cSrcweir {
613cdf0e10cSrcweir 	SVBT16 fFlags;
fFlagsGetW1_PHE614cdf0e10cSrcweir 	sal_uInt16 fFlagsGet() {
615cdf0e10cSrcweir 		return SVBT16ToShort(fFlags); }
fSpareGetW1_PHE616cdf0e10cSrcweir 	sal_Bool fSpareGet() {
617cdf0e10cSrcweir 		return 0 != (fFlagsGet() & 1); }
fUnkGetW1_PHE618cdf0e10cSrcweir 	sal_Bool fUnkGet() {
619cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 1) & 1); }
fDiffLinesGetW1_PHE620cdf0e10cSrcweir 	sal_Bool fDiffLinesGet() {
621cdf0e10cSrcweir 		return 0 != ((fFlagsGet() >> 2) & 1); }
clMacGetW1_PHE622cdf0e10cSrcweir 	sal_uInt8 clMacGet() {
623cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((fFlagsGet() >> 8) & 0xff); }
624cdf0e10cSrcweir 	SVBT16 dxaCol;
dxaColGetW1_PHE625cdf0e10cSrcweir 	sal_uInt16 dxaColGet() {
626cdf0e10cSrcweir 		return SVBT16ToShort(dxaCol); }
627cdf0e10cSrcweir 	SVBT16 xxx; // beachte die dreifachnutzung.... siehe doc.
dylHeightGetW1_PHE628cdf0e10cSrcweir 	sal_uInt16 dylHeightGet() {
629cdf0e10cSrcweir 		return SVBT16ToShort(xxx); }
dylLineGetW1_PHE630cdf0e10cSrcweir 	sal_uInt16 dylLineGet() {
631cdf0e10cSrcweir 		return SVBT16ToShort(xxx); }
fStyleDirtyGetW1_PHE632cdf0e10cSrcweir 	sal_uInt16 fStyleDirtyGet() {
633cdf0e10cSrcweir 		return SVBT16ToShort(xxx); }
634cdf0e10cSrcweir };
635cdf0e10cSrcweir 
636cdf0e10cSrcweir struct W1_PAPX ///////////////////////// Paragraph Property Difference
637cdf0e10cSrcweir {
638cdf0e10cSrcweir 	SVBT8 stc;
stcGetW1_PAPX639cdf0e10cSrcweir 	sal_uInt8 stcGet() {
640cdf0e10cSrcweir 		return SVBT8ToByte(stc); }
641cdf0e10cSrcweir 	W1_PHE phe;
642cdf0e10cSrcweir 	sal_uInt8 grpprl[1];
grpprlGetW1_PAPX643cdf0e10cSrcweir 	sal_uInt8* grpprlGet() {
644cdf0e10cSrcweir 		return grpprl; }
645cdf0e10cSrcweir };
646cdf0e10cSrcweir 
647cdf0e10cSrcweir struct W1_BRC //////////////////////////////////////////// Border Code
648cdf0e10cSrcweir {
649cdf0e10cSrcweir 	SVBT16 aBits;
aBitsGetW1_BRC650cdf0e10cSrcweir 	sal_uInt16 aBitsGet() {
651cdf0e10cSrcweir 		return SVBT16ToShort(aBits); }
652cdf0e10cSrcweir 	// SVBT16 dxpLineWidth : 3;// 0007 When dxpLineWidth is 0, 1, 2, 3, 4, or 5,
653cdf0e10cSrcweir 								// this field is the width of a single line of border
654cdf0e10cSrcweir 								// in units of 0.75 points Must be nonzero when brcType
655cdf0e10cSrcweir 								// is nonzero. 6 == dotted, 7 == dashed.
dxpLineWidthGetW1_BRC656cdf0e10cSrcweir 	sal_uInt8 dxpLineWidthGet() {
657cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 0) & 0x0007); }
658cdf0e10cSrcweir 	// SVBT16 brcType : 2;// 0018 border type code: 0 == none, 1 == single, 2 == thick,
659cdf0e10cSrcweir 							// 3 == double
brcTypeGetW1_BRC660cdf0e10cSrcweir 	sal_uInt8 brcTypeGet() {
661cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 3) & 0x0003); }
662cdf0e10cSrcweir 	// SVBT16 fShadow : 1;// 0020	when 1, border is drawn with shadow. Must be 0
663cdf0e10cSrcweir 							// when BRC is a substructure of the TC
fShadowGetW1_BRC664cdf0e10cSrcweir 	sal_uInt8 fShadowGet() {
665cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 5) & 0x0001); }
666cdf0e10cSrcweir 	// SVBT16 ico : 5;// 07C0 color code (see chp.ico)
icoGetW1_BRC667cdf0e10cSrcweir 	sal_uInt8 icoGet() {
668cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 6) & 0x001f); }
669cdf0e10cSrcweir 	// SVBT16 dxpSpace : 5;// F800	width of space to maintain between border and
670cdf0e10cSrcweir 								// text within border. Must be 0 when BRC is a
671cdf0e10cSrcweir 								// substructure of the TC. Stored in points for Windows.
dxpSpaceGetW1_BRC672cdf0e10cSrcweir 	sal_uInt8 dxpSpaceGet() {
673cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 11) & 0x001f); }
674cdf0e10cSrcweir };
675cdf0e10cSrcweir 
676cdf0e10cSrcweir struct W1_BRC10 ///////////////////////////////// Border Code Word 1.0
677cdf0e10cSrcweir {
678cdf0e10cSrcweir 	SVBT16 aBits;
aBitsGetW1_BRC10679cdf0e10cSrcweir 	sal_uInt16 aBitsGet() {
680cdf0e10cSrcweir 		return SVBT16ToShort(aBits); }
dxpLine2WidthGetW1_BRC10681cdf0e10cSrcweir 	sal_uInt8 dxpLine2WidthGet() {
682cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 0) & 0x0007); }
dxpSpaceBetweenGetW1_BRC10683cdf0e10cSrcweir 	sal_uInt8 dxpSpaceBetweenGet() {
684cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 3) & 0x0007); }
dxpLine1WidthGetW1_BRC10685cdf0e10cSrcweir 	sal_uInt8 dxpLine1WidthGet() {
686cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 6) & 0x0007); }
dxpSpaceGetW1_BRC10687cdf0e10cSrcweir 	sal_uInt8 dxpSpaceGet() {
688cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 9) & 0x001f); }
fShadowGetW1_BRC10689cdf0e10cSrcweir 	sal_uInt8 fShadowGet() {
690cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 14) & 0x0001); }
fSpareGetW1_BRC10691cdf0e10cSrcweir 	sal_uInt8 fSpareGet() {
692cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((aBitsGet() >> 15) & 0x0001); }
693cdf0e10cSrcweir };
694cdf0e10cSrcweir 
695cdf0e10cSrcweir struct W1_FLD //////////////////////////////////////// FieldDescriptor
696cdf0e10cSrcweir {
697cdf0e10cSrcweir 	SVBT8 ch; // boundary-type (begin(19), separator (20), end (21))
chGetW1_FLD698cdf0e10cSrcweir 	sal_uInt8 chGet() {
699cdf0e10cSrcweir 		return SVBT8ToByte(ch); }
700cdf0e10cSrcweir 	SVBT8 flt; // field type / flags
fltGetW1_FLD701cdf0e10cSrcweir 	sal_uInt8 fltGet() {
702cdf0e10cSrcweir 		return SVBT8ToByte(flt); }
703cdf0e10cSrcweir 	// variant, when ch==21:
fDifferGetW1_FLD704cdf0e10cSrcweir 	sal_Bool fDifferGet() {
705cdf0e10cSrcweir 		return (fltGet() >> 0) & 1; }
fResultDirtyGetW1_FLD706cdf0e10cSrcweir 	sal_Bool fResultDirtyGet() {
707cdf0e10cSrcweir 		return (fltGet() >> 2) & 1; }
ResultEditedGetW1_FLD708cdf0e10cSrcweir 	sal_Bool ResultEditedGet() {
709cdf0e10cSrcweir 		return (fltGet() >> 3) & 1; }
fLockedGetW1_FLD710cdf0e10cSrcweir 	sal_Bool fLockedGet() {
711cdf0e10cSrcweir 		return (fltGet() >> 4) & 1; }
fPrivateResultGetW1_FLD712cdf0e10cSrcweir 	sal_Bool fPrivateResultGet() {
713cdf0e10cSrcweir 		return (fltGet() >> 5) & 1; }
fNestedGetW1_FLD714cdf0e10cSrcweir 	sal_Bool fNestedGet() {
715cdf0e10cSrcweir 		return (fltGet() >> 6) & 1; }
716cdf0e10cSrcweir };
717cdf0e10cSrcweir 
718cdf0e10cSrcweir struct W1_PIC /////////////////////////////////////// PictureStructure
719cdf0e10cSrcweir {
720cdf0e10cSrcweir 	SVBT32 lcb;// 0x0 number of bytes in the PIC structure plus size of following picture data which may be a Window's metafile, a bitmap, or the filename of a TIFF file.
lcbGetW1_PIC721cdf0e10cSrcweir 	sal_uLong lcbGet() {
722cdf0e10cSrcweir 		return SVBT32ToUInt32(lcb); }
723cdf0e10cSrcweir 	SVBT16 cbHeader;// 0x4 number of bytes in the PIC (to allow for future expansion).
cbHeaderGetW1_PIC724cdf0e10cSrcweir 	sal_uInt16 cbHeaderGet() {
725cdf0e10cSrcweir 		return SVBT16ToShort(cbHeader); }
726cdf0e10cSrcweir 	struct MFP {
727cdf0e10cSrcweir 		SVBT16 mm;// 0x6	int
mmGetW1_PIC::MFP728cdf0e10cSrcweir 		sal_uInt16 mmGet() {
729cdf0e10cSrcweir 			return SVBT16ToShort(mm); }
730cdf0e10cSrcweir 		SVBT16 xExt;// 0x8	int
xExtGetW1_PIC::MFP731cdf0e10cSrcweir 		sal_uInt16 xExtGet() {
732cdf0e10cSrcweir 			return SVBT16ToShort(xExt); }
733cdf0e10cSrcweir 		SVBT16 yExt;// 0xa	int
yExtGetW1_PIC::MFP734cdf0e10cSrcweir 		sal_uInt16 yExtGet() {
735cdf0e10cSrcweir 			return SVBT16ToShort(yExt); }
736cdf0e10cSrcweir 		SVBT16 hMF;// 0xc	int
hMFGetW1_PIC::MFP737cdf0e10cSrcweir 		sal_uInt16 hMFGet() {
738cdf0e10cSrcweir 			return SVBT16ToShort(hMF); }
739cdf0e10cSrcweir 	} mfp;
740cdf0e10cSrcweir 	union W1_MFP_BMP {
741cdf0e10cSrcweir 		SVBT8 bm[14];// 0xe	BITMAP(14 bytes)	Window's bitmap structure when PIC describes a BITMAP.
742cdf0e10cSrcweir 		SVBT8 rcWinMF[14];// 0xe	rc (rectangle - 8 bytes) rect for window origin and extents when metafile is stored -- ignored if 0
743cdf0e10cSrcweir 	} MFP_BMP;
744cdf0e10cSrcweir 	SVBT16 dxaGoal;// 0x1c	horizontal measurement in twips of the rectangle the picture should be imaged within.
dxaGoalGetW1_PIC745cdf0e10cSrcweir 	sal_uInt16 dxaGoalGet() {
746cdf0e10cSrcweir 		return SVBT16ToShort(dxaGoal); }
747cdf0e10cSrcweir 	SVBT16 dyaGoal;// 0x1e	vertical measurement in twips of the rectangle the picture should be imaged within.
dyaGoalGetW1_PIC748cdf0e10cSrcweir 	sal_uInt16 dyaGoalGet() {
749cdf0e10cSrcweir 		return SVBT16ToShort(dyaGoal); }
750cdf0e10cSrcweir 	SVBT16 mx;// 0x20	horizontal scaling factor supplied by user in .1% units.
mxGetW1_PIC751cdf0e10cSrcweir 	sal_uInt16 mxGet() {
752cdf0e10cSrcweir 		return SVBT16ToShort(mx); }
753cdf0e10cSrcweir 	SVBT16 my;// 0x22	vertical scaling factor supplied by user in .1% units.
myGetW1_PIC754cdf0e10cSrcweir 	sal_uInt16 myGet() {
755cdf0e10cSrcweir 		return SVBT16ToShort(my); }
756cdf0e10cSrcweir 	SVBT16 dxaCropLeft;// 0x24	the amount the picture has been cropped on the left in twips.
dxaCropLeftGetW1_PIC757cdf0e10cSrcweir 	sal_uInt16 dxaCropLeftGet() {
758cdf0e10cSrcweir 		return SVBT16ToShort(dxaCropLeft); }
759cdf0e10cSrcweir 	SVBT16 dyaCropTop;// 0x26	the amount the picture has been cropped on the top in twips.
dyaCropTopGetW1_PIC760cdf0e10cSrcweir 	sal_uInt16 dyaCropTopGet() {
761cdf0e10cSrcweir 		return SVBT16ToShort(dyaCropTop); }
762cdf0e10cSrcweir 	SVBT16 dxaCropRight;// 0x28 the amount the picture has been cropped on the right in twips.
dxaCropRightGetW1_PIC763cdf0e10cSrcweir 	sal_uInt16 dxaCropRightGet() {
764cdf0e10cSrcweir 		return SVBT16ToShort(dxaCropRight); }
765cdf0e10cSrcweir 	SVBT16 dyaCropBottom;// 0x2a	the amount the picture has been cropped on the bottom in twips.
dyaCropBottomGetW1_PIC766cdf0e10cSrcweir 	sal_uInt16 dyaCropBottomGet() {
767cdf0e10cSrcweir 		return SVBT16ToShort(dyaCropBottom); }
768cdf0e10cSrcweir 	SVBT16 flags;
flagsGetW1_PIC769cdf0e10cSrcweir 	sal_uInt16 flagsGet() {
770cdf0e10cSrcweir 		return SVBT16ToShort(flags); }
771cdf0e10cSrcweir //	brcl : 4;// 000F	Obsolete, superseded by brcTop, etc. In
brclGetW1_PIC772cdf0e10cSrcweir 	sal_uInt8 brclGet() {
773cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >(flagsGet() & 0xf); }
774cdf0e10cSrcweir //	fFrameEmpty : 1;// 0010	picture consists of a single frame
fFrameEmptyGetW1_PIC775cdf0e10cSrcweir 	sal_Bool fFrameEmptyGet() {
776cdf0e10cSrcweir 		return sal::static_int_cast< sal_uInt8, sal_uInt16 >((flagsGet() >> 4) & 1); }
777cdf0e10cSrcweir // win6 stuff:
778cdf0e10cSrcweir //	fBitmap : 1;// 0020	==1, when picture is just a bitmap
779cdf0e10cSrcweir //	sal_Bool fBitmapGet() {
780cdf0e10cSrcweir //		return (flagsGet() >> 5) & 1; }
781cdf0e10cSrcweir //	fDrawHatch : 1;// 0040	==1, when picture is an active OLE object
782cdf0e10cSrcweir //	sal_Bool fDrawHatchGet() {
783cdf0e10cSrcweir //		return (flagsGet() >> 6) & 1; }
784cdf0e10cSrcweir //	fError : 1;// 0080	==1, when picture is just an error message
785cdf0e10cSrcweir //	sal_Bool fErrorGet() {
786cdf0e10cSrcweir //		return (flagsGet() >> 7) & 1; }
787cdf0e10cSrcweir //	bpp : 8;// FF00	bits per pixel, 0 = unknown
788cdf0e10cSrcweir //	sal_uInt8 bppGet() {
789cdf0e10cSrcweir //		return (flagsGet() >> 8) & 0xff; }
790cdf0e10cSrcweir //	SVBT16 rgbrc[4];
791cdf0e10cSrcweir //	sal_uInt16 rgbrcGet(sal_uInt16 nIndex) {
792cdf0e10cSrcweir //		return SVBT16ToShort(rgbrc[nIndex]); }
793cdf0e10cSrcweir //	W1_BRC brcTop;// 0x2e	specification for border above picture
794cdf0e10cSrcweir //	W1_BRC brcLeft;// 0x30 specification for border to the left
795cdf0e10cSrcweir //	W1_BRC brcBottom;// 0x32	specification for border below picture
796cdf0e10cSrcweir //	W1_BRC brcRight;// 0x34	specification for border to the right
797cdf0e10cSrcweir //	SVBT16 dxaOrigin;// 0x36	horizontal offset of hand annotation origin
798cdf0e10cSrcweir //	sal_uInt16 dxaOriginGet() {
799cdf0e10cSrcweir //		return SVBT16ToShort(dxaOrigin); }
800cdf0e10cSrcweir //	SVBT16 dyaOrigin;// 0x38	vertical offset of hand annotation origin
801cdf0e10cSrcweir //	sal_uInt16 dyaOriginGet() {
802cdf0e10cSrcweir //		return SVBT16ToShort(dyaOrigin); }
803cdf0e10cSrcweir 	SVBT8 rgb;// 0x3a	variable array of bytes containing Window's metafile, bitmap or TIFF file filename.
rgbGetW1_PIC804cdf0e10cSrcweir 	sal_uInt8* rgbGet() {
805cdf0e10cSrcweir 		return rgb; }
806cdf0e10cSrcweir };
807cdf0e10cSrcweir 
808cdf0e10cSrcweir struct W1_TBD /////////////////////////////////////////////////////////
809cdf0e10cSrcweir {
810cdf0e10cSrcweir 	SVBT8 aBits1;
aBits1GetW1_TBD811cdf0e10cSrcweir 	sal_uInt8 aBits1Get() {
812cdf0e10cSrcweir 		return SVBT8ToByte(aBits1); }
813cdf0e10cSrcweir // SVBT8 jc : 3;// 0x07 justification code: 0=left tab, 1=centered tab, 2=right tab, 3=decimal tab, 4=bar
jcGetW1_TBD814cdf0e10cSrcweir 	sal_uInt8 jcGet() {
815cdf0e10cSrcweir 		return aBits1Get() & 0x07; }
816cdf0e10cSrcweir // SVBT8 tlc : 3;// 0x38	tab leader code: 0=no leader, 1=dotted leader,
817cdf0e10cSrcweir 						// 2=hyphenated leader, 3=single line leader, 4=heavy line leader
tlcGetW1_TBD818cdf0e10cSrcweir 	sal_uInt8 tlcGet() {
819cdf0e10cSrcweir 		return (aBits1Get() >> 3 ) & 0x07; }
820cdf0e10cSrcweir // *	int	:2	C0	reserved
821cdf0e10cSrcweir };
822cdf0e10cSrcweir 
823cdf0e10cSrcweir struct W1_TC //////////////////////////////////////////////////////////
824cdf0e10cSrcweir {
825cdf0e10cSrcweir 	SVBT8 aBits1;
aBits1GetW1_TC826cdf0e10cSrcweir 	sal_uInt8 aBits1Get() {
827cdf0e10cSrcweir 		return SVBT8ToByte(aBits1); }
fFirstMergedGetW1_TC828cdf0e10cSrcweir 	sal_uInt8 fFirstMergedGet() {
829cdf0e10cSrcweir 		return aBits1Get() & 0x01; }
fMergedGetW1_TC830cdf0e10cSrcweir 	sal_uInt8 fMergedGet() {
831cdf0e10cSrcweir 		return (aBits1Get() >> 1 ) & 0x01; }
832cdf0e10cSrcweir 	SVBT8 aBits2;
833cdf0e10cSrcweir // SVBT16 fFirstMerged : 1;// 0001	set to 1 when cell is first cell of a range of cells that have been merged.
834cdf0e10cSrcweir // SVBT16 fMerged : 1;// 0002	set to 1 when cell has been merged with preceding cell.
835cdf0e10cSrcweir // SVBT16 fUnused : 14;// FFFC	reserved
836cdf0e10cSrcweir 	W1_BRC10 rgbrc[4];// notational convenience for referring to brcTop, brcLeft, etc fields.
rgbrcGetW1_TC837cdf0e10cSrcweir 	W1_BRC10* rgbrcGet() {
838cdf0e10cSrcweir 		return rgbrc; }
839cdf0e10cSrcweir // BRC brcTop;// specification of the top border of a table cell
840cdf0e10cSrcweir // BRC brcLeft;// specification of left border of table row
841cdf0e10cSrcweir // BRC brcBottom;// specification of bottom border of table row
842cdf0e10cSrcweir // BRC brcRight;// specification of right border of table row.
843cdf0e10cSrcweir };
844cdf0e10cSrcweir // cbTC (count of bytes of a TC) is 10(decimal), A(hex).
845cdf0e10cSrcweir 
846cdf0e10cSrcweir #if 0
847cdf0e10cSrcweir struct W1_SHD ////////////////////////////////////////////// struct SHD
848cdf0e10cSrcweir {
849cdf0e10cSrcweir 	SVBT16 aBits1;
850cdf0e10cSrcweir 	// SVBT16 nFore : 5;// 0x001f ForegroundColor
851cdf0e10cSrcweir 	sal_uInt16 GetFore() { return SVBT16ToShort(aBits1) & 0x01; };
852cdf0e10cSrcweir 	void SetFore( short nVal ){
853cdf0e10cSrcweir 		ShortToSVBT16((SVBT16ToShort(aBits1)&0xffe0)|(nVal&0x1f), aBits1); };
854cdf0e10cSrcweir 	// SVBT16 nBack : 5;// 0x03e0 BackgroundColor
855cdf0e10cSrcweir 	W1_SHD() { ShortToSVBT16( 0, aBits1 ); };
856cdf0e10cSrcweir 	sal_uInt16 GetBack() { return (SVBT16ToShort(aBits1) >> 5 & 0x1f ); };
857cdf0e10cSrcweir 	void SetBack( short nVal ){
858cdf0e10cSrcweir 		ShortToSVBT16((SVBT16ToShort(aBits1)&0xfc1f)|(nVal&0x1f)<<5, aBits1); };
859cdf0e10cSrcweir 	// SVBT16 nStyle : 5;// 0x7c00 Percentage and Style
860cdf0e10cSrcweir 	sal_uInt16 GetStyle() { return (SVBT16ToShort(aBits1) >> 10 & 0x1f ); };
861cdf0e10cSrcweir 	void SetStyle( short nVal ){
862cdf0e10cSrcweir 		ShortToSVBT16((SVBT16ToShort(aBits1)&0x83ff)|(nVal&0x1f)<<10, aBits1); };
863cdf0e10cSrcweir 	// SVBT16 nDontKnow : 1;// 0x8000 ???
864cdf0e10cSrcweir };
865cdf0e10cSrcweir 
866cdf0e10cSrcweir struct W1_ANLV ////////////////////////////////////////////////////////
867cdf0e10cSrcweir {
868cdf0e10cSrcweir 	SVBT8 nfc;// 0 number format code, 0=Arabic, 1=Upper case Roman, 2=Lower case Roman
869cdf0e10cSrcweir 						// 3=Upper case Letter, 4=Lower case letter, 5=Ordinal
870cdf0e10cSrcweir 	SVBT8 cbTextBefore;// 1 offset into anld.rgch limit of prefix text
871cdf0e10cSrcweir 	SVBT8 cbTextAfter;// 2
872cdf0e10cSrcweir 	SVBT8 aBits1;
873cdf0e10cSrcweir // SVBT8 jc : 2;// 3 : 0x03	justification code, 0=left, 1=center, 2=right, 3=left and right justify
874cdf0e10cSrcweir // SVBT8 fPrev : 1;// 0x04	when ==1, include previous levels
875cdf0e10cSrcweir // SVBT8 fHang : 1;// 0x08	when ==1, number will be displayed using a hanging indent
876cdf0e10cSrcweir // SVBT8 fSetBold : 1;// 0x10	when ==1, boldness of number will be determined by anld.fBold.
877cdf0e10cSrcweir // SVBT8 fSetItalic : 1;// 0x20	when ==1, italicness of number will be determined by anld.fItalic
878cdf0e10cSrcweir // SVBT8 fSetSmallCaps : 1;// 0x40	when ==1, anld.fSmallCaps will determine whether number will be displayed in small caps or not.
879cdf0e10cSrcweir // SVBT8 fSetCaps : 1;// 0x80	when ==1, anld.fCaps will determine whether number will be displayed capitalized or not
880cdf0e10cSrcweir 	SVBT8 aBits2;
881cdf0e10cSrcweir // SVBT8 fSetStrike : 1;// 4 : 0x01	when ==1, anld.fStrike will determine whether the number will be displayed using strikethrough or not.
882cdf0e10cSrcweir // SVBT8 fSetKul : 1;// 0x02 when ==1, anld.kul will determine the underlining state of the autonumber.
883cdf0e10cSrcweir // SVBT8 fPrevSpace : 1;// 0x04	when ==1, autonumber will be displayed with a single prefixing space character
884cdf0e10cSrcweir // SVBT8 fBold : 1;// 0x08	determines boldness of autonumber when anld.fSetBold == 1.
885cdf0e10cSrcweir // SVBT8 fItalic : 1;// 0x10	determines italicness of autonumber when anld.fSetItalic == 1.
886cdf0e10cSrcweir // SVBT8 fSmallCaps : 1;// 0x20	determines whether autonumber will be displayed using small caps when anld.fSetSmallCaps == 1.
887cdf0e10cSrcweir // SVBT8 fCaps : 1;// 0x40	determines whether autonumber will be displayed using caps when anld.fSetCaps == 1.
888cdf0e10cSrcweir // SVBT8 fStrike : 1;// 0x80	determines whether autonumber will be displayed using caps when anld.fSetStrike == 1.
889cdf0e10cSrcweir 	SVBT8 aBits3;
890cdf0e10cSrcweir // SVBT8 kul : 3;// 5 : 0x07	determines whether autonumber will be displayed with underlining when anld.fSetKul == 1.
891cdf0e10cSrcweir // SVBT8 ico : 5;// 0xF1	color of autonumber
892cdf0e10cSrcweir 	SVBT16 ftc;// 6 font code of autonumber
893cdf0e10cSrcweir 	SVBT16 hps;// 8	font half point size (or 0=auto)
894cdf0e10cSrcweir 	SVBT16 iStartAt;// 0x0a starting value (0 to 65535)
895cdf0e10cSrcweir 	SVBT16 dxaIndent;// 0x0c *short?* *sal_uInt16?* width of prefix text (same as indent)
896cdf0e10cSrcweir 	SVBT16 dxaSpace;// 0x0e		minimum space between number and paragraph
897cdf0e10cSrcweir };
898cdf0e10cSrcweir // *cbANLV (count of bytes of ANLV) is 16 (decimal), 10(hex).
899cdf0e10cSrcweir 
900cdf0e10cSrcweir struct W1_ANLD ////////////////////////////////////////////////////////
901cdf0e10cSrcweir {
902cdf0e10cSrcweir 	W1_ANLV eAnlv;// 0
903cdf0e10cSrcweir 	SVBT8 fNumber1;// 0x10		number only 1 item per table cell
904cdf0e10cSrcweir 	SVBT8 fNumberAcross;// 0x11		number across cells in table rows(instead of down)
905cdf0e10cSrcweir 	SVBT8 fRestartHdn;// 0x12		restart heading number on section boundary
906cdf0e10cSrcweir 	SVBT8 fSpareX;// 0x13		unused( should be 0)
907cdf0e10cSrcweir 	sal_Char rgchAnld[32];// 0x14	characters displayed before/after autonumber
908cdf0e10cSrcweir };
909cdf0e10cSrcweir 
910cdf0e10cSrcweir 
911cdf0e10cSrcweir struct W1_OLST ////////////////////////////////////////////////////////
912cdf0e10cSrcweir {
913cdf0e10cSrcweir 	W1_ANLV rganlv[9];// 0 an array of 9 ANLV structures (heading levels)
914cdf0e10cSrcweir 	SVBT8 fRestartHdr;// 0x90 when ==1, restart heading on section break
915cdf0e10cSrcweir 	SVBT8 fSpareOlst2;// 0x91 reserved
916cdf0e10cSrcweir 	SVBT8 fSpareOlst3;// 0x92 reserved
917cdf0e10cSrcweir 	SVBT8 fSpareOlst4;// 0x93 reserved
918cdf0e10cSrcweir 	sal_Char rgch[64];// 0x94 array of 64 chars		text before/after number
919cdf0e10cSrcweir };
920cdf0e10cSrcweir // cbOLST is 212(decimal), D4(hex).
921cdf0e10cSrcweir 
922cdf0e10cSrcweir #endif
923cdf0e10cSrcweir #endif
924cdf0e10cSrcweir 
925