xref: /aoo41x/main/sw/source/filter/ww8/ww8struc.hxx (revision 8338ba1b)
11d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51d2dbeb0SAndrew Rist  * distributed with this work for additional information
61d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
81d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
91d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
101d2dbeb0SAndrew Rist  *
111d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
121d2dbeb0SAndrew Rist  *
131d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
141d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
151d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
171d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
181d2dbeb0SAndrew Rist  * under the License.
191d2dbeb0SAndrew Rist  *
201d2dbeb0SAndrew Rist  *************************************************************/
211d2dbeb0SAndrew Rist 
221d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _WW8STRUC_HXX
27cdf0e10cSrcweir #define _WW8STRUC_HXX
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <osl/endian.h>
30cdf0e10cSrcweir #include <tools/string.hxx>
31cdf0e10cSrcweir #include <sal/config.h>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #if defined  OSL_BIGENDIAN || SAL_TYPES_ALIGNMENT4 > 2 || defined UNX
34cdf0e10cSrcweir #   define __WW8_NEEDS_COPY
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #ifdef SAL_W32
38cdf0e10cSrcweir #   pragma pack(push, 2)
39cdf0e10cSrcweir #elif defined(SAL_OS2)
40cdf0e10cSrcweir #   pragma pack(2)
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir 
Set_UInt8(sal_uInt8 * & p,sal_uInt8 n)43cdf0e10cSrcweir inline void Set_UInt8( sal_uInt8 *& p, sal_uInt8 n )
44cdf0e10cSrcweir {
45cdf0e10cSrcweir     ByteToSVBT8( n, *(SVBT8*)p );
46cdf0e10cSrcweir     p+= 1;
47cdf0e10cSrcweir }
48cdf0e10cSrcweir 
Set_UInt16(sal_uInt8 * & p,sal_uInt16 n)49cdf0e10cSrcweir inline void Set_UInt16( sal_uInt8 *& p, sal_uInt16 n )
50cdf0e10cSrcweir {
51cdf0e10cSrcweir     ShortToSVBT16( n, *(SVBT16*)p );
52cdf0e10cSrcweir     p+= 2;
53cdf0e10cSrcweir }
54cdf0e10cSrcweir 
Set_UInt32(sal_uInt8 * & p,sal_uInt32 n)55cdf0e10cSrcweir inline void Set_UInt32( sal_uInt8 *& p, sal_uInt32 n )
56cdf0e10cSrcweir {
57cdf0e10cSrcweir     UInt32ToSVBT32( n, *(SVBT32*)p );
58cdf0e10cSrcweir     p+= 4;
59cdf0e10cSrcweir }
60cdf0e10cSrcweir 
61cdf0e10cSrcweir struct Word2CHPX
62cdf0e10cSrcweir {
63cdf0e10cSrcweir     sal_uInt16 fBold:1;
64cdf0e10cSrcweir     sal_uInt16 fItalic:1;
65cdf0e10cSrcweir     sal_uInt16 fRMarkDel:1;
66cdf0e10cSrcweir     sal_uInt16 fOutline:1;
67cdf0e10cSrcweir     sal_uInt16 fFldVanish:1;
68cdf0e10cSrcweir     sal_uInt16 fSmallCaps:1;
69cdf0e10cSrcweir     sal_uInt16 fCaps:1;
70cdf0e10cSrcweir     sal_uInt16 fVanish:1;
71cdf0e10cSrcweir     sal_uInt16 fRMark:1;
72cdf0e10cSrcweir     sal_uInt16 fSpec:1;
73cdf0e10cSrcweir     sal_uInt16 fStrike:1;
74cdf0e10cSrcweir     sal_uInt16 fObj:1;
75cdf0e10cSrcweir     sal_uInt16 fBoldBi:1;
76cdf0e10cSrcweir     sal_uInt16 fItalicBi:1;
77cdf0e10cSrcweir     sal_uInt16 fBiDi:1;
78cdf0e10cSrcweir     sal_uInt16 fDiacUSico:1;
79cdf0e10cSrcweir     sal_uInt16 fsIco:1;
80cdf0e10cSrcweir     sal_uInt16 fsFtc:1;
81cdf0e10cSrcweir     sal_uInt16 fsHps:1;
82cdf0e10cSrcweir     sal_uInt16 fsKul:1;
83cdf0e10cSrcweir     sal_uInt16 fsPos:1;
84cdf0e10cSrcweir     sal_uInt16 fsSpace:1;
85cdf0e10cSrcweir     sal_uInt16 fsLid:1;
86cdf0e10cSrcweir     sal_uInt16 fsIcoBi:1;
87cdf0e10cSrcweir     sal_uInt16 fsFtcBi:1;
88cdf0e10cSrcweir     sal_uInt16 fsHpsBi:1;
89cdf0e10cSrcweir     sal_uInt16 fsLidBi:1;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir     sal_uInt16 ftc;
92cdf0e10cSrcweir     sal_uInt16 hps;
93cdf0e10cSrcweir     sal_uInt8 qpsSpace:6;
94cdf0e10cSrcweir     sal_uInt8 fSysVanish:1;
95cdf0e10cSrcweir     sal_uInt8 fNumRun:1;
96cdf0e10cSrcweir     sal_uInt8 ico:5;
97cdf0e10cSrcweir     sal_uInt8 kul:3;
98cdf0e10cSrcweir     sal_uInt8 hpsPos;
99cdf0e10cSrcweir     sal_uInt8 icoBi;
100cdf0e10cSrcweir     sal_uInt16 lid;
101cdf0e10cSrcweir     sal_uInt16 ftcBi;
102cdf0e10cSrcweir     sal_uInt16 hpsBi;
103cdf0e10cSrcweir     sal_uInt16 lidBi;
104cdf0e10cSrcweir     sal_uInt32 fcPic;
105cdf0e10cSrcweir 
Word2CHPXWord2CHPX106cdf0e10cSrcweir     Word2CHPX()
107cdf0e10cSrcweir     {
108cdf0e10cSrcweir         fBold = 0;
109cdf0e10cSrcweir         fItalic = 0;
110cdf0e10cSrcweir         fRMarkDel = 0;
111cdf0e10cSrcweir         fOutline = 0;
112cdf0e10cSrcweir         fFldVanish = 0;
113cdf0e10cSrcweir         fSmallCaps = 0;
114cdf0e10cSrcweir         fCaps = 0;
115cdf0e10cSrcweir         fVanish = 0;
116cdf0e10cSrcweir         fRMark = 0;
117cdf0e10cSrcweir         fSpec = 0;
118cdf0e10cSrcweir         fStrike = 0;
119cdf0e10cSrcweir         fObj = 0;
120cdf0e10cSrcweir         fBoldBi = 0;
121cdf0e10cSrcweir         fItalicBi = 0;
122cdf0e10cSrcweir         fBiDi = 0;
123cdf0e10cSrcweir         fDiacUSico = 0;
124cdf0e10cSrcweir         fsIco = 0;
125cdf0e10cSrcweir         fsFtc = 0;
126cdf0e10cSrcweir         fsHps = 0;
127cdf0e10cSrcweir         fsKul = 0;
128cdf0e10cSrcweir         fsPos = 0;
129cdf0e10cSrcweir         fsSpace = 0;
130cdf0e10cSrcweir         fsLid = 0;
131cdf0e10cSrcweir         fsIcoBi = 0;
132cdf0e10cSrcweir         fsFtcBi = 0;
133cdf0e10cSrcweir         fsHpsBi = 0;
134cdf0e10cSrcweir         fsLidBi = 0;
135cdf0e10cSrcweir 
136cdf0e10cSrcweir         ftc = 0;
137cdf0e10cSrcweir         hps = 0;
138cdf0e10cSrcweir         qpsSpace = 0;
139cdf0e10cSrcweir         fSysVanish = 0;
140cdf0e10cSrcweir         fNumRun = 0;
141cdf0e10cSrcweir         ico = 0;
142cdf0e10cSrcweir         kul = 0;
143cdf0e10cSrcweir         hpsPos = 0;
144cdf0e10cSrcweir         icoBi = 0;
145cdf0e10cSrcweir         lid = 0;
146cdf0e10cSrcweir         ftcBi = 0;
147cdf0e10cSrcweir         hpsBi = 0;
148cdf0e10cSrcweir         lidBi = 0;
149cdf0e10cSrcweir         fcPic = 0;
150cdf0e10cSrcweir     }
151cdf0e10cSrcweir };
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 
154cdf0e10cSrcweir typedef sal_Int16 WW8_PN;
155cdf0e10cSrcweir typedef sal_Int32 WW8_FC;
156cdf0e10cSrcweir typedef sal_Int32 WW8_CP;
157cdf0e10cSrcweir 
158cdf0e10cSrcweir const WW8_FC WW8_FC_MAX = SAL_MAX_INT32;
159cdf0e10cSrcweir const WW8_CP WW8_CP_MAX = SAL_MAX_INT32;
160cdf0e10cSrcweir 
161cdf0e10cSrcweir /** STD - STyle Definition
162cdf0e10cSrcweir 
163cdf0e10cSrcweir     The STD contains the entire definition of a style.
164cdf0e10cSrcweir     It has two parts, a fixed-length base (cbSTDBase bytes long)
165cdf0e10cSrcweir     and a variable length remainder holding the name, and the upx and upe
166cdf0e10cSrcweir     arrays (a upx and upe for each type stored in the style, std.cupx)
167cdf0e10cSrcweir     Note that new fields can be added to the BASE of the STD without
168cdf0e10cSrcweir     invalidating the file format, because the STSHI contains the length
169cdf0e10cSrcweir     that is stored in the file.  When reading STDs from an older version,
170cdf0e10cSrcweir     new fields will be zero.
171cdf0e10cSrcweir */
172cdf0e10cSrcweir struct WW8_STD
173cdf0e10cSrcweir {
174cdf0e10cSrcweir     // Base part of STD:
175cdf0e10cSrcweir     sal_uInt16  sti : 12;          // invariant style identifier
176cdf0e10cSrcweir     sal_uInt16  fScratch : 1;      // spare field for any temporary use,
177cdf0e10cSrcweir                                                          // always reset back to zero!
178cdf0e10cSrcweir     sal_uInt16  fInvalHeight : 1;  // PHEs of all text with this style are wrong
179cdf0e10cSrcweir     sal_uInt16  fHasUpe : 1;       // UPEs have been generated
180cdf0e10cSrcweir     sal_uInt16  fMassCopy : 1;     // std has been mass-copied; if unused at
181cdf0e10cSrcweir                                                          // save time, style should be deleted
182cdf0e10cSrcweir     sal_uInt16  sgc : 4;           // style type code
183cdf0e10cSrcweir     sal_uInt16  istdBase : 12;     // base style
184cdf0e10cSrcweir     sal_uInt16  cupx : 4;          // # of UPXs (and UPEs)
185cdf0e10cSrcweir     sal_uInt16  istdNext : 12;     // next style
186cdf0e10cSrcweir     sal_uInt16  bchUpe;            // offset to end of upx's, start of upe's
187cdf0e10cSrcweir     //-------- jetzt neu:
188cdf0e10cSrcweir     // ab Ver8 gibts zwei Felder mehr:
189cdf0e10cSrcweir   sal_uInt16    fAutoRedef : 1;    /* auto redefine style when appropriate */
190cdf0e10cSrcweir   sal_uInt16    fHidden : 1;       /* hidden from UI? */
191cdf0e10cSrcweir   sal_uInt16    : 14;              /* unused bits */
192cdf0e10cSrcweir 
193cdf0e10cSrcweir     // Variable length part of STD:
194cdf0e10cSrcweir     //  sal_uInt8   stzName[2];        /* sub-names are separated by chDelimStyle
195cdf0e10cSrcweir     // char grupx[];
196cdf0e10cSrcweir             // the UPEs are not stored on the file; they are a cache of the based-on
197cdf0e10cSrcweir         // chain
198cdf0e10cSrcweir     // char grupe[];
199cdf0e10cSrcweir };
200cdf0e10cSrcweir 
201cdf0e10cSrcweir /** Basis zum Einlesen UND zum Arbeiten (wird jeweils unter schiedlich beerbt)
202cdf0e10cSrcweir */
203cdf0e10cSrcweir struct WW8_FFN_BASE     // Font Descriptor
204cdf0e10cSrcweir {
205cdf0e10cSrcweir     // ab Ver6
206cdf0e10cSrcweir     sal_uInt8    cbFfnM1;        //  0x0     total length of FFN - 1.
207cdf0e10cSrcweir 
208cdf0e10cSrcweir     sal_uInt8    prg: 2;         //  0x1:03  pitch request
209cdf0e10cSrcweir     sal_uInt8    fTrueType : 1;  //  0x1:04  when 1, font is a TrueType font
210cdf0e10cSrcweir                             //  0x1:08  reserved
211cdf0e10cSrcweir     sal_uInt8    ff : 3;         //  0x1:70  font family id
212cdf0e10cSrcweir                             //  0x1:80  reserved
213cdf0e10cSrcweir 
214cdf0e10cSrcweir     short wWeight;          //  0x2     base weight of font
215cdf0e10cSrcweir     sal_uInt8    chs;            //  0x4     character set identifier
216cdf0e10cSrcweir     sal_uInt8    ibszAlt;        //  0x5     index into ffn.szFfn to the name of the alternate font
217cdf0e10cSrcweir };
218cdf0e10cSrcweir 
219cdf0e10cSrcweir /** Hiermit arbeiten wir im Parser (und Dumper)
220cdf0e10cSrcweir */
221cdf0e10cSrcweir struct WW8_FFN : public WW8_FFN_BASE
222cdf0e10cSrcweir {
223cdf0e10cSrcweir     // ab Ver8 als Unicode
224cdf0e10cSrcweir     String sFontname;// 0x6 bzw. 0x40 ab Ver8 zero terminated string that
225cdf0e10cSrcweir                                         // records name of font.
226cdf0e10cSrcweir                                         // Maximal size of szFfn is 65 characters.
227cdf0e10cSrcweir                                         // Vorsicht: Dieses Array kann auch kleiner sein!!!
228cdf0e10cSrcweir                                         // Possibly followed by a second sz which records the
229cdf0e10cSrcweir                                         // name of an alternate font to use if the first named
230cdf0e10cSrcweir                                         // font does not exist on this system.
231cdf0e10cSrcweir };
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 
234cdf0e10cSrcweir 
235cdf0e10cSrcweir struct WW8_BRCVer6  // alter Border Code
236cdf0e10cSrcweir {
237cdf0e10cSrcweir     SVBT16 aBits1;
238cdf0e10cSrcweir //  sal_uInt16 dxpLineWidth : 3;// 0007 When dxpLineWidth is 0, 1, 2, 3, 4, or 5, this field is the width of
239cdf0e10cSrcweir                             //      a single line of border in units of 0.75 points
240cdf0e10cSrcweir                             //      Must be nonzero when brcType is nonzero.
241cdf0e10cSrcweir                             //      6 == dotted, 7 == dashed.
242cdf0e10cSrcweir //  sal_uInt16 brcType : 2;     // 0018 border type code: 0 == none, 1 == single, 2 == thick, 3 == double
243cdf0e10cSrcweir //  sal_uInt16 fShadow : 1;     // 0020 when 1, border is drawn with shadow. Must be 0 when BRC is a substructure of the TC
244cdf0e10cSrcweir //  sal_uInt16 ico : 5;         // 07C0 color code (see chp.ico)
245cdf0e10cSrcweir //  sal_uInt16 dxpSpace : 5;    // F800 width of space to maintain between border and text within border.
246cdf0e10cSrcweir                             //      Must be 0 when BRC is a substructure of the TC.  Stored in points for Windows.
247cdf0e10cSrcweir };
248cdf0e10cSrcweir 
249cdf0e10cSrcweir class WW8_BRC      // Border Code
250cdf0e10cSrcweir {
251cdf0e10cSrcweir public:
252cdf0e10cSrcweir     SVBT16 aBits1;
253cdf0e10cSrcweir     SVBT16 aBits2;
254cdf0e10cSrcweir //  sal_uInt16 dxpLineWidth : 3;// 0007 When dxpLineWidth is 0, 1, 2, 3, 4, or 5, this field is the width of
255cdf0e10cSrcweir                             //      a single line of border in units of 0.75 points
256cdf0e10cSrcweir                             //      Must be nonzero when brcType is nonzero.
257cdf0e10cSrcweir                             //      6 == dotted, 7 == dashed.
258cdf0e10cSrcweir //  sal_uInt16 brcType : 2;     // 0018 border type code: 0 == none, 1 == single, 2 == thick, 3 == double
259cdf0e10cSrcweir //  sal_uInt16 fShadow : 1;     // 0020 when 1, border is drawn with shadow. Must be 0 when BRC is a substructure of the TC
260cdf0e10cSrcweir //  sal_uInt16 ico : 5;         // 07C0 color code (see chp.ico)
261cdf0e10cSrcweir //  sal_uInt16 dxpSpace : 5;    // F800 width of space to maintain between border and text within border.
262cdf0e10cSrcweir                             //      Must be 0 when BRC is a substructure of the TC.  Stored in points for Windows.
WW8_BRC()263cdf0e10cSrcweir     WW8_BRC()
264cdf0e10cSrcweir     {
265cdf0e10cSrcweir         memset(aBits1, 0, sizeof(aBits1));
266cdf0e10cSrcweir         memset(aBits2, 0, sizeof(aBits2));
267cdf0e10cSrcweir     }
268cdf0e10cSrcweir     short DetermineBorderProperties (bool bVer67, short *pSpace=0,
269cdf0e10cSrcweir         sal_uInt8 *pCol=0, short *pIdx=0) const;
270cdf0e10cSrcweir     bool IsEmpty(bool bVer67) const;
271cdf0e10cSrcweir     bool IsZeroed(bool bVer67) const;
272cdf0e10cSrcweir     bool IsBlank() const;
273cdf0e10cSrcweir };
274cdf0e10cSrcweir 
275cdf0e10cSrcweir typedef WW8_BRC WW8_BRC5[5];        // 5 * Border Code
276cdf0e10cSrcweir 
277cdf0e10cSrcweir enum BRC_Sides
278cdf0e10cSrcweir {
279cdf0e10cSrcweir     WW8_TOP = 0, WW8_LEFT = 1, WW8_BOT = 2, WW8_RIGHT = 3, WW8_BETW = 4
280cdf0e10cSrcweir };
281cdf0e10cSrcweir 
282cdf0e10cSrcweir class WW8_BordersSO         // for StarOffice-Border Code
283cdf0e10cSrcweir {
284cdf0e10cSrcweir public:
285cdf0e10cSrcweir     sal_uInt16 mnOut;
286cdf0e10cSrcweir     sal_uInt16 mnIn;
287cdf0e10cSrcweir     sal_uInt16 mnDist;
288cdf0e10cSrcweir public:
289cdf0e10cSrcweir     enum eBorderCode
290cdf0e10cSrcweir     {
291cdf0e10cSrcweir         single0, single1, single2, single3, single4, single5,
292cdf0e10cSrcweir         double0, double1, double2, double3, double4, double5, double6,
293cdf0e10cSrcweir         double7, double8, double9, double10,
294cdf0e10cSrcweir         none
295cdf0e10cSrcweir     };
296cdf0e10cSrcweir     static const WW8_BordersSO &Get0x01LineMatch(eBorderCode nIdx);
297cdf0e10cSrcweir };
298cdf0e10cSrcweir 
299cdf0e10cSrcweir /*
300cdf0e10cSrcweir Document Typography Info (DOPTYPOGRAPHY) These options are Far East only,
301cdf0e10cSrcweir and are accessible through the Typography tab of the Tools/Options dialog.
302cdf0e10cSrcweir */
303cdf0e10cSrcweir class WW8DopTypography
304cdf0e10cSrcweir {
305cdf0e10cSrcweir public:
306cdf0e10cSrcweir     void ReadFromMem(sal_uInt8 *&pData);
307cdf0e10cSrcweir     void WriteToMem(sal_uInt8 *&pData) const;
308cdf0e10cSrcweir 
309cdf0e10cSrcweir     //Maps what I think is the language this is to affect to the OOo language
310cdf0e10cSrcweir     sal_uInt16 GetConvertedLang() const;
311cdf0e10cSrcweir 
312cdf0e10cSrcweir     sal_uInt16 fKerningPunct  : 1;  // true if we're kerning punctuation
313cdf0e10cSrcweir     sal_uInt16 iJustification : 2;  // Kinsoku method of justification:
314cdf0e10cSrcweir                                 //  0 = always expand
315cdf0e10cSrcweir                                 //  1 = compress punctuation
316cdf0e10cSrcweir                                 //  2 = compress punctuation and kana.
317cdf0e10cSrcweir     sal_uInt16 iLevelOfKinsoku : 2; // Level of Kinsoku:
318cdf0e10cSrcweir                                 //  0 = Level 1
319cdf0e10cSrcweir                                 //  1 = Level 2
320cdf0e10cSrcweir                                 //  2 = Custom
321cdf0e10cSrcweir     sal_uInt16 f2on1          : 1;  // 2-page-on-1 feature is turned on.
322cdf0e10cSrcweir     sal_uInt16 reserved1      : 4;  // in 97 its marked as reserved BUT
323cdf0e10cSrcweir     sal_uInt16 reserved2      : 6;  // reserved ?
324cdf0e10cSrcweir     //we find that the following applies,
325cdf0e10cSrcweir     //2 == Japanese
326cdf0e10cSrcweir     //4 == Chinese (VR...
327cdf0e10cSrcweir     //6 == Korean
328cdf0e10cSrcweir     //8 == Chinese (Ta...
329cdf0e10cSrcweir     //perhaps a bit field where the DOP can possibly relate to more than
330cdf0e10cSrcweir     //one language at a time, nevertheless MS seems to have painted
331cdf0e10cSrcweir     //themselves into a small corner with one DopTypography for the
332cdf0e10cSrcweir     //full document, might not matter all that much though ?
333cdf0e10cSrcweir 
334cdf0e10cSrcweir     enum RuleLengths {nMaxFollowing = 101, nMaxLeading = 51};
335cdf0e10cSrcweir     static const sal_Unicode * GetJapanNotBeginLevel1();
336cdf0e10cSrcweir     static const sal_Unicode * GetJapanNotEndLevel1();
337cdf0e10cSrcweir 
338cdf0e10cSrcweir     sal_Int16 cchFollowingPunct;    // length of rgxchFPunct
339cdf0e10cSrcweir     sal_Int16 cchLeadingPunct;      // length of rgxchLPunct
340cdf0e10cSrcweir 
341cdf0e10cSrcweir     // array of characters that should never appear at the start of a line
342cdf0e10cSrcweir     sal_Unicode rgxchFPunct[nMaxFollowing];
343cdf0e10cSrcweir     // array of characters that should never appear at the end of a line
344cdf0e10cSrcweir     sal_Unicode rgxchLPunct[nMaxLeading];
345cdf0e10cSrcweir };
346cdf0e10cSrcweir 
347cdf0e10cSrcweir struct WW8_DOGRID
348cdf0e10cSrcweir {
349cdf0e10cSrcweir     short xaGrid;       // x-coord of the upper left-hand corner of the grid
350cdf0e10cSrcweir     short yaGrid;       // y-coord of the upper left-hand corner of the grid
351cdf0e10cSrcweir     short dxaGrid;  // width of each grid square
352cdf0e10cSrcweir     short dyaGrid;  // height of each grid square
353cdf0e10cSrcweir 
354cdf0e10cSrcweir 
355cdf0e10cSrcweir 
356cdf0e10cSrcweir     /* a c h t u n g :     es duerfen keine solchen Bitfelder ueber einen eingelesenes Byte-Array
357cdf0e10cSrcweir                             gelegt werden!!
358cdf0e10cSrcweir                             stattdessen ist ein aBits1 darueber zu legen, das mit & auszulesen ist
359cdf0e10cSrcweir     GRUND: Compiler auf Intel und Sparc sortieren die Bits unterschiedlich
360cdf0e10cSrcweir     */
361cdf0e10cSrcweir 
362cdf0e10cSrcweir 
363cdf0e10cSrcweir 
364cdf0e10cSrcweir     short dyGridDisplay:7;  // the number of grid squares (in the y direction)
365cdf0e10cSrcweir                                                     // between each gridline drawn on the screen. 0 means
366cdf0e10cSrcweir                                                     // don't display any gridlines in the y direction.
367cdf0e10cSrcweir     short fTurnItOff   :1;  // suppress display of gridlines
368cdf0e10cSrcweir     short dxGridDisplay:7;  // the number of grid squares (in the x direction)
369cdf0e10cSrcweir                                                     // between each gridline drawn on the screen. 0 means
370cdf0e10cSrcweir                                                     // don't display any gridlines in the y direction.
371cdf0e10cSrcweir     short fFollowMargins:1; // if true, the grid will start at the left and top
372cdf0e10cSrcweir                                                     // margins and ignore xaGrid and yaGrid.
373cdf0e10cSrcweir };
374cdf0e10cSrcweir 
375cdf0e10cSrcweir struct WW8_PIC
376cdf0e10cSrcweir {
377cdf0e10cSrcweir     sal_Int32 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.
378cdf0e10cSrcweir     sal_uInt16 cbHeader;    // 0x4 number of bytes in the PIC (to allow for future expansion).
379cdf0e10cSrcweir     struct {
380cdf0e10cSrcweir         sal_Int16 mm;       // 0x6  int
381cdf0e10cSrcweir         sal_Int16 xExt;     // 0x8  int
382cdf0e10cSrcweir         sal_Int16 yExt;     // 0xa  int
383cdf0e10cSrcweir         sal_Int16 hMF;      // 0xc  int
384cdf0e10cSrcweir     }MFP;
385cdf0e10cSrcweir //  sal_uInt8 bm[14];        // 0xe  BITMAP(14 bytes)    Window's bitmap structure when PIC describes a BITMAP.
386cdf0e10cSrcweir     sal_uInt8 rcWinMF[14];   // 0xe  rc (rectangle - 8 bytes) rect for window origin
387cdf0e10cSrcweir                         //      and extents when  metafile is stored -- ignored if 0
388cdf0e10cSrcweir     sal_Int16 dxaGoal;      // 0x1c horizontal  measurement in twips of the  rectangle the picture should be imaged within.
389cdf0e10cSrcweir     sal_Int16 dyaGoal;      // 0x1e vertical  measurement in twips of the  rectangle the picture should be imaged within.
390cdf0e10cSrcweir     sal_uInt16 mx;          // 0x20 horizontal scaling factor supplied by user in .1% units.
391cdf0e10cSrcweir     sal_uInt16 my;          // 0x22 vertical scaling factor supplied by user in .1% units.
392cdf0e10cSrcweir     sal_Int16 dxaCropLeft;  // 0x24 the amount the picture has been cropped on the left in twips.
393cdf0e10cSrcweir     sal_Int16 dyaCropTop;   // 0x26 the amount the picture has been cropped on the top in twips.
394cdf0e10cSrcweir     sal_Int16 dxaCropRight; // 0x28 the amount the picture has been cropped on the right in twips.
395cdf0e10cSrcweir     sal_Int16 dyaCropBottom;// 0x2a the amount the picture has been cropped on the bottom in twips.
396cdf0e10cSrcweir     sal_Int16 brcl : 4;     // 000F Obsolete, superseded by brcTop, etc.  In
397cdf0e10cSrcweir     sal_Int16 fFrameEmpty : 1;  // 0010 picture consists of a single frame
398cdf0e10cSrcweir     sal_Int16 fBitmap : 1;      // 0020 ==1, when picture is just a bitmap
399cdf0e10cSrcweir     sal_Int16 fDrawHatch : 1;   // 0040 ==1, when picture is an active OLE object
400cdf0e10cSrcweir     sal_Int16 fError : 1;       // 0080 ==1, when picture is just an error message
401cdf0e10cSrcweir     sal_Int16 bpp : 8;      // FF00 bits per pixel, 0 = unknown
402cdf0e10cSrcweir     WW8_BRC rgbrc[4];
403cdf0e10cSrcweir //  BRC brcTop;         // 0x2e specification for border above picture
404cdf0e10cSrcweir //  BRC brcLeft;        // 0x30 specification for border to the left
405cdf0e10cSrcweir //  BRC brcBottom;      // 0x32 specification for border below picture
406cdf0e10cSrcweir //  BRC brcRight;       // 0x34 specification for border to the right
407cdf0e10cSrcweir     sal_Int16 dxaOrigin;    // 0x36 horizontal offset of hand annotation origin
408cdf0e10cSrcweir     sal_Int16 dyaOrigin;    // 0x38 vertical offset of hand annotation origin
409cdf0e10cSrcweir //  sal_uInt8 rgb[];         // 0x3a variable array of bytes containing Window's metafile, bitmap or TIFF file filename.
410cdf0e10cSrcweir };
411cdf0e10cSrcweir 
412cdf0e10cSrcweir struct WW8_PIC_SHADOW
413cdf0e10cSrcweir {
414cdf0e10cSrcweir     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.
415cdf0e10cSrcweir     SVBT16 cbHeader;    // 0x4 number of bytes in the PIC (to allow for future expansion).
416cdf0e10cSrcweir     struct {
417cdf0e10cSrcweir         SVBT16 mm;      // 0x6  int
418cdf0e10cSrcweir         SVBT16 xExt;        // 0x8  int
419cdf0e10cSrcweir         SVBT16 yExt;        // 0xa  int
420cdf0e10cSrcweir         SVBT16 hMF;     // 0xc  int
421cdf0e10cSrcweir     }MFP;
422cdf0e10cSrcweir //  SVBT8 bm[14];       // 0xe  BITMAP(14 bytes)    Window's bitmap structure when PIC describes a BITMAP.
423cdf0e10cSrcweir     SVBT8 rcWinMF[14];  // 0xe  rc (rectangle - 8 bytes) rect for window origin
424cdf0e10cSrcweir                         //      and extents when  metafile is stored -- ignored if 0
425cdf0e10cSrcweir     SVBT16 dxaGoal;     // 0x1c horizontal  measurement in twips of the  rectangle the picture should be imaged within.
426cdf0e10cSrcweir     SVBT16 dyaGoal;     // 0x1e vertical  measurement in twips of the  rectangle the picture should be imaged within.
427cdf0e10cSrcweir     SVBT16 mx;          // 0x20 horizontal scaling factor supplied by user in .1% units.
428cdf0e10cSrcweir     SVBT16 my;          // 0x22 vertical scaling factor supplied by user in .1% units.
429cdf0e10cSrcweir     SVBT16 dxaCropLeft; // 0x24 the amount the picture has been cropped on the left in twips.
430cdf0e10cSrcweir     SVBT16 dyaCropTop;  // 0x26 the amount the picture has been cropped on the top in twips.
431cdf0e10cSrcweir     SVBT16 dxaCropRight;    // 0x28 the amount the picture has been cropped on the right in twips.
432cdf0e10cSrcweir     SVBT16 dyaCropBottom;// 0x2a    the amount the picture has been cropped on the bottom in twips.
433cdf0e10cSrcweir     SVBT8 aBits1; //0x2c
434cdf0e10cSrcweir     SVBT8 aBits2;
435cdf0e10cSrcweir //  WW8_BRC rgbrc[4];
436cdf0e10cSrcweir //  BRC brcTop;         // 0x2e specification for border above picture
437cdf0e10cSrcweir //  BRC brcLeft;        // 0x30 specification for border to the left
438cdf0e10cSrcweir //  BRC brcBottom;      // 0x32 specification for border below picture
439cdf0e10cSrcweir //  BRC brcRight;       // 0x34 specification for border to the right
440cdf0e10cSrcweir //  SVBT16 dxaOrigin;   // 0x36 horizontal offset of hand annotation origin
441cdf0e10cSrcweir //  SVBT16 dyaOrigin;   // 0x38 vertical offset of hand annotation origin
442cdf0e10cSrcweir //  SVBT8 rgb[];            // 0x3a variable array of bytes containing Window's metafile, bitmap or TIFF file filename.
443cdf0e10cSrcweir };
444cdf0e10cSrcweir 
445cdf0e10cSrcweir 
446cdf0e10cSrcweir struct WW8_TBD
447cdf0e10cSrcweir {
448cdf0e10cSrcweir     SVBT8 aBits1;
449cdf0e10cSrcweir //  sal_uInt8 jc : 3;        // 0x07 justification code: 0=left tab, 1=centered tab, 2=right tab, 3=decimal tab, 4=bar
450cdf0e10cSrcweir //  sal_uInt8 tlc : 3;       // 0x38 tab leader code: 0=no leader, 1=dotted leader,
451cdf0e10cSrcweir                         // 2=hyphenated leader, 3=single line leader, 4=heavy line leader
452cdf0e10cSrcweir //  *   int :2  C0  reserved
453cdf0e10cSrcweir };
454cdf0e10cSrcweir 
455cdf0e10cSrcweir struct WW8_TCell    // hiermit wird weitergearbeitet (entspricht weitestgehend dem Ver8-Format)
456cdf0e10cSrcweir {
457cdf0e10cSrcweir     sal_uInt8 bFirstMerged   : 1;// 0001 set to 1 when cell is first cell of a range of cells that have been merged.
458cdf0e10cSrcweir     sal_uInt8 bMerged        : 1;// 0002 set to 1 when cell has been merged with preceding cell.
459cdf0e10cSrcweir     sal_uInt8 bVertical      : 1;// set to 1 when cell has vertical text flow
460cdf0e10cSrcweir     sal_uInt8 bBackward      : 1;// for a vertical table cell, text flow is bottom to top when 1 and is bottom to top when 0.
461cdf0e10cSrcweir     sal_uInt8 bRotateFont    : 1;// set to 1 when cell has rotated characters (i.e. uses @font)
462cdf0e10cSrcweir     sal_uInt8 bVertMerge     : 1;// set to 1 when cell is vertically merged with the cell(s) above and/or below. When cells are vertically merged, the display area of the merged cells are consolidated. The consolidated area is used to display the contents of the first vertically merged cell (the cell with fVertRestart set to 1), and all other vertically merged cells (those with fVertRestart set to 0) must be empty. Cells can only be merged vertically if their left and right boundaries are (nearly) identical (i.e. if corresponding entries in rgdxaCenter of the table rows differ by at most 3).
463cdf0e10cSrcweir     sal_uInt8 bVertRestart   : 1;// set to 1 when the cell is the first of a set of vertically merged cells. The contents of a cell with fVertStart set to 1 are displayed in the consolidated area belonging to the entire set of vertically merged cells. Vertically merged cells with fVertRestart set to 0 must be empty.
464cdf0e10cSrcweir     sal_uInt8 nVertAlign     : 2;// specifies the alignment of the cell contents relative to text flow (e.g. in a cell with bottom to top text flow and bottom vertical alignment, the text is shifted horizontally to match the cell's right boundary):
465cdf0e10cSrcweir                                                     //          0 top
466cdf0e10cSrcweir                                                     //          1 center
467cdf0e10cSrcweir                                                     //          2 bottom
468cdf0e10cSrcweir     sal_uInt16 fUnused      : 7;// reserved - nicht loeschen: macht das sal_uInt16 voll !!
469cdf0e10cSrcweir 
470cdf0e10cSrcweir     WW8_BRC rgbrc[4];               // border codes
471cdf0e10cSrcweir //notational convenience for referring to brcTop, brcLeft, etc fields.
472cdf0e10cSrcweir //  BRC brcTop;             // specification of the top border of a table cell
473cdf0e10cSrcweir //  BRC brcLeft;            // specification of left border of table row
474cdf0e10cSrcweir //  BRC brcBottom;          // specification of bottom border of table row
475cdf0e10cSrcweir //  BRC brcRight;           // specification of right border of table row.
476cdf0e10cSrcweir };
477cdf0e10cSrcweir // cbTC (count of bytes of a TC) is 18(decimal), 12(hex).
478cdf0e10cSrcweir 
479cdf0e10cSrcweir 
480cdf0e10cSrcweir struct WW8_TCellVer6    // wird aus der Datei gelesen
481cdf0e10cSrcweir {
482cdf0e10cSrcweir     SVBT8  aBits1Ver6;
483cdf0e10cSrcweir     SVBT8  aBits2Ver6;
484cdf0e10cSrcweir //  sal_uInt16 fFirstMerged : 1;// 0001 set to 1 when cell is first cell of a range of cells that have been merged.
485cdf0e10cSrcweir //  sal_uInt16 fMerged : 1;     // 0002 set to 1 when cell has been merged with preceding cell.
486cdf0e10cSrcweir //  sal_uInt16 fUnused : 14;    // FFFC reserved
487cdf0e10cSrcweir     WW8_BRCVer6 rgbrcVer6[4];
488cdf0e10cSrcweir // notational convenience for referring to brcTop, brcLeft, etc fields:
489cdf0e10cSrcweir //          BRC brcTop;             // specification of the top border of a table cell
490cdf0e10cSrcweir //          BRC brcLeft;            // specification of left border of table row
491cdf0e10cSrcweir //          BRC brcBottom;          // specification of bottom border of table row
492cdf0e10cSrcweir //          BRC brcRight;           // specification of right border of table row.
493cdf0e10cSrcweir };
494cdf0e10cSrcweir // cbTC (count of bytes of a TC) is 10(decimal), A(hex).
495cdf0e10cSrcweir 
496cdf0e10cSrcweir struct WW8_TCellVer8    // wird aus der Datei gelesen
497cdf0e10cSrcweir {
498cdf0e10cSrcweir     SVBT16 aBits1Ver8;      // Dokumentation siehe oben unter WW8_TCell
499cdf0e10cSrcweir     SVBT16 aUnused;         // reserve
500cdf0e10cSrcweir     WW8_BRC rgbrcVer8[4];   // Dokumentation siehe oben unter WW8_TCell
501cdf0e10cSrcweir };
502cdf0e10cSrcweir // cbTC (count of bytes of a TC) is 20(decimal), 14(hex).
503cdf0e10cSrcweir 
504cdf0e10cSrcweir 
505cdf0e10cSrcweir struct WW8_SHD              // struct SHD fehlt in der Beschreibung
506cdf0e10cSrcweir {
507cdf0e10cSrcweir private:
508cdf0e10cSrcweir     sal_uInt16 maBits;
509cdf0e10cSrcweir //  sal_uInt16 nFore : 5;       // 0x001f ForegroundColor
510cdf0e10cSrcweir //  sal_uInt16 nBack : 5;       // 0x03e0 BackgroundColor
511cdf0e10cSrcweir //  sal_uInt16 nStyle : 5;      // 0x7c00 Percentage and Style
512cdf0e10cSrcweir //  sal_uInt16 nDontKnow : 1;   // 0x8000 ???   ab Ver8: ebenfalls fuer Style
513cdf0e10cSrcweir 
514cdf0e10cSrcweir public:
WW8_SHDWW8_SHD515cdf0e10cSrcweir     WW8_SHD() : maBits(0) {}
516cdf0e10cSrcweir 
GetForeWW8_SHD517cdf0e10cSrcweir     sal_uInt8 GetFore() const { return (sal_uInt8)( maBits & 0x1f); }
GetBackWW8_SHD518cdf0e10cSrcweir     sal_uInt8 GetBack() const { return (sal_uInt8)((maBits >> 5 ) & 0x1f); }
GetStyleWW8_SHD519cdf0e10cSrcweir     sal_uInt8 GetStyle(bool bVer67)  const
520cdf0e10cSrcweir         { return (sal_uInt8)((maBits >> 10) & ( bVer67 ? 0x1f : 0x3f ) ); }
521cdf0e10cSrcweir 
GetValueWW8_SHD522cdf0e10cSrcweir     sal_uInt16 GetValue() const { return maBits; }
523cdf0e10cSrcweir 
SetValueWW8_SHD524cdf0e10cSrcweir     void SetValue(sal_uInt16 nVal) { maBits = nVal; }
SetWWValueWW8_SHD525cdf0e10cSrcweir     void SetWWValue(SVBT16 nVal) { maBits = SVBT16ToShort(nVal); }
526cdf0e10cSrcweir 
SetForeWW8_SHD527cdf0e10cSrcweir     void SetFore(sal_uInt8 nVal)
528cdf0e10cSrcweir     {
529cdf0e10cSrcweir         maBits &= 0xffe0;
530cdf0e10cSrcweir         maBits |= (nVal & 0x1f);
531cdf0e10cSrcweir     }
SetBackWW8_SHD532cdf0e10cSrcweir     void SetBack(sal_uInt8 nVal)
533cdf0e10cSrcweir     {
534cdf0e10cSrcweir         maBits &= 0xfc1f;
535cdf0e10cSrcweir         maBits |= (nVal & 0x1f) << 5;
536cdf0e10cSrcweir     }
SetStyleWW8_SHD537cdf0e10cSrcweir     void SetStyle(bool bVer67, sal_uInt8 nVal)
538cdf0e10cSrcweir     {
539cdf0e10cSrcweir         if (bVer67)
540cdf0e10cSrcweir         {
541cdf0e10cSrcweir             maBits &= 0x83ff;
542cdf0e10cSrcweir             maBits |= (nVal & 0x1f) << 10;
543cdf0e10cSrcweir         }
544cdf0e10cSrcweir         else
545cdf0e10cSrcweir         {
546cdf0e10cSrcweir             maBits &= 0x03ff;
547cdf0e10cSrcweir             maBits |= (nVal & 0x2f) << 10;
548cdf0e10cSrcweir         }
549cdf0e10cSrcweir     }
550cdf0e10cSrcweir };
551cdf0e10cSrcweir 
552cdf0e10cSrcweir struct WW8_ANLV
553cdf0e10cSrcweir {
554cdf0e10cSrcweir     SVBT8 nfc;          // 0        number format code, 0=Arabic, 1=Upper case Roman, 2=Lower case Roman
555cdf0e10cSrcweir                         //          3=Upper case Letter, 4=Lower case letter, 5=Ordinal
556cdf0e10cSrcweir     SVBT8 cbTextBefore; // 1        offset into anld.rgch limit of prefix text
557cdf0e10cSrcweir     SVBT8 cbTextAfter;  // 2
558cdf0e10cSrcweir     SVBT8 aBits1;
559cdf0e10cSrcweir //  sal_uInt8 jc : 2;        // 3 : 0x03 justification code, 0=left, 1=center, 2=right, 3=left and right justify
560cdf0e10cSrcweir //  sal_uInt8 fPrev : 1;     //     0x04 when ==1, include previous levels
561cdf0e10cSrcweir //  sal_uInt8 fHang : 1;     //     0x08 when ==1, number will be displayed using a hanging indent
562cdf0e10cSrcweir //  sal_uInt8 fSetBold : 1;  //     0x10 when ==1, boldness of number will be determined by anld.fBold.
563cdf0e10cSrcweir //  sal_uInt8 fSetItalic : 1;//     0x20 when ==1, italicness of number will be determined by anld.fItalic
564cdf0e10cSrcweir //  sal_uInt8 fSetSmallCaps : 1;//  0x40 when ==1, anld.fSmallCaps will determine whether number will be displayed in small caps or not.
565cdf0e10cSrcweir //  sal_uInt8 fSetCaps : 1;  //     0x80 when ==1, anld.fCaps will determine whether number will be displayed capitalized or not
566cdf0e10cSrcweir     SVBT8 aBits2;
567cdf0e10cSrcweir //  sal_uInt8 fSetStrike : 1;// 4 : 0x01 when ==1, anld.fStrike will determine whether the number will be displayed using strikethrough or not.
568cdf0e10cSrcweir //  sal_uInt8 fSetKul : 1;   //     0x02 when ==1, anld.kul will determine the underlining state of the autonumber.
569cdf0e10cSrcweir //  sal_uInt8 fPrevSpace : 1;//     0x04 when ==1, autonumber will be displayed with a single prefixing space character
570cdf0e10cSrcweir //  sal_uInt8 fBold : 1;     //     0x08 determines boldness of autonumber when anld.fSetBold == 1.
571cdf0e10cSrcweir //  sal_uInt8 fItalic : 1;   //     0x10 determines italicness of autonumber when anld.fSetItalic == 1.
572cdf0e10cSrcweir //  sal_uInt8 fSmallCaps : 1;//     0x20 determines whether autonumber will be displayed using small caps when anld.fSetSmallCaps == 1.
573cdf0e10cSrcweir //  sal_uInt8 fCaps : 1;     //     0x40 determines whether autonumber will be displayed using caps when anld.fSetCaps == 1.
574cdf0e10cSrcweir //  sal_uInt8 fStrike : 1;   //     0x80 determines whether autonumber will be displayed using caps when anld.fSetStrike == 1.
575cdf0e10cSrcweir     SVBT8 aBits3;
576cdf0e10cSrcweir //  sal_uInt8 kul : 3;       // 5 : 0x07 determines whether  autonumber will be displayed with underlining when anld.fSetKul == 1.
577cdf0e10cSrcweir //  sal_uInt8 ico : 5;       //     0xF1 color of autonumber
578cdf0e10cSrcweir     SVBT16 ftc;         // 6        font code of  autonumber
579cdf0e10cSrcweir     SVBT16 hps;         // 8        font half point size (or 0=auto)
580cdf0e10cSrcweir     SVBT16 iStartAt;    // 0x0a     starting value (0 to 65535)
581cdf0e10cSrcweir     SVBT16 dxaIndent;   // 0x0c     *short?* *sal_uInt16?* width of prefix text (same as indent)
582cdf0e10cSrcweir     SVBT16 dxaSpace;    // 0x0e     minimum space between number and paragraph
583cdf0e10cSrcweir };
584cdf0e10cSrcweir // *cbANLV (count of bytes of ANLV) is 16 (decimal), 10(hex).
585cdf0e10cSrcweir 
586cdf0e10cSrcweir struct WW8_ANLD
587cdf0e10cSrcweir {
588cdf0e10cSrcweir     WW8_ANLV eAnlv;     // 0
589cdf0e10cSrcweir     SVBT8 fNumber1;     // 0x10     number only 1 item per table cell
590cdf0e10cSrcweir     SVBT8 fNumberAcross;    // 0x11     number across cells in table rows(instead of down)
591cdf0e10cSrcweir     SVBT8 fRestartHdn;  // 0x12     restart heading number on section boundary
592cdf0e10cSrcweir     SVBT8 fSpareX;      // 0x13     unused( should be 0)
593cdf0e10cSrcweir     sal_uInt8  rgchAnld[32]; // 0x14 characters displayed before/after autonumber
594cdf0e10cSrcweir };
595cdf0e10cSrcweir 
596cdf0e10cSrcweir struct WW8_OLST
597cdf0e10cSrcweir {
598cdf0e10cSrcweir     WW8_ANLV rganlv[9]; // 0    an array of 9 ANLV structures (heading levels)
599cdf0e10cSrcweir     SVBT8 fRestartHdr;  // 0x90 when ==1, restart heading on section break
600cdf0e10cSrcweir     SVBT8 fSpareOlst2;  // 0x91 reserved
601cdf0e10cSrcweir     SVBT8 fSpareOlst3;  // 0x92 reserved
602cdf0e10cSrcweir     SVBT8 fSpareOlst4;  // 0x93 reserved
603cdf0e10cSrcweir     sal_uInt8 rgch[64];      // 0x94 array of 64 chars       text before/after number
604cdf0e10cSrcweir };
605cdf0e10cSrcweir // cbOLST is 212(decimal), D4(hex).
606cdf0e10cSrcweir 
607cdf0e10cSrcweir #if 0
608cdf0e10cSrcweir struct ANLV
609cdf0e10cSrcweir {
610cdf0e10cSrcweir     ALNV();
611cdf0e10cSrcweir     void ReadFromMem(const sal_uInt8 *&pData);
612cdf0e10cSrcweir     sal_uInt8 nfc;
613cdf0e10cSrcweir     sal_uInt8 cbTextBefore;
614cdf0e10cSrcweir     sal_uInt8 cbTextAfter;
615cdf0e10cSrcweir     sal_uInt8 jc : 2;
616cdf0e10cSrcweir     sal_uInt8 fPrev : 1;
617cdf0e10cSrcweir     sal_uInt8 fHang : 1;
618cdf0e10cSrcweir     sal_uInt8 fSetBold : 1;
619cdf0e10cSrcweir     sal_uInt8 fSetItalic : 1;
620cdf0e10cSrcweir     sal_uInt8 fSetSmallCaps : 1;
621cdf0e10cSrcweir     sal_uInt8 fSetCaps : 1;
622cdf0e10cSrcweir     sal_uInt8 fSetStrike : 1;
623cdf0e10cSrcweir     sal_uInt8 fSetKul : 1;
624cdf0e10cSrcweir     sal_uInt8 fPrevSpace : 1;
625cdf0e10cSrcweir     sal_uInt8 fBold : 1;
626cdf0e10cSrcweir     sal_uInt8 fItalic : 1;
627cdf0e10cSrcweir     sal_uInt8 fSmallCaps : 1;
628cdf0e10cSrcweir     sal_uInt8 fCaps : 1;
629cdf0e10cSrcweir     sal_uInt8 fStrike : 1;
630cdf0e10cSrcweir     sal_uInt8 kul : 3;
631cdf0e10cSrcweir     sal_uInt8 ico : 5;
632cdf0e10cSrcweir     sal_uInt16 ftc;
633cdf0e10cSrcweir     sal_uInt16 hps;
634cdf0e10cSrcweir     sal_uInt16 iStartAt;
635cdf0e10cSrcweir     sal_uInt16 dxaIndent;
636cdf0e10cSrcweir     sal_uInt16 dxaSpace;
637cdf0e10cSrcweir };
638cdf0e10cSrcweir 
639cdf0e10cSrcweir struct OLST
640cdf0e10cSrcweir {
641cdf0e10cSrcweir     OLST();
642cdf0e10cSrcweir     void ReadFromMem(const sal_uInt8 *&pData, bool bVer67)
643cdf0e10cSrcweir     ANLV rganlv[9];         // 0 an array of 9 ANLV structures (heading levels)
644cdf0e10cSrcweir     sal_uInt8 fRestartHdr;  // when ==1, restart heading on section break
645cdf0e10cSrcweir     sal_uInt8 fSpareOlst2;  // reserved
646cdf0e10cSrcweir     sal_uInt8 fSpareOlst3;  // reserved
647cdf0e10cSrcweir     sal_uInt8 fSpareOlst4;  // reserved
648cdf0e10cSrcweir     sal_uInt16 rgxch[64];   // array of 64 chars text before/after number
649cdf0e10cSrcweir #if 0
650cdf0e10cSrcweir     sal_uInt16 rgxch[32];   // array of 32 chars text before/after number
651cdf0e10cSrcweir     sal_uInt8 rgch[64];     // array of 64 chars text before/after number
652cdf0e10cSrcweir #endif
653cdf0e10cSrcweir };
654cdf0e10cSrcweir #endif
655cdf0e10cSrcweir 
656cdf0e10cSrcweir struct WW8_FDOA
657cdf0e10cSrcweir {
658cdf0e10cSrcweir     SVBT32 fc;          // 0  FC pointing to drawing object data
659cdf0e10cSrcweir     SVBT16 ctxbx;       // 4  count of textboxes in the drawing object
660cdf0e10cSrcweir };
661cdf0e10cSrcweir 
662cdf0e10cSrcweir struct WW8_DO
663cdf0e10cSrcweir {
664cdf0e10cSrcweir     SVBT16 dok;             // 0    Drawn Object Kind, currently this is always 0
665cdf0e10cSrcweir     SVBT16 cb;              // 2    size (count of bytes) of the entire DO
666cdf0e10cSrcweir     SVBT8  bx;              // 4    x position relative to anchor CP
667cdf0e10cSrcweir     SVBT8  by;              // 5    y position relative to anchor CP
668cdf0e10cSrcweir     SVBT16 dhgt;                // 6    height of DO
669cdf0e10cSrcweir     SVBT16 aBits1;
670cdf0e10cSrcweir //  sal_uInt16 fAnchorLock : 1; // 8    1 if the DO anchor is locked
671cdf0e10cSrcweir //  sal_uInt8[] rgdp;            // 0xa  variable length array of drawing primitives
672cdf0e10cSrcweir };
673cdf0e10cSrcweir 
674cdf0e10cSrcweir struct WW8_DPHEAD
675cdf0e10cSrcweir {
676cdf0e10cSrcweir     SVBT16 dpk;         //  0   Drawn Primitive Kind  REVIEW davebu
677cdf0e10cSrcweir   //        0=start of grouping, 1=line, 2=textbox, 3=rectangle,
678cdf0e10cSrcweir   //        4=arc, 5=elipse, 6=polyline, 7=callout textbox,
679cdf0e10cSrcweir   //        8=end of grouping, 9=sample primitve holding default values
680cdf0e10cSrcweir     SVBT16 cb;          // 2    size (count of bytes) of this DP
681cdf0e10cSrcweir     SVBT16 xa;          // 4    These 2 points describe the rectangle
682cdf0e10cSrcweir     SVBT16 ya;          // 6    enclosing this DP relative to the origin of
683cdf0e10cSrcweir     SVBT16 dxa;         // 8    the DO
684cdf0e10cSrcweir     SVBT16 dya;         // 0xa
685cdf0e10cSrcweir };
686cdf0e10cSrcweir 
687cdf0e10cSrcweir 
688cdf0e10cSrcweir struct WW8_DP_LINETYPE
689cdf0e10cSrcweir {
690cdf0e10cSrcweir     SVBT32 lnpc;            // LiNe Property Color -- RGB color value
691cdf0e10cSrcweir     SVBT16 lnpw;            // line property weight in twips
692cdf0e10cSrcweir     SVBT16 lnps;            // line property style : 0=Solid, 1=Dashed
693cdf0e10cSrcweir                             // 2=Dotted, 3=Dash Dot, 4=Dash Dot Dot, 5=Hollow
694cdf0e10cSrcweir };
695cdf0e10cSrcweir 
696cdf0e10cSrcweir struct WW8_DP_SHADOW    // Schattierung!
697cdf0e10cSrcweir {
698cdf0e10cSrcweir     SVBT16 shdwpi;          // Shadow Property Intensity
699cdf0e10cSrcweir     SVBT16 xaOffset;        // x offset of shadow
700cdf0e10cSrcweir     SVBT16 yaOffset;        // y offset of shadow
701cdf0e10cSrcweir };
702cdf0e10cSrcweir 
703cdf0e10cSrcweir struct WW8_DP_FILL
704cdf0e10cSrcweir {
705cdf0e10cSrcweir     SVBT32 dlpcFg;          // FiLl Property Color ForeGround -- RGB color value
706cdf0e10cSrcweir     SVBT32 dlpcBg;          // Property Color BackGround -- RGB color value
707cdf0e10cSrcweir     SVBT16 flpp;            // FiLl Property Pattern REVIEW davebu
708cdf0e10cSrcweir };
709cdf0e10cSrcweir 
710cdf0e10cSrcweir struct WW8_DP_LINEEND
711cdf0e10cSrcweir {
712cdf0e10cSrcweir     SVBT16 aStartBits;
713cdf0e10cSrcweir //  sal_uInt16 eppsStart : 2;   // Start EndPoint Property Style
714cdf0e10cSrcweir                             // 0=None, 1=Hollow, 2=Filled
715cdf0e10cSrcweir //  sal_uInt16 eppwStart : 2;   // Start EndPoint Property Weight
716cdf0e10cSrcweir //  sal_uInt16 epplStart : 2;   // Start EndPoint Property length
717cdf0e10cSrcweir //  sal_uInt16 dummyStart : 10; // Alignment
718cdf0e10cSrcweir     SVBT16 aEndBits;
719cdf0e10cSrcweir //  sal_uInt16 eppsEnd : 2;     // End EndPoint Property Style
720cdf0e10cSrcweir //  sal_uInt16 eppwEnd : 2;     // End EndPoint Property Weight
721cdf0e10cSrcweir //  sal_uInt16 epplEnd : 2;     // End EndPoint Property length
722cdf0e10cSrcweir //  sal_uInt16 dummyEnd : 10;   // Alignment
723cdf0e10cSrcweir };
724cdf0e10cSrcweir 
725cdf0e10cSrcweir struct WW8_DP_LINE
726cdf0e10cSrcweir {
727cdf0e10cSrcweir //  WW8_DPHEAD dphead;      // 0    Common header for a drawing primitive
728cdf0e10cSrcweir     SVBT16 xaStart;         // starting point for line
729cdf0e10cSrcweir     SVBT16 yaStart;         //
730cdf0e10cSrcweir     SVBT16 xaEnd;           // ending point for line
731cdf0e10cSrcweir     SVBT16 yaEnd;
732cdf0e10cSrcweir     WW8_DP_LINETYPE aLnt;
733cdf0e10cSrcweir     WW8_DP_LINEEND aEpp;
734cdf0e10cSrcweir     WW8_DP_SHADOW aShd;
735cdf0e10cSrcweir };
736cdf0e10cSrcweir 
737cdf0e10cSrcweir struct WW8_DP_TXTBOX
738cdf0e10cSrcweir {
739cdf0e10cSrcweir     WW8_DP_LINETYPE aLnt;
740cdf0e10cSrcweir     WW8_DP_FILL aFill;
741cdf0e10cSrcweir     WW8_DP_SHADOW aShd;
742cdf0e10cSrcweir     SVBT16 aBits1;
743cdf0e10cSrcweir //  sal_uInt16 fRoundCorners : 1; //0x24    0001    1 if the textbox has rounded corners
744cdf0e10cSrcweir //  sal_uInt16 zaShape : 15;    // 0x24     000e    REVIEW davebu
745cdf0e10cSrcweir     SVBT16 dzaInternalMargin; // 0x26   REVIEW davebu
746cdf0e10cSrcweir };
747cdf0e10cSrcweir 
748cdf0e10cSrcweir struct WW8_DP_RECT
749cdf0e10cSrcweir {
750cdf0e10cSrcweir     WW8_DP_LINETYPE aLnt;
751cdf0e10cSrcweir     WW8_DP_FILL aFill;
752cdf0e10cSrcweir     WW8_DP_SHADOW aShd;
753cdf0e10cSrcweir     SVBT16 aBits1;
754cdf0e10cSrcweir //  sal_uInt16 fRoundCorners : 1; // 0x24   0001    1 if the textbox has rounded corners
755cdf0e10cSrcweir //  sal_uInt16 zaShape : 15; // 0x24 000e   REVIEW davebu
756cdf0e10cSrcweir };
757cdf0e10cSrcweir 
758cdf0e10cSrcweir struct WW8_DP_ARC
759cdf0e10cSrcweir {
760cdf0e10cSrcweir     WW8_DP_LINETYPE aLnt;
761cdf0e10cSrcweir     WW8_DP_FILL aFill;
762cdf0e10cSrcweir     WW8_DP_SHADOW aShd;
763cdf0e10cSrcweir     SVBT8 fLeft;        // 0x24 00ff    REVIEW davebu
764cdf0e10cSrcweir     SVBT8 fUp;          // 0x24 ff00    REVIEW davebu
765cdf0e10cSrcweir //  sal_uInt16 fLeft : 8;   // 0x24 00ff    REVIEW davebu
766cdf0e10cSrcweir //  sal_uInt16 fUp : 8;     // 0x24 ff00    REVIEW davebu
767cdf0e10cSrcweir };
768cdf0e10cSrcweir 
769cdf0e10cSrcweir struct WW8_DP_ELIPSE
770cdf0e10cSrcweir {
771cdf0e10cSrcweir     WW8_DP_LINETYPE aLnt;
772cdf0e10cSrcweir     WW8_DP_FILL aFill;
773cdf0e10cSrcweir     WW8_DP_SHADOW aShd;
774cdf0e10cSrcweir };
775cdf0e10cSrcweir 
776cdf0e10cSrcweir struct WW8_DP_POLYLINE
777cdf0e10cSrcweir {
778cdf0e10cSrcweir     WW8_DP_LINETYPE aLnt;
779cdf0e10cSrcweir     WW8_DP_FILL aFill;
780cdf0e10cSrcweir     WW8_DP_LINEEND aEpp;
781cdf0e10cSrcweir     WW8_DP_SHADOW aShd;
782cdf0e10cSrcweir     SVBT16 aBits1;
783cdf0e10cSrcweir //  sal_uInt16 fPolygon : 1; // 0x28  0001  1 if this is a polygon
784cdf0e10cSrcweir //  sal_uInt16 cpt : 15;    // 0x28   00fe  count of points
785cdf0e10cSrcweir //  short xaFirst;      // 0x2a These are the endpoints of the first line.
786cdf0e10cSrcweir //  short yaFirst;      // 0x2c
787cdf0e10cSrcweir //  short xaEnd;        // 0x2e
788cdf0e10cSrcweir //  short yaEnd;        // 0x30
789cdf0e10cSrcweir //  short rgpta[];      // 0x32 An array of xa,ya pairs for the remaining points
790cdf0e10cSrcweir };
791cdf0e10cSrcweir 
792cdf0e10cSrcweir struct WW8_DP_CALLOUT_TXTBOX
793cdf0e10cSrcweir {
794cdf0e10cSrcweir     SVBT16 flags;               // 0x0c REVIEW davebu flags
795cdf0e10cSrcweir     SVBT16 dzaOffset;           // 0x0e REVIEW davebu
796cdf0e10cSrcweir     SVBT16 dzaDescent;          // 0x10 REVIEW davebu
797cdf0e10cSrcweir     SVBT16 dzaLength;           // 0x12 REVIEW davebu
798cdf0e10cSrcweir     WW8_DPHEAD dpheadTxbx;      // 0x14 DPHEAD for a textbox
799cdf0e10cSrcweir     WW8_DP_TXTBOX dptxbx;       // 0x20 DP for a textbox
800cdf0e10cSrcweir     WW8_DPHEAD dpheadPolyLine;  // 0x4c DPHEAD for a Polyline
801cdf0e10cSrcweir     WW8_DP_POLYLINE dpPolyLine; // 0x48 DP for a polyline
802cdf0e10cSrcweir };
803cdf0e10cSrcweir 
804cdf0e10cSrcweir struct WW8_PCD
805cdf0e10cSrcweir {
806cdf0e10cSrcweir     SVBT8 aBits1;
807cdf0e10cSrcweir //  sal_uInt8 fNoParaLast : 1;   // when 1, means that piece contains no end of paragraph marks.
808cdf0e10cSrcweir //  sal_uInt8 fPaphNil : 1;      // used internally by Word
809cdf0e10cSrcweir //  sal_uInt8 fCopied : 1;       // used internally by Word
810cdf0e10cSrcweir //          *   int :5
811cdf0e10cSrcweir     SVBT8 aBits2;           // fn int:8, used internally by Word
812cdf0e10cSrcweir     SVBT32 fc;              // file offset of beginning of piece. The size of the
813cdf0e10cSrcweir                             // ithpiece can be determined by subtracting rgcp[i] of
814cdf0e10cSrcweir                             // the containing plcfpcd from its rgcp[i+1].
815cdf0e10cSrcweir     SVBT16 prm;             // PRM contains either a single sprm or else an index number
816cdf0e10cSrcweir                             // of the grpprl which contains the sprms that modify the
817cdf0e10cSrcweir                             // properties of the piece.
818cdf0e10cSrcweir };
819cdf0e10cSrcweir 
820cdf0e10cSrcweir // AnnoTation Refernce Descriptor (ATRD)
821cdf0e10cSrcweir struct WW8_ATRD                 // fuer die 8-Version
822cdf0e10cSrcweir {
823cdf0e10cSrcweir     SVBT16 xstUsrInitl[ 10 ];       // pascal-style String holding initials
824cdf0e10cSrcweir                                     // of annotation author
825cdf0e10cSrcweir     SVBT16 ibst;                    // index into GrpXstAtnOwners
826cdf0e10cSrcweir     SVBT16 ak;                      // not used
827cdf0e10cSrcweir     SVBT16 grfbmc;                  // not used
828cdf0e10cSrcweir     SVBT32 ITagBkmk;                // when not -1, this tag identifies the
829cdf0e10cSrcweir                                     // annotation bookmark that locates the
830cdf0e10cSrcweir                                     // range of CPs in the main document which
831cdf0e10cSrcweir                                     // this annotation references.
832cdf0e10cSrcweir };
833cdf0e10cSrcweir 
834cdf0e10cSrcweir struct WW8_ATRDEXTRA
835cdf0e10cSrcweir {
836cdf0e10cSrcweir     // ---  Extended bit since Word 2002 --- //
837cdf0e10cSrcweir 
838cdf0e10cSrcweir     SVBT32 dttm;
839cdf0e10cSrcweir     SVBT16 bf;
840cdf0e10cSrcweir     SVBT32 cDepth;
841cdf0e10cSrcweir     SVBT32 diatrdParent;
842cdf0e10cSrcweir     SVBT32 Discussitem;
843cdf0e10cSrcweir };
844cdf0e10cSrcweir 
845cdf0e10cSrcweir struct WW67_ATRD                // fuer die 6/7-Version
846cdf0e10cSrcweir {
847cdf0e10cSrcweir     sal_Char xstUsrInitl[ 10 ];     // pascal-style String holding initials
848cdf0e10cSrcweir                                     // of annotation author
849cdf0e10cSrcweir     SVBT16 ibst;                    // index into GrpXstAtnOwners
850cdf0e10cSrcweir     SVBT16 ak;                      // not used
851cdf0e10cSrcweir     SVBT16 grfbmc;                  // not used
852cdf0e10cSrcweir     SVBT32 ITagBkmk;                // when not -1, this tag identifies the
853cdf0e10cSrcweir                                     // annotation bookmark that locates the
854cdf0e10cSrcweir                                     // range of CPs in the main document which
855cdf0e10cSrcweir                                     // this annotation references.
856cdf0e10cSrcweir };
857cdf0e10cSrcweir 
858cdf0e10cSrcweir struct WW8_TablePos
859cdf0e10cSrcweir {
860cdf0e10cSrcweir     sal_Int16 nSp26;
861cdf0e10cSrcweir     sal_Int16 nSp27;
862cdf0e10cSrcweir     sal_Int16 nLeMgn;
863cdf0e10cSrcweir     sal_Int16 nRiMgn;
864cdf0e10cSrcweir     sal_Int16 nUpMgn;
865cdf0e10cSrcweir     sal_Int16 nLoMgn;
866cdf0e10cSrcweir     sal_uInt8 nSp29;
867cdf0e10cSrcweir     sal_uInt8 nSp37;
868cdf0e10cSrcweir };
869cdf0e10cSrcweir 
870cdf0e10cSrcweir struct WW8_FSPA
871cdf0e10cSrcweir {
872cdf0e10cSrcweir public:
873cdf0e10cSrcweir     sal_Int32 nSpId;     //Shape Identifier. Used in conjunction with the office art data (found via fcDggInfo in the FIB) to find the actual data for this shape.
874cdf0e10cSrcweir     sal_Int32 nXaLeft;   //left of rectangle enclosing shape relative to the origin of the shape
875cdf0e10cSrcweir     sal_Int32 nYaTop;        //top of rectangle enclosing shape relative to the origin of the shape
876cdf0e10cSrcweir     sal_Int32 nXaRight;  //right of rectangle enclosing shape relative to the origin of the shape
877cdf0e10cSrcweir     sal_Int32 nYaBottom;//bottom of the rectangle enclosing shape relative to the origin of the shape
878cdf0e10cSrcweir     sal_uInt16 bHdr:1;
879cdf0e10cSrcweir     //0001 1 in the undo doc when shape is from the header doc, 0 otherwise (undefined when not in the undo doc)
880cdf0e10cSrcweir     sal_uInt16 nbx:2;
881cdf0e10cSrcweir     //0006 x position of shape relative to anchor CP
882cdf0e10cSrcweir     //0 relative to page margin
883cdf0e10cSrcweir     //1 relative to top of page
884cdf0e10cSrcweir     //2 relative to text (column for horizontal text; paragraph for vertical text)
885cdf0e10cSrcweir     //3 reserved for future use
886cdf0e10cSrcweir     sal_uInt16 nby:2;
887cdf0e10cSrcweir     //0018 y position of shape relative to anchor CP
888cdf0e10cSrcweir     //0 relative to page margin
889cdf0e10cSrcweir     //1 relative to top of page
890cdf0e10cSrcweir     //2 relative to text (paragraph for horizontal text; column for vertical text)
891cdf0e10cSrcweir     sal_uInt16 nwr:4;
892cdf0e10cSrcweir     //01E0 text wrapping mode
893cdf0e10cSrcweir     //0 like 2, but doesn't require absolute object
894cdf0e10cSrcweir     //1 no text next to shape
895cdf0e10cSrcweir     //2 wrap around absolute object
896cdf0e10cSrcweir     //3 wrap as if no object present
897cdf0e10cSrcweir     //4 wrap tightly around object
898cdf0e10cSrcweir     //5 wrap tightly, but allow holes
899cdf0e10cSrcweir     //6-15 reserved for future use
900cdf0e10cSrcweir     sal_uInt16 nwrk:4;
901cdf0e10cSrcweir     //1E00 text wrapping mode type (valid only for wrapping modes 2 and 4
902cdf0e10cSrcweir     //0 wrap both sides
903cdf0e10cSrcweir     //1 wrap only on left
904cdf0e10cSrcweir     //2 wrap only on right
905cdf0e10cSrcweir     //3 wrap only on largest side
906cdf0e10cSrcweir     sal_uInt16 bRcaSimple:1;
907cdf0e10cSrcweir     //2000 when set, temporarily overrides bx, by, forcing the xaLeft, xaRight, yaTop, and yaBottom fields to all be page relative.
908cdf0e10cSrcweir     sal_uInt16 bBelowText:1;
909cdf0e10cSrcweir     //4000
910cdf0e10cSrcweir     //1 shape is below text
911cdf0e10cSrcweir     //0 shape is above text
912cdf0e10cSrcweir     sal_uInt16 bAnchorLock:1;
913cdf0e10cSrcweir     //8000  1 anchor is locked
914cdf0e10cSrcweir     //      0 anchor is not locked
915cdf0e10cSrcweir     sal_Int32 nTxbx; //count of textboxes in shape (undo doc only)
916cdf0e10cSrcweir public:
917cdf0e10cSrcweir     enum FSPAOrient {RelPgMargin, RelPageBorder, RelText};
918cdf0e10cSrcweir };
919cdf0e10cSrcweir 
920cdf0e10cSrcweir 
921cdf0e10cSrcweir struct WW8_FSPA_SHADOW  // alle Member an gleicher Position und Groesse,
922cdf0e10cSrcweir {                                               // wegen:  pF = (WW8_FSPA*)pFS;
923cdf0e10cSrcweir     SVBT32 nSpId;
924cdf0e10cSrcweir     SVBT32 nXaLeft;
925cdf0e10cSrcweir     SVBT32 nYaTop;
926cdf0e10cSrcweir     SVBT32 nXaRight;
927cdf0e10cSrcweir     SVBT32 nYaBottom;
928cdf0e10cSrcweir     SVBT16 aBits1;
929cdf0e10cSrcweir     SVBT32 nTxbx;
930cdf0e10cSrcweir };
931cdf0e10cSrcweir 
932cdf0e10cSrcweir struct WW8_TXBXS
933cdf0e10cSrcweir {
934cdf0e10cSrcweir     SVBT32 cTxbx_iNextReuse;
935cdf0e10cSrcweir     SVBT32 cReusable;
936cdf0e10cSrcweir     SVBT16 fReusable;
937cdf0e10cSrcweir     SVBT32 reserved;
938cdf0e10cSrcweir     SVBT32 ShapeId;
939cdf0e10cSrcweir     SVBT32 txidUndo;
940cdf0e10cSrcweir };
941cdf0e10cSrcweir 
942cdf0e10cSrcweir struct WW8_STRINGID
943cdf0e10cSrcweir {
944cdf0e10cSrcweir     // M.M. This is the extra data stored in the SttbfFnm
945cdf0e10cSrcweir     // For now I only need the String Id
946cdf0e10cSrcweir     SVBT16 nStringId;
947cdf0e10cSrcweir     SVBT16 reserved1;
948cdf0e10cSrcweir     SVBT16 reserved2;
949cdf0e10cSrcweir     SVBT16 reserved3;
950cdf0e10cSrcweir };
951cdf0e10cSrcweir 
952cdf0e10cSrcweir struct WW8_WKB
953cdf0e10cSrcweir {
954cdf0e10cSrcweir     // M.M. This is the WkbPLCF struct
955cdf0e10cSrcweir     // For now I only need the Link Id
956cdf0e10cSrcweir     SVBT16 reserved1;
957cdf0e10cSrcweir     SVBT16 reserved2;
958cdf0e10cSrcweir     SVBT16 reserved3;
959cdf0e10cSrcweir     SVBT16 nLinkId;
960cdf0e10cSrcweir     SVBT16 reserved4;
961cdf0e10cSrcweir     SVBT16 reserved5;
962cdf0e10cSrcweir };
963cdf0e10cSrcweir 
964cdf0e10cSrcweir #ifdef SAL_W32
965cdf0e10cSrcweir #   pragma pack(pop)
966cdf0e10cSrcweir #elif defined(SAL_OS2)
967cdf0e10cSrcweir #   pragma pack()
968cdf0e10cSrcweir #endif
969cdf0e10cSrcweir 
970*8338ba1bSJürgen Schmidt // Maximum number of columns according the WW8 specification
971*8338ba1bSJürgen Schmidt static const sal_uInt8 MAX_NO_OF_SEP_COLUMNS = 44;
972*8338ba1bSJürgen Schmidt 
973cdf0e10cSrcweir struct SEPr
974cdf0e10cSrcweir {
975cdf0e10cSrcweir     SEPr();
976cdf0e10cSrcweir     sal_uInt8 bkc;
977cdf0e10cSrcweir     sal_uInt8 fTitlePage;
978cdf0e10cSrcweir     sal_Int8 fAutoPgn;
979cdf0e10cSrcweir     sal_uInt8 nfcPgn;
980cdf0e10cSrcweir     sal_uInt8 fUnlocked;
981cdf0e10cSrcweir     sal_uInt8 cnsPgn;
982cdf0e10cSrcweir     sal_uInt8 fPgnRestart;
983cdf0e10cSrcweir     sal_uInt8 fEndNote;
984cdf0e10cSrcweir     sal_Int8 lnc;
985cdf0e10cSrcweir     sal_Int8 grpfIhdt;
986cdf0e10cSrcweir     sal_uInt16 nLnnMod;
987cdf0e10cSrcweir     sal_Int32 dxaLnn;
988cdf0e10cSrcweir     sal_Int16 dxaPgn;
989cdf0e10cSrcweir     sal_Int16 dyaPgn;
990cdf0e10cSrcweir     sal_Int8 fLBetween;
991cdf0e10cSrcweir     sal_Int8 vjc;
992cdf0e10cSrcweir     sal_uInt16 dmBinFirst;
993cdf0e10cSrcweir     sal_uInt16 dmBinOther;
994cdf0e10cSrcweir     sal_uInt16 dmPaperReq;
995cdf0e10cSrcweir #if 0
996cdf0e10cSrcweir     28  1C  brcTop                    BRC                   top page border
997cdf0e10cSrcweir 
998cdf0e10cSrcweir     32  20  brcLeft                   BRC                   left page border
999cdf0e10cSrcweir 
1000cdf0e10cSrcweir     36  24  brcBottom                 BRC                   bottom page border
1001cdf0e10cSrcweir 
1002cdf0e10cSrcweir     40  28  brcRight                  BRC                   right page border
1003cdf0e10cSrcweir #endif
1004cdf0e10cSrcweir     sal_Int16 fPropRMark;
1005cdf0e10cSrcweir     sal_Int16 ibstPropRMark;
1006cdf0e10cSrcweir     sal_Int32 dttmPropRMark;        //DTTM
1007cdf0e10cSrcweir     sal_Int32 dxtCharSpace;
1008cdf0e10cSrcweir     sal_Int32 dyaLinePitch;
1009cdf0e10cSrcweir     sal_uInt16 clm;
1010cdf0e10cSrcweir     sal_Int16 reserved1;
1011cdf0e10cSrcweir     sal_uInt8 dmOrientPage;
1012cdf0e10cSrcweir     sal_uInt8 iHeadingPgn;
1013cdf0e10cSrcweir     sal_uInt16 pgnStart;
1014cdf0e10cSrcweir     sal_Int16 lnnMin;
1015cdf0e10cSrcweir     sal_uInt16 wTextFlow;
1016cdf0e10cSrcweir     sal_Int16 reserved2;
1017cdf0e10cSrcweir     sal_uInt16 pgbApplyTo:3;
1018cdf0e10cSrcweir     sal_uInt16 pgbPageDepth:2;
1019cdf0e10cSrcweir     sal_Int16 pgbOffsetFrom:3;
1020cdf0e10cSrcweir     sal_Int16 :8;
1021cdf0e10cSrcweir     sal_uInt32 xaPage;
1022cdf0e10cSrcweir     sal_uInt32 yaPage;
1023cdf0e10cSrcweir     sal_uInt32 xaPageNUp;
1024cdf0e10cSrcweir     sal_uInt32 yaPageNUp;
1025cdf0e10cSrcweir     sal_uInt32 dxaLeft;
1026cdf0e10cSrcweir     sal_uInt32 dxaRight;
1027cdf0e10cSrcweir     sal_Int32 dyaTop;
1028cdf0e10cSrcweir     sal_Int32 dyaBottom;
1029cdf0e10cSrcweir     sal_uInt32 dzaGutter;
1030cdf0e10cSrcweir     sal_uInt32 dyaHdrTop;
1031cdf0e10cSrcweir     sal_uInt32 dyaHdrBottom;
1032*8338ba1bSJürgen Schmidt     sal_Int16 ccolM1;   // have to be less than MAX_NO_OF_SEP_COLUMNS according the WW8 specification
1033cdf0e10cSrcweir     sal_Int8 fEvenlySpaced;
1034cdf0e10cSrcweir     sal_Int8 reserved3;
1035cdf0e10cSrcweir     sal_uInt8 fBiDi;
1036cdf0e10cSrcweir     sal_uInt8 fFacingCol;
1037cdf0e10cSrcweir     sal_uInt8 fRTLGutter;
1038cdf0e10cSrcweir     sal_uInt8 fRTLAlignment;
1039cdf0e10cSrcweir     sal_Int32 dxaColumns;
1040*8338ba1bSJürgen Schmidt 
1041*8338ba1bSJürgen Schmidt     // Fixed array - two entries for each SEP column to store width of column and spacing to next column.
1042*8338ba1bSJürgen Schmidt     // At odd index values [1,3,5,...] the column widths are stored.
1043*8338ba1bSJürgen Schmidt     // At even index values [2,4,6,...] the spacings to the next columns are stored.
1044*8338ba1bSJürgen Schmidt     // Value at index 0 is initialized with 0 and used for easier interation on the array
1045*8338ba1bSJürgen Schmidt     sal_Int32 rgdxaColumnWidthSpacing[MAX_NO_OF_SEP_COLUMNS*2 + 1];
1046*8338ba1bSJürgen Schmidt 
1047cdf0e10cSrcweir     sal_Int32 dxaColumnWidth;
1048cdf0e10cSrcweir     sal_uInt8 dmOrientFirst;
1049cdf0e10cSrcweir     sal_uInt8 fLayout;
1050cdf0e10cSrcweir     sal_Int16 reserved4;
1051cdf0e10cSrcweir #if 0
1052cdf0e10cSrcweir     OLST olstAnm;       //currently unused
1053cdf0e10cSrcweir #endif
1054cdf0e10cSrcweir };
1055cdf0e10cSrcweir 
1056cdf0e10cSrcweir namespace wwUtility
1057cdf0e10cSrcweir {
1058cdf0e10cSrcweir     sal_uInt32 BGRToRGB(sal_uInt32 nColour);
RGBToBGR(sal_uInt32 nColour)1059cdf0e10cSrcweir     inline sal_uInt32 RGBToBGR(sal_uInt32 nColour) { return BGRToRGB(nColour); }
1060cdf0e10cSrcweir }
1061cdf0e10cSrcweir 
1062cdf0e10cSrcweir #endif
1063cdf0e10cSrcweir 
1064cdf0e10cSrcweir /* vi:set tabstop=4 shiftwidth=4 expandtab: */
1065