xref: /aoo41x/main/sw/source/filter/ww8/dump/dump8a.cxx (revision efeef26f)
1*efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*efeef26fSAndrew Rist  * distributed with this work for additional information
6*efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9*efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*efeef26fSAndrew Rist  *
11*efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*efeef26fSAndrew Rist  *
13*efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15*efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*efeef26fSAndrew Rist  * specific language governing permissions and limitations
18*efeef26fSAndrew Rist  * under the License.
19*efeef26fSAndrew Rist  *
20*efeef26fSAndrew Rist  *************************************************************/
21*efeef26fSAndrew Rist 
22*efeef26fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir //#include <stdio.h>		// SEEK_SET
29cdf0e10cSrcweir #include <string.h> 	// memset(), ...
30cdf0e10cSrcweir #include <io.h> 		// access()
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir //#include "defs.hxx"
34cdf0e10cSrcweir #include <tools/solar.h>
35cdf0e10cSrcweir #include <sot/storage.hxx>
36cdf0e10cSrcweir #include "ww8struc.hxx"
37cdf0e10cSrcweir #include "ww8scan.hxx"
38cdf0e10cSrcweir #include "ww8darr.hxx"
39cdf0e10cSrcweir #include "ww8dout.hxx"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir #define ASSERT( a, b ) ( (a)?(void)0:(void)(*pOut<<endl1<<"ASSERTION failed "<< __FILE__<<__LINE__<< b <<endl1) )
42cdf0e10cSrcweir 
43cdf0e10cSrcweir 
44cdf0e10cSrcweir #define nWW8MaxListLevel 9
45cdf0e10cSrcweir 
46cdf0e10cSrcweir WW8ScannerBase* pSBase = 0;
47cdf0e10cSrcweir //WW8PLCFMan* pPLCFMan = 0;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir WW8Fib* 		   pWwFib = 0;
50cdf0e10cSrcweir SvStorageRef*	   pxStor;
51cdf0e10cSrcweir SvStorageStreamRef xStrm;
52cdf0e10cSrcweir SvStorageStreamRef xTableStream;	// ist bei Ver6-7 mit xStrm identisch,
53cdf0e10cSrcweir 									// ansonsten entweder 0TABLE oder 1TABLE
54cdf0e10cSrcweir SvStorageStreamRef xDataStream; 	// ist bei Ver6-7 mit xStrm identisch,
55cdf0e10cSrcweir 									// ansonsten DATA
56cdf0e10cSrcweir 
57cdf0e10cSrcweir typedef void (*FNDumpData)( void* );
58cdf0e10cSrcweir 
59cdf0e10cSrcweir sal_Bool DumpChar( sal_uInt8 c );
60cdf0e10cSrcweir void DumpShortPlainText( WW8_CP nStartCp, long nTextLen, char* pName );
61cdf0e10cSrcweir void DumpPlainText( WW8_CP nStartCp, long nTextLen, char* pName );
62cdf0e10cSrcweir void DumpSprms( sal_uInt8 nVersion, SvStream& rSt, short nLen );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 
WW8ReadINT32(SvStream & rStrm,sal_Int32 & rTarget)65cdf0e10cSrcweir sal_Bool WW8ReadINT32( SvStream& rStrm, sal_Int32& rTarget )
66cdf0e10cSrcweir {
67cdf0e10cSrcweir       rStrm >> rTarget;
68cdf0e10cSrcweir 	  return sal_True;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	  SVBT32 nData;
72cdf0e10cSrcweir       sal_Bool bOk = sal_True;
73cdf0e10cSrcweir       if( 4 == rStrm.Read( &nData, 4 ) )
74cdf0e10cSrcweir               rTarget = SVBT32ToUInt32( nData );
75cdf0e10cSrcweir       else
76cdf0e10cSrcweir               bOk = sal_False;
77cdf0e10cSrcweir       return bOk;
78cdf0e10cSrcweir }
79cdf0e10cSrcweir 
WW8ReadINT16(SvStream & rStrm,sal_Int16 & rTarget)80cdf0e10cSrcweir sal_Bool WW8ReadINT16( SvStream& rStrm, sal_Int16& rTarget )
81cdf0e10cSrcweir {
82cdf0e10cSrcweir       rStrm >> rTarget;
83cdf0e10cSrcweir 	  return sal_True;
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 
86cdf0e10cSrcweir       SVBT16 nData;
87cdf0e10cSrcweir       sal_Bool bOk = sal_True;
88cdf0e10cSrcweir       if( 2 == rStrm.Read( &nData, 2 ) )
89cdf0e10cSrcweir       {
90cdf0e10cSrcweir               rTarget = SVBT16ToShort( nData );
91cdf0e10cSrcweir       }
92cdf0e10cSrcweir       else
93cdf0e10cSrcweir               bOk = sal_False;
94cdf0e10cSrcweir       return bOk;
95cdf0e10cSrcweir }
96cdf0e10cSrcweir 
WW8ReadBYTE(SvStream & rStrm,sal_uInt8 & rTarget)97cdf0e10cSrcweir sal_Bool WW8ReadBYTE( SvStream& rStrm, sal_uInt8& rTarget )
98cdf0e10cSrcweir {
99cdf0e10cSrcweir       rStrm >> rTarget;
100cdf0e10cSrcweir 	  return sal_True;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 
103cdf0e10cSrcweir       SVBT8 nData;
104cdf0e10cSrcweir       sal_Bool bOk = sal_True;
105cdf0e10cSrcweir       if( 1 == rStrm.Read( &nData, 1 ) )
106cdf0e10cSrcweir               rTarget = SVBT8ToByte( nData );
107cdf0e10cSrcweir       else
108cdf0e10cSrcweir               bOk = sal_False;
109cdf0e10cSrcweir       return bOk;
110cdf0e10cSrcweir }
111cdf0e10cSrcweir 
WW8ReadUINT32(SvStream & rStrm,sal_uInt32 & rTarget)112cdf0e10cSrcweir sal_Bool WW8ReadUINT32( SvStream& rStrm, sal_uInt32& rTarget )
113cdf0e10cSrcweir      { return WW8ReadINT32( rStrm, (sal_Int32&) rTarget ); }
114cdf0e10cSrcweir 
WW8ReadUINT16(SvStream & rStrm,sal_uInt16 & rTarget)115cdf0e10cSrcweir sal_Bool WW8ReadUINT16( SvStream& rStrm, sal_uInt16& rTarget )
116cdf0e10cSrcweir      { return WW8ReadINT16( rStrm, (sal_Int16&) rTarget ); }
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 
Dump_LVL(sal_uInt16 nLevel)119cdf0e10cSrcweir static void Dump_LVL( sal_uInt16 nLevel )
120cdf0e10cSrcweir {
121cdf0e10cSrcweir 	indent( *pOut, *xTableStream );
122cdf0e10cSrcweir 
123cdf0e10cSrcweir 	long nStart, dxaSpace, dxaIndent;
124cdf0e10cSrcweir 	sal_uInt8 nfc, nFlags, ixchFollow, cbChpx, cbPapx;
125cdf0e10cSrcweir 	sal_uInt8 aOfsNumsXCH[nWW8MaxListLevel];
126cdf0e10cSrcweir 	*xTableStream >> nStart >> nfc >> nFlags;
127cdf0e10cSrcweir 	xTableStream->Read( aOfsNumsXCH, 9 );
128cdf0e10cSrcweir 	*xTableStream >> ixchFollow >> dxaSpace >> dxaIndent
129cdf0e10cSrcweir 		>> cbChpx >> cbPapx;
130cdf0e10cSrcweir 	xTableStream->SeekRel( 2 );
131cdf0e10cSrcweir 
132cdf0e10cSrcweir 	*pOut << " Level: " << nLevel << endl1;
133cdf0e10cSrcweir 	*pOut << indent2 << "  Start: " << nStart
134cdf0e10cSrcweir 					<< " Fmt: " << (sal_uInt16)nfc
135cdf0e10cSrcweir 					<< " Follow: ";
136cdf0e10cSrcweir 	if( 0 == ixchFollow ) *pOut << "tab";
137cdf0e10cSrcweir 	else if( 1 == ixchFollow ) *pOut << "blank";
138cdf0e10cSrcweir 	else if( 2 == ixchFollow ) *pOut << "nothing";
139cdf0e10cSrcweir 	*pOut << endl1  << indent2<< "  dxSpace: " << dxaSpace
140cdf0e10cSrcweir 		<< " dxaIndent: " << dxaIndent << " LevelCharPos: ";
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 	for( sal_uInt8 x = 0; x < nWW8MaxListLevel; ++x )
143cdf0e10cSrcweir 		*pOut << (sal_uInt16)aOfsNumsXCH[ x ] << ", ";
144cdf0e10cSrcweir 	*pOut << endl1;
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 	if( cbPapx )
147cdf0e10cSrcweir 	{
148cdf0e10cSrcweir 		sal_uLong nXPos = xTableStream->Tell();
149cdf0e10cSrcweir 		DumpSprms( pWwFib->nVersion, *xTableStream, cbPapx );
150cdf0e10cSrcweir 		xTableStream->Seek( nXPos + cbPapx );
151cdf0e10cSrcweir 	}
152cdf0e10cSrcweir 	if( cbChpx )
153cdf0e10cSrcweir 	{
154cdf0e10cSrcweir 		sal_uLong nXPos = xTableStream->Tell();
155cdf0e10cSrcweir 		DumpSprms( pWwFib->nVersion, *xTableStream, cbChpx );
156cdf0e10cSrcweir 		xTableStream->Seek( nXPos + cbChpx );
157cdf0e10cSrcweir 	}
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 	sal_uInt16 nStrLen, nC;
160cdf0e10cSrcweir 	*xTableStream >> nStrLen;
161cdf0e10cSrcweir 	char* pStr = new char[ nStrLen+1 ], *p = pStr;
162cdf0e10cSrcweir 	while( nStrLen-- )
163cdf0e10cSrcweir 	{
164cdf0e10cSrcweir 		*xTableStream >> nC;
165cdf0e10cSrcweir 		if( 10 > nC ) nC += 0x30;
166cdf0e10cSrcweir 		*pStr++ = (char)nC;
167cdf0e10cSrcweir 	}
168cdf0e10cSrcweir 	*pStr = 0;
169cdf0e10cSrcweir 	*pOut << indent2 << "Str: \"" << p << '\"' << endl1 << endl1;
170cdf0e10cSrcweir }
171cdf0e10cSrcweir 
DumpNumList()172cdf0e10cSrcweir static void DumpNumList()
173cdf0e10cSrcweir {
174cdf0e10cSrcweir 	if( pWwFib->lcbSttbListNames )
175cdf0e10cSrcweir 	{
176cdf0e10cSrcweir 		sal_uLong nOldPos = xTableStream->Tell();
177cdf0e10cSrcweir 		xTableStream->Seek( pWwFib->fcSttbListNames );
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 		*pOut << endl1;
180cdf0e10cSrcweir 		begin( *pOut, *xTableStream ) << "ListNames, Size ";
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 		sal_uInt16 nDummy;
183cdf0e10cSrcweir 		sal_uInt32 nCount;
184cdf0e10cSrcweir 		*xTableStream >> nDummy >> nCount;
185cdf0e10cSrcweir 
186cdf0e10cSrcweir 		*pOut << nCount << ", Dummy: " << nDummy << endl1;
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 		*pOut << indent2;
189cdf0e10cSrcweir 		for( ; nCount; --nCount )
190cdf0e10cSrcweir 		{
191cdf0e10cSrcweir 			sal_uInt16 nLen, nC;
192cdf0e10cSrcweir 			*xTableStream >> nLen;
193cdf0e10cSrcweir 			char * pChar = new char[ nLen + 1 ], *p = pChar;
194cdf0e10cSrcweir 			while( nLen-- )
195cdf0e10cSrcweir 			{
196cdf0e10cSrcweir 				*xTableStream >> nC;
197cdf0e10cSrcweir 				*pChar++ = (char)nC;
198cdf0e10cSrcweir 			}
199cdf0e10cSrcweir 			*pChar = 0;
200cdf0e10cSrcweir 			*pOut << '\"' << p << '\"';
201cdf0e10cSrcweir 			if( 1 < nCount ) *pOut << ", ";
202cdf0e10cSrcweir 			delete p;
203cdf0e10cSrcweir 		}
204cdf0e10cSrcweir 		*pOut << endl1;
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 		end( *pOut, *xTableStream ) << "ListNames" << endl1;
207cdf0e10cSrcweir 		xTableStream->Seek( nOldPos );
208cdf0e10cSrcweir 	}
209cdf0e10cSrcweir 
210cdf0e10cSrcweir 	if( pWwFib->lcbPlcfLst )
211cdf0e10cSrcweir 	{
212cdf0e10cSrcweir 		sal_uLong nOldPos = xTableStream->Tell();
213cdf0e10cSrcweir 		xTableStream->Seek( pWwFib->fcPlcfLst );
214cdf0e10cSrcweir 
215cdf0e10cSrcweir 		*pOut << endl1;
216cdf0e10cSrcweir 		begin( *pOut, *xTableStream ) << "LiST Data on File, Size ";
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 		sal_uInt16 nCount;
219cdf0e10cSrcweir 		*xTableStream >> nCount;
220cdf0e10cSrcweir 		*pOut << nCount << endl1;
221cdf0e10cSrcweir 
222cdf0e10cSrcweir 		sal_uLong nLVLPos = pWwFib->fcPlcfLst + ( nCount * 0x1c ) + 2;
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 		// 1.1 alle LST einlesen
225cdf0e10cSrcweir 		for( sal_uInt16 nList = 0; nList < nCount; nList++ )
226cdf0e10cSrcweir 		{
227cdf0e10cSrcweir 			indent( *pOut, *xTableStream );
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 			sal_uInt8 nByte;
230cdf0e10cSrcweir 			sal_uInt32 nLstId, nTplId;
231cdf0e10cSrcweir 			*xTableStream >> nLstId >> nTplId;
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 			sal_uInt16 aStyleIdArr[ nWW8MaxListLevel ];
234cdf0e10cSrcweir 			for( sal_uInt16 nLevel = 0; nLevel < nWW8MaxListLevel; nLevel++ )
235cdf0e10cSrcweir 				*xTableStream >> aStyleIdArr[ nLevel ];
236cdf0e10cSrcweir 			*xTableStream >> nByte;
237cdf0e10cSrcweir 			xTableStream->SeekRel( 1 );		// Dummy ueberlesen
238cdf0e10cSrcweir 
239cdf0e10cSrcweir 			*pOut << "ListId: " << nLstId
240cdf0e10cSrcweir 				<< " TemplateId " << nTplId << endl1
241cdf0e10cSrcweir 				<< indent2 << " StyleIds: ";
242cdf0e10cSrcweir 			for( nLevel = 0; nLevel < nWW8MaxListLevel; nLevel++ )
243cdf0e10cSrcweir 				*pOut << aStyleIdArr[ nLevel ] << ", ";
244cdf0e10cSrcweir 
245cdf0e10cSrcweir 			*pOut << endl1;
246cdf0e10cSrcweir 			if( 1 & nByte ) *pOut << " <simple List>";
247cdf0e10cSrcweir 			if( 2 & nByte ) *pOut << " <restart at new section>";
248cdf0e10cSrcweir 			if( 3 & nByte ) *pOut << endl1;
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 			sal_uLong nTmpPos = xTableStream->Tell();
251cdf0e10cSrcweir 			xTableStream->Seek( nLVLPos );
252cdf0e10cSrcweir 
253cdf0e10cSrcweir 			// 1.2 alle LVL aller aLST einlesen
254cdf0e10cSrcweir 			for( nLevel = 0; nLevel < ((1 & nByte) ? 1 : nWW8MaxListLevel); nLevel++ )
255cdf0e10cSrcweir 				Dump_LVL( nLevel );
256cdf0e10cSrcweir 
257cdf0e10cSrcweir 			nLVLPos = xTableStream->Tell();
258cdf0e10cSrcweir 			xTableStream->Seek( nTmpPos );
259cdf0e10cSrcweir 		}
260cdf0e10cSrcweir 
261cdf0e10cSrcweir 		end( *pOut, *xTableStream ) << "LiST Data on File" << endl1;
262cdf0e10cSrcweir 		xTableStream->Seek( nOldPos );
263cdf0e10cSrcweir 	}
264cdf0e10cSrcweir 
265cdf0e10cSrcweir 	if( pWwFib->lcbPlfLfo )
266cdf0e10cSrcweir 	{
267cdf0e10cSrcweir 		sal_uLong nOldPos = xTableStream->Tell();
268cdf0e10cSrcweir 		xTableStream->Seek( pWwFib->fcPlfLfo );
269cdf0e10cSrcweir 
270cdf0e10cSrcweir 		*pOut << endl1;
271cdf0e10cSrcweir 		begin( *pOut, *xTableStream ) << "List Format Override, Size ";
272cdf0e10cSrcweir 
273cdf0e10cSrcweir 		sal_uInt32 nCount, nLstId;
274cdf0e10cSrcweir 		*xTableStream >> nCount;
275cdf0e10cSrcweir 		*pOut << nCount << endl1;
276cdf0e10cSrcweir 
277cdf0e10cSrcweir 		sal_uLong nLVLPos = pWwFib->fcPlfLfo + ( nCount * 0x10 ) + 4;
278cdf0e10cSrcweir 
279cdf0e10cSrcweir 		for( ; nCount; --nCount )
280cdf0e10cSrcweir 		{
281cdf0e10cSrcweir 			indent( *pOut, *xTableStream );
282cdf0e10cSrcweir 
283cdf0e10cSrcweir 			sal_uInt8 nLevels;
284cdf0e10cSrcweir 			*xTableStream >> nLstId;
285cdf0e10cSrcweir 			xTableStream->SeekRel( 8 );
286cdf0e10cSrcweir 			*xTableStream >> nLevels;
287cdf0e10cSrcweir 			xTableStream->SeekRel( 3 );
288cdf0e10cSrcweir 
289cdf0e10cSrcweir 			*pOut << "ListId: " << nLstId
290cdf0e10cSrcweir 				<< " Override Levels: " << (sal_uInt16)nLevels << endl1;
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 			sal_uLong nTmpPos = xTableStream->Tell();
293cdf0e10cSrcweir 			xTableStream->Seek( nLVLPos );
294cdf0e10cSrcweir 
295cdf0e10cSrcweir 			for( sal_uInt8 nLvl = 0; nLvl < nLevels; ++nLvl )
296cdf0e10cSrcweir 			{
297cdf0e10cSrcweir 				sal_uInt32 nStartAt;
298cdf0e10cSrcweir 				sal_uInt8 nFlags;
299cdf0e10cSrcweir 				do {
300cdf0e10cSrcweir 					*xTableStream >> nFlags;
301cdf0e10cSrcweir 				} while( 0xFF == nFlags  );
302cdf0e10cSrcweir 				xTableStream->SeekRel( -1 );
303cdf0e10cSrcweir 
304cdf0e10cSrcweir 				indent( *pOut, *xTableStream );
305cdf0e10cSrcweir 				*xTableStream >> nStartAt >> nFlags;
306cdf0e10cSrcweir 				xTableStream->SeekRel( 3 );
307cdf0e10cSrcweir 
308cdf0e10cSrcweir 				if( nFlags & 0x10 ) *pOut << "<Override start>";
309cdf0e10cSrcweir 				if( nFlags & 0x20 ) *pOut << "<Override formattting>";
310cdf0e10cSrcweir 				if( nFlags & 0x30 ) *pOut << endl1;
311cdf0e10cSrcweir 
312cdf0e10cSrcweir 				if( nFlags & 0x20 )
313cdf0e10cSrcweir 					Dump_LVL( nFlags & 0x0F );
314cdf0e10cSrcweir 			}
315cdf0e10cSrcweir 			nLVLPos = xTableStream->Tell();
316cdf0e10cSrcweir 			xTableStream->Seek( nTmpPos );
317cdf0e10cSrcweir 		}
318cdf0e10cSrcweir 
319cdf0e10cSrcweir 		end( *pOut, *xTableStream ) << "List Format Override" << endl1 << endl1;
320cdf0e10cSrcweir 		xTableStream->Seek( nOldPos );
321cdf0e10cSrcweir 	}
322cdf0e10cSrcweir }
323cdf0e10cSrcweir 
DumpBookLow()324cdf0e10cSrcweir static void DumpBookLow()
325cdf0e10cSrcweir {
326cdf0e10cSrcweir 	*pOut << begin2 << "Bookmarks Low" << endl1;
327cdf0e10cSrcweir 	*pOut << indent2 <<"Start:  Adr " << hex6 << pWwFib->fcPlcfbkf
328cdf0e10cSrcweir 		 << ", Len: " << pWwFib->lcbPlcfbkf << endl1;
329cdf0e10cSrcweir 	*pOut << indent2 << "End:    Adr " << hex6 << pWwFib->fcPlcfbkl
330cdf0e10cSrcweir 		 << ", Len: " << pWwFib->lcbPlcfbkl << endl1;
331cdf0e10cSrcweir 	*pOut << indent2 << "Strings: Adr " << hex6 << pWwFib->fcSttbfbkmk
332cdf0e10cSrcweir 		 << ", Len: " << pWwFib->lcbSttbfbkmk << endl1;
333cdf0e10cSrcweir 	*pOut << endl1;
334cdf0e10cSrcweir 
335cdf0e10cSrcweir 	WW8PLCFspecial aStarts( &xStrm, pWwFib->fcPlcfbkf, pWwFib->lcbPlcfbkf, 4 );
336cdf0e10cSrcweir 	WW8PLCFspecial aEnds(	&xStrm, pWwFib->fcPlcfbkl, pWwFib->lcbPlcfbkl, 0, -1, sal_True );
337cdf0e10cSrcweir 
338cdf0e10cSrcweir 	sal_uInt16 i = 0;
339cdf0e10cSrcweir 	while( 1 ){
340cdf0e10cSrcweir 		long nStart = aStarts.GetPos( i );
341cdf0e10cSrcweir 		if( nStart >= LONG_MAX )
342cdf0e10cSrcweir 			break;
343cdf0e10cSrcweir 
344cdf0e10cSrcweir 		*pOut << indent2 << i << ".StartCp: " << hex6 << nStart;
345cdf0e10cSrcweir 
346cdf0e10cSrcweir 		const void* p = aStarts.GetData( i );
347cdf0e10cSrcweir 		if( p ){
348cdf0e10cSrcweir 			*pOut << ", EndIdx: ";
349cdf0e10cSrcweir 			sal_uInt16 nEndIdx = *((sal_uInt16*)p);
350cdf0e10cSrcweir 			*pOut << nEndIdx;
351cdf0e10cSrcweir 			long nEnd = aEnds.GetPos( nEndIdx );
352cdf0e10cSrcweir 			*pOut << ", End: " << hex6 << nEnd << hex
353cdf0e10cSrcweir 				  << ", Len: " << nEnd - nStart << dec;
354cdf0e10cSrcweir 		}else{
355cdf0e10cSrcweir 			*pOut << " aStarts.GetData() ging schief.";
356cdf0e10cSrcweir 		}
357cdf0e10cSrcweir 
358cdf0e10cSrcweir 		*pOut << endl1;
359cdf0e10cSrcweir 		i++;
360cdf0e10cSrcweir 	}
361cdf0e10cSrcweir 	*pOut << end2 << "Bookmarks Low" << endl1 << endl1;
362cdf0e10cSrcweir }
363cdf0e10cSrcweir 
DumpBookHigh()364cdf0e10cSrcweir static void DumpBookHigh()
365cdf0e10cSrcweir {
366cdf0e10cSrcweir 	WW8PLCFx_Book aBook( &xStrm, &xTableStream, *pWwFib, 0 );
367cdf0e10cSrcweir 	if( !aBook.GetIMax() ){
368cdf0e10cSrcweir 		*pOut << indent1 << "No Bookmarks" << endl1 << endl1;
369cdf0e10cSrcweir 		return;
370cdf0e10cSrcweir 	}
371cdf0e10cSrcweir 
372cdf0e10cSrcweir 	*pOut << indent1 << begin1 << "Bookmarks High" << endl1;
373cdf0e10cSrcweir 
374cdf0e10cSrcweir 	sal_uInt16 i = 0;
375cdf0e10cSrcweir 	while( 1 )
376cdf0e10cSrcweir 	{
377cdf0e10cSrcweir 		long nPos = aBook.Where();
378cdf0e10cSrcweir 		if( nPos >= LONG_MAX )
379cdf0e10cSrcweir 			break;
380cdf0e10cSrcweir 		*pOut << indent2 << i << ". Cp:" << hex6 << nPos << dec;
381cdf0e10cSrcweir 		*pOut << ( ( aBook.GetIsEnd() ) ? " Ende  " : " Anfang" );
382cdf0e10cSrcweir 		*pOut << " Handle: " << aBook.GetHandle();
383cdf0e10cSrcweir //		*pOut << " Len: " << hex4 << aBook.GetLen() << dec;
384cdf0e10cSrcweir 		ByteString sName( *aBook.GetName(), RTL_TEXTENCODING_MS_1252 );
385cdf0e10cSrcweir 		if( sName.Len() )
386cdf0e10cSrcweir 			*pOut << " Name: " << sName.GetBuffer() << endl1;
387cdf0e10cSrcweir 		else
388cdf0e10cSrcweir 			*pOut << endl1;
389cdf0e10cSrcweir 		aBook++;
390cdf0e10cSrcweir 		i++;
391cdf0e10cSrcweir 	}
392cdf0e10cSrcweir 	*pOut << end2 << "Bookmarks High" << endl1 << endl1;
393cdf0e10cSrcweir }
394cdf0e10cSrcweir 
DumpField3(WW8PLCFspecial & rPlc)395cdf0e10cSrcweir static sal_Bool DumpField3( WW8PLCFspecial& rPlc )
396cdf0e10cSrcweir {
397cdf0e10cSrcweir 	WW8FieldDesc aF;
398cdf0e10cSrcweir 
399cdf0e10cSrcweir 	sal_Bool bOk = WW8GetFieldPara( pWwFib->nVersion, rPlc, aF );
400cdf0e10cSrcweir 	if( !bOk )
401cdf0e10cSrcweir 	{
402cdf0e10cSrcweir 		*pOut << "       " << indent1 << "no WW8GetFieldPara()" << endl1;
403cdf0e10cSrcweir 		return sal_False;
404cdf0e10cSrcweir 	}
405cdf0e10cSrcweir 	*pOut << "       " << indent1 << begin1 << "Field Cp: " << hex
406cdf0e10cSrcweir 		  << aF.nSCode << ", Len: " << aF.nLCode << "; Cp: " << aF.nSRes
407cdf0e10cSrcweir 		  << ", Len: "<< aF.nLRes << ", Typ: " << dec << (sal_uInt16)aF.nId
408cdf0e10cSrcweir 		  << ", Options: " << hex << (sal_uInt16)aF.nOpt;
409cdf0e10cSrcweir 	if( aF.bCodeNest )
410cdf0e10cSrcweir 		*pOut << " Code Nested";
411cdf0e10cSrcweir 	if( aF.bResNest )
412cdf0e10cSrcweir 		*pOut << " Result Nested";
413cdf0e10cSrcweir 	*pOut << endl1;
414cdf0e10cSrcweir 	DumpShortPlainText( aF.nSCode, aF.nLCode, "Code" );
415cdf0e10cSrcweir 	DumpShortPlainText( aF.nSRes, aF.nLRes, "Result" );
416cdf0e10cSrcweir 	*pOut << "       " << end1 << "Field" << endl1;
417cdf0e10cSrcweir 	return sal_True;
418cdf0e10cSrcweir }
419cdf0e10cSrcweir 
DumpField2(WW8PLCFspecial & rPlc)420cdf0e10cSrcweir static sal_Bool DumpField2( WW8PLCFspecial& rPlc )
421cdf0e10cSrcweir {
422cdf0e10cSrcweir 	WW8_CP nSCode, nECode, nSRes, nERes;
423cdf0e10cSrcweir 	void* pData;
424cdf0e10cSrcweir 	if( !rPlc.Get( nSCode, pData ) )				// Ende des Plc1 ?
425cdf0e10cSrcweir 		return sal_False;
426cdf0e10cSrcweir 	rPlc++;
427cdf0e10cSrcweir 
428cdf0e10cSrcweir 	if( ((sal_uInt8*)pData)[0] != 19 ){
429cdf0e10cSrcweir 		*pOut << "Field Error, " << (sal_uInt16)((sal_uInt8*)pData)[0] << endl1;
430cdf0e10cSrcweir 		return sal_True;	// nicht abbrechen
431cdf0e10cSrcweir 	}
432cdf0e10cSrcweir 
433cdf0e10cSrcweir 	*pOut << "       " << indent1 << begin1 << "Field" << " Cp: " << hex
434cdf0e10cSrcweir 		  << nSCode << " Typ: " << dec << (sal_uInt16)((sal_uInt8*)pData)[1] << endl1;
435cdf0e10cSrcweir 
436cdf0e10cSrcweir 	if( !rPlc.Get( nECode, pData ) )			// Ende des Plc1 ?
437cdf0e10cSrcweir 		return sal_False;
438cdf0e10cSrcweir 
439cdf0e10cSrcweir 	DumpShortPlainText( nSCode, nECode - nSCode, "Code" );  // Code, bei nested abgeschnitten
440cdf0e10cSrcweir 	nSRes = nECode; 							// Default
441cdf0e10cSrcweir 
442cdf0e10cSrcweir 
443cdf0e10cSrcweir 	while( ((sal_uInt8*)pData)[0] == 19 ){			// immer noch neue (nested) Anfaenge ?
444cdf0e10cSrcweir 		DumpField2( rPlc ); 					// nested Field im Beschreibungsteil
445cdf0e10cSrcweir 		if( !rPlc.Get( nSRes, pData ) ) 		// Ende des Plc1 ?
446cdf0e10cSrcweir 			return sal_False;
447cdf0e10cSrcweir 	}
448cdf0e10cSrcweir 
449cdf0e10cSrcweir 	if( ((sal_uInt8*)pData)[0] == 20 ){				// Field Separator ?
450cdf0e10cSrcweir 		rPlc++;
451cdf0e10cSrcweir 		*pOut << "       " << indent1 << "Field Seperator" << " Cp: " << hex << nSRes
452cdf0e10cSrcweir 			  << ", Flags = 0x" << hex << (sal_uInt16)((sal_uInt8*)pData)[1] << dec << endl1;
453cdf0e10cSrcweir 		if( !rPlc.Get( nERes, pData ) ) 		// Ende des Plc1 ?
454cdf0e10cSrcweir 			return sal_False;
455cdf0e10cSrcweir 
456cdf0e10cSrcweir 		while( ((sal_uInt8*)pData)[0] == 19 ){		// immer noch neue (nested) Anfaenge ?
457cdf0e10cSrcweir 			DumpField2( rPlc ); 				// nested Field im Resultatteil
458cdf0e10cSrcweir 			if( !rPlc.Get( nERes, pData ) ) 	// Ende des Plc1 ?
459cdf0e10cSrcweir 				return sal_False;
460cdf0e10cSrcweir 		}
461cdf0e10cSrcweir 		DumpShortPlainText( nSRes, nERes - nSRes, "Result" );   // Result, bei nested incl. nested Field
462cdf0e10cSrcweir 
463cdf0e10cSrcweir 	}else{
464cdf0e10cSrcweir 		nERes = nSRes;							// Kein Result vorhanden
465cdf0e10cSrcweir 	}
466cdf0e10cSrcweir 
467cdf0e10cSrcweir 	rPlc++;
468cdf0e10cSrcweir 	if( ((sal_uInt8*)pData)[0] == 21 ){				// Field Ende ?
469cdf0e10cSrcweir 		*pOut << "       " << end1 << " Field " << " Cp: " << hex << nERes
470cdf0e10cSrcweir 			  << ", Flags = 0x" << hex << (sal_uInt16)((sal_uInt8*)pData)[1] << dec << endl1;
471cdf0e10cSrcweir 	}else{
472cdf0e10cSrcweir 		*pOut << "       Unknown Field Type" << endl1;
473cdf0e10cSrcweir 		*pOut << "       " << end1 << " Field " << endl1;
474cdf0e10cSrcweir 	}
475cdf0e10cSrcweir 
476cdf0e10cSrcweir 	return sal_True;
477cdf0e10cSrcweir }
478cdf0e10cSrcweir 
DumpField1(WW8_FC nPos,long nLen,char * pName)479cdf0e10cSrcweir static void DumpField1( WW8_FC nPos, long nLen, char* pName )
480cdf0e10cSrcweir {
481cdf0e10cSrcweir 	if( !nLen )
482cdf0e10cSrcweir 	{
483cdf0e10cSrcweir 		*pOut << pName << ": No Fields" << endl1 << endl1;
484cdf0e10cSrcweir 		return;
485cdf0e10cSrcweir 	}
486cdf0e10cSrcweir 
487cdf0e10cSrcweir 	WW8PLCFspecial aPlc( &xTableStream, nPos, nLen, 2 );
488cdf0e10cSrcweir 
489cdf0e10cSrcweir 	*pOut << hex6 << nPos << dec2 <<  ' ' << indent1 << begin1;
490cdf0e10cSrcweir 	*pOut << "Plc." << pName << ", Len: ";
491cdf0e10cSrcweir 	*pOut << nLen << ", ca. " << aPlc.GetIMax()/3 << " Elements"
492cdf0e10cSrcweir 
493cdf0e10cSrcweir 			<< " Idx: " << (long)aPlc.GetIdx()
494cdf0e10cSrcweir 			<< " IMax: " << aPlc.GetIMax()
495cdf0e10cSrcweir 
496cdf0e10cSrcweir 			<< endl1;
497cdf0e10cSrcweir 
498cdf0e10cSrcweir //	while( DumpField2( aPlc ) ){}
499cdf0e10cSrcweir 	while( (long)aPlc.GetIdx() < aPlc.GetIMax() )
500cdf0e10cSrcweir 	{
501cdf0e10cSrcweir 		DumpField3( aPlc );
502cdf0e10cSrcweir 		aPlc++;
503cdf0e10cSrcweir 	}
504cdf0e10cSrcweir 
505cdf0e10cSrcweir 	end( *pOut, *xStrm ) << "Plcx." << pName << endl1 << endl1;
506cdf0e10cSrcweir }
507cdf0e10cSrcweir 
508cdf0e10cSrcweir 
509cdf0e10cSrcweir //-----------------------------------------
DumpFonts()510cdf0e10cSrcweir static void DumpFonts()
511cdf0e10cSrcweir {
512cdf0e10cSrcweir 	WW8Fonts aFonts( *xTableStream, *pWwFib );
513cdf0e10cSrcweir 
514cdf0e10cSrcweir 	sal_uInt16 i;
515cdf0e10cSrcweir 
516cdf0e10cSrcweir 	*pOut << endl1;
517cdf0e10cSrcweir 	*pOut << 'T' << hex6 << pWwFib->fcSttbfffn << dec2 << ' ' << indent1 << begin1 << "FFNs" << endl1;
518cdf0e10cSrcweir 
519cdf0e10cSrcweir 	ByteString sOut;
520cdf0e10cSrcweir 
521cdf0e10cSrcweir 	for( i=0; i<aFonts.GetMax(); i++){
522cdf0e10cSrcweir 		// const
523cdf0e10cSrcweir 		WW8_FFN* p = (WW8_FFN*)aFonts.GetFont( i );
524cdf0e10cSrcweir 
525cdf0e10cSrcweir 		sOut = ByteString( p->sFontname, RTL_TEXTENCODING_MS_1252 );
526cdf0e10cSrcweir 		*pOut << "Id:" << i << " Name:\"" << sOut.GetBuffer() << '"';    // Name
527cdf0e10cSrcweir 		if( p->ibszAlt )					// gibt es einen alternativen Font ?
528cdf0e10cSrcweir 		{
529cdf0e10cSrcweir 			sOut = ByteString( p->sFontname.Copy( p->ibszAlt ),
530cdf0e10cSrcweir 								RTL_TEXTENCODING_MS_1252 );
531cdf0e10cSrcweir 			*pOut << ", Alternativ:" << '"' << sOut.GetBuffer() << '"';
532cdf0e10cSrcweir 		}
533cdf0e10cSrcweir 		*pOut << ", PitchRequest:" << (short)p->prg << ", TrueType:" << (short)p->fTrueType;
534cdf0e10cSrcweir 		*pOut << ", FontFamily:" << (short)p->ff;
535cdf0e10cSrcweir 		*pOut << ", BaseWeight:" << p->wWeight;
536cdf0e10cSrcweir 		*pOut << ", CharacterSet:" << (short)p->chs;
537cdf0e10cSrcweir 		*pOut << endl1;
538cdf0e10cSrcweir 	}
539cdf0e10cSrcweir 	*pOut << "       " << end1 << "FFNs" << endl1 << endl1;
540cdf0e10cSrcweir }
541cdf0e10cSrcweir 
542cdf0e10cSrcweir 
543cdf0e10cSrcweir //-----------------------------------------
544cdf0e10cSrcweir //			class DFib
545cdf0e10cSrcweir //-----------------------------------------
546cdf0e10cSrcweir 
547cdf0e10cSrcweir class DFib: public WW8Fib
548cdf0e10cSrcweir {
549cdf0e10cSrcweir public:
DFib(SvStream & rStrm,sal_uInt8 nVersion)550cdf0e10cSrcweir 	DFib( SvStream& rStrm, sal_uInt8 nVersion ) : WW8Fib( rStrm, nVersion ) {}
551cdf0e10cSrcweir 	void Dump();
552cdf0e10cSrcweir };
553cdf0e10cSrcweir 
554cdf0e10cSrcweir //-----------------------------------------
555cdf0e10cSrcweir 
Dump()556cdf0e10cSrcweir void DFib::Dump()
557cdf0e10cSrcweir {
558cdf0e10cSrcweir 	*pOut << "Adressen: FIB " << hex << 0 << ", Text "
559cdf0e10cSrcweir 		 << fcMin << ", TextLen " << ccpText
560cdf0e10cSrcweir 		 << ", Styles " << fcStshf << endl1;
561cdf0e10cSrcweir 
562cdf0e10cSrcweir 	*pOut << "\twIdent: " << wIdent << endl1;
563cdf0e10cSrcweir 	*pOut << "\tnFib: " << nFib << endl1;
564cdf0e10cSrcweir 	*pOut << "\tnProduct: " << nProduct << endl1;
565cdf0e10cSrcweir 	*pOut << "\tlid: " << lid << endl1;
566cdf0e10cSrcweir 	*pOut << "\tpnNext: " << pnNext << endl1;
567cdf0e10cSrcweir 
568cdf0e10cSrcweir 	*pOut << "\tfDot: " << (fDot ? '1' : '0') << endl1;
569cdf0e10cSrcweir 	*pOut << "\tfGlsy: " << (fGlsy ? '1' : '0') << endl1;
570cdf0e10cSrcweir 	*pOut << "\tfComplex: " << (fComplex ? '1' : '0') << endl1;
571cdf0e10cSrcweir 	*pOut << "\tfHasPic: " << (fHasPic ? '1' : '0') << endl1;
572cdf0e10cSrcweir 	*pOut << "\tcQuickSaves: " << (sal_uInt16)cQuickSaves  << endl1;
573cdf0e10cSrcweir 	*pOut << "\tfEncrypted: " << (fEncrypted ? '1' : '0') << endl1;
574cdf0e10cSrcweir 	*pOut << "\tfWhichTblStm: " << (fWhichTblStm ? '1' : '0') << endl1;
575cdf0e10cSrcweir 	*pOut << "\tfExtChar: " << (fExtChar ? '1' : '0') << endl1;
576cdf0e10cSrcweir 
577cdf0e10cSrcweir 	*pOut << "\tnFibBack: " << nFibBack << endl1;
578cdf0e10cSrcweir 	*pOut << "\tlKey1: " << lKey1 << endl1;
579cdf0e10cSrcweir 	*pOut << "\tlKey2: " << lKey2 << endl1;
580cdf0e10cSrcweir 	*pOut << "\tenvr: " << envr << endl1;
581cdf0e10cSrcweir 
582cdf0e10cSrcweir 	*pOut << "\tfMac: " << (fMac ? '1' : '0') << endl1;
583cdf0e10cSrcweir 	*pOut << "\tfEmptySpecial: " << (fEmptySpecial ? '1' : '0') << endl1;
584cdf0e10cSrcweir 	*pOut << "\tfLoadOverridePage: " << (fLoadOverridePage ? '1' : '0') << endl1;
585cdf0e10cSrcweir 	*pOut << "\tfFuturesavedUndo: " << (fFuturesavedUndo ? '1' : '0') << endl1;
586cdf0e10cSrcweir 	*pOut << "\tfWord97Saved: " << (fWord97Saved ? '1' : '0') << endl1;
587cdf0e10cSrcweir 
588cdf0e10cSrcweir 	*pOut << "\tchse: " << chse << endl1;
589cdf0e10cSrcweir 	*pOut << "\tchseTables: " << chseTables << endl1;
590cdf0e10cSrcweir 	*pOut << "\tfcMin: " << fcMin << endl1;
591cdf0e10cSrcweir 	*pOut << "\tfcMac: " << fcMac << endl1;
592cdf0e10cSrcweir 	*pOut << "\tcsw: " << csw << endl1;
593cdf0e10cSrcweir 	*pOut << "\twMagicCreated: " << wMagicCreated << endl1;
594cdf0e10cSrcweir 	*pOut << "\twMagicRevised: " << wMagicRevised << endl1;
595cdf0e10cSrcweir 	*pOut << "\twMagicCreatedPrivate: " << wMagicCreatedPrivate << endl1;
596cdf0e10cSrcweir 	*pOut << "\twMagicRevisedPrivate: " << wMagicRevisedPrivate << endl1;
597cdf0e10cSrcweir 	*pOut << "\tlidFE: " << lidFE << endl1;
598cdf0e10cSrcweir 	*pOut << "\tclw: " << clw << endl1;
599cdf0e10cSrcweir 	*pOut << "\tcbMac: " << cbMac << endl1;
600cdf0e10cSrcweir 	*pOut << "\tccpText: " << ccpText << endl1;
601cdf0e10cSrcweir 	*pOut << "\tccpFtn: " << ccpFtn << endl1;
602cdf0e10cSrcweir 	*pOut << "\tccpHdr: " << ccpHdr << endl1;
603cdf0e10cSrcweir 	*pOut << "\tccpMcr: " << ccpMcr << endl1;
604cdf0e10cSrcweir 	*pOut << "\tccpAtn: " << ccpAtn << endl1;
605cdf0e10cSrcweir 	*pOut << "\tccpEdn: " << ccpEdn << endl1;
606cdf0e10cSrcweir 	*pOut << "\tccpTxbx: " << ccpTxbx << endl1;
607cdf0e10cSrcweir 	*pOut << "\tccpHdrTxbx: " << ccpHdrTxbx << endl1;
608cdf0e10cSrcweir 	*pOut << "\tpnFbpChpFirst: " << pnFbpChpFirst << endl1;
609cdf0e10cSrcweir 	*pOut << "\tpnFbpPapFirst: " << pnFbpPapFirst << endl1;
610cdf0e10cSrcweir 	*pOut << "\tpnFbpLvcFirst: " << pnFbpLvcFirst << endl1;
611cdf0e10cSrcweir 	*pOut << "\tpnLvcFirst: " << pnLvcFirst << endl1;
612cdf0e10cSrcweir 	*pOut << "\tcpnBteLvc: " << cpnBteLvc << endl1;
613cdf0e10cSrcweir 	*pOut << "\tfcIslandFirst: " << fcIslandFirst << endl1;
614cdf0e10cSrcweir 	*pOut << "\tfcIslandLim: " << fcIslandLim << endl1;
615cdf0e10cSrcweir 	*pOut << "\tcfclcb: " << cfclcb << endl1;
616cdf0e10cSrcweir 	*pOut << "\tfcStshfOrig: " << fcStshfOrig << endl1;
617cdf0e10cSrcweir 	*pOut << "\tlcbStshfOrig: " << lcbStshfOrig << endl1;
618cdf0e10cSrcweir 	*pOut << "\tfcStshf: " << fcStshf << endl1;
619cdf0e10cSrcweir 	*pOut << "\tlcbStshf: " << lcbStshf << endl1;
620cdf0e10cSrcweir 	*pOut << "\tfcPlcffndRef: " << fcPlcffndRef << endl1;
621cdf0e10cSrcweir 	*pOut << "\tlcbPlcffndRef: " << lcbPlcffndRef << endl1;
622cdf0e10cSrcweir 	*pOut << "\tfcPlcffndTxt: " << fcPlcffndTxt << endl1;
623cdf0e10cSrcweir 	*pOut << "\tlcbPlcffndTxt: " << lcbPlcffndTxt << endl1;
624cdf0e10cSrcweir 	*pOut << "\tfcPlcfandRef: " << fcPlcfandRef << endl1;
625cdf0e10cSrcweir 	*pOut << "\tlcbPlcfandRef: " << lcbPlcfandRef << endl1;
626cdf0e10cSrcweir 	*pOut << "\tfcPlcfandTxt: " << fcPlcfandTxt << endl1;
627cdf0e10cSrcweir 	*pOut << "\tlcbPlcfandTxt: " << lcbPlcfandTxt << endl1;
628cdf0e10cSrcweir 	*pOut << "\tfcPlcfsed: " << fcPlcfsed << endl1;
629cdf0e10cSrcweir 	*pOut << "\tlcbPlcfsed: " << lcbPlcfsed << endl1;
630cdf0e10cSrcweir 	*pOut << "\tfcPlcfpad: " << fcPlcfpad << endl1;
631cdf0e10cSrcweir 	*pOut << "\tlcbPlcfpad: " << lcbPlcfpad << endl1;
632cdf0e10cSrcweir 	*pOut << "\tfcPlcfphe: " << fcPlcfphe << endl1;
633cdf0e10cSrcweir 	*pOut << "\tlcbPlcfphe: " << lcbPlcfphe << endl1;
634cdf0e10cSrcweir 	*pOut << "\tfcSttbfglsy: " << fcSttbfglsy << endl1;
635cdf0e10cSrcweir 	*pOut << "\tlcbSttbfglsy: " << lcbSttbfglsy << endl1;
636cdf0e10cSrcweir 	*pOut << "\tfcPlcfglsy: " << fcPlcfglsy << endl1;
637cdf0e10cSrcweir 	*pOut << "\tlcbPlcfglsy: " << lcbPlcfglsy << endl1;
638cdf0e10cSrcweir 	*pOut << "\tfcPlcfhdd: " << fcPlcfhdd << endl1;
639cdf0e10cSrcweir 	*pOut << "\tlcbPlcfhdd: " << lcbPlcfhdd << endl1;
640cdf0e10cSrcweir 	*pOut << "\tfcPlcfbteChpx: " << fcPlcfbteChpx << endl1;
641cdf0e10cSrcweir 	*pOut << "\tlcbPlcfbteChpx: " << lcbPlcfbteChpx << endl1;
642cdf0e10cSrcweir 	*pOut << "\tfcPlcfbtePapx: " << fcPlcfbtePapx << endl1;
643cdf0e10cSrcweir 	*pOut << "\tlcbPlcfbtePapx: " << lcbPlcfbtePapx << endl1;
644cdf0e10cSrcweir 	*pOut << "\tfcPlcfsea: " << fcPlcfsea << endl1;
645cdf0e10cSrcweir 	*pOut << "\tlcbPlcfsea: " << lcbPlcfsea << endl1;
646cdf0e10cSrcweir 	*pOut << "\tfcSttbfffn: " << fcSttbfffn << endl1;
647cdf0e10cSrcweir 	*pOut << "\tlcbSttbfffn: " << lcbSttbfffn << endl1;
648cdf0e10cSrcweir 	*pOut << "\tfcPlcffldMom: " << fcPlcffldMom << endl1;
649cdf0e10cSrcweir 	*pOut << "\tlcbPlcffldMom: " << lcbPlcffldMom << endl1;
650cdf0e10cSrcweir 	*pOut << "\tfcPlcffldHdr: " << fcPlcffldHdr << endl1;
651cdf0e10cSrcweir 	*pOut << "\tlcbPlcffldHdr: " << lcbPlcffldHdr << endl1;
652cdf0e10cSrcweir 	*pOut << "\tfcPlcffldFtn: " << fcPlcffldFtn << endl1;
653cdf0e10cSrcweir 	*pOut << "\tlcbPlcffldFtn: " << lcbPlcffldFtn << endl1;
654cdf0e10cSrcweir 	*pOut << "\tfcPlcffldAtn: " << fcPlcffldAtn << endl1;
655cdf0e10cSrcweir 	*pOut << "\tlcbPlcffldAtn: " << lcbPlcffldAtn << endl1;
656cdf0e10cSrcweir 	*pOut << "\tfcPlcffldMcr: " << fcPlcffldMcr << endl1;
657cdf0e10cSrcweir 	*pOut << "\tlcbPlcffldMcr: " << lcbPlcffldMcr << endl1;
658cdf0e10cSrcweir 	*pOut << "\tfcSttbfbkmk: " << fcSttbfbkmk << endl1;
659cdf0e10cSrcweir 	*pOut << "\tlcbSttbfbkmk: " << lcbSttbfbkmk << endl1;
660cdf0e10cSrcweir 	*pOut << "\tfcPlcfbkf: " << fcPlcfbkf << endl1;
661cdf0e10cSrcweir 	*pOut << "\tlcbPlcfbkf: " << lcbPlcfbkf << endl1;
662cdf0e10cSrcweir 	*pOut << "\tfcPlcfbkl: " << fcPlcfbkl << endl1;
663cdf0e10cSrcweir 	*pOut << "\tlcbPlcfbkl: " << lcbPlcfbkl << endl1;
664cdf0e10cSrcweir 	*pOut << "\tfcCmds: " << fcCmds << endl1;
665cdf0e10cSrcweir 	*pOut << "\tlcbCmds: " << lcbCmds << endl1;
666cdf0e10cSrcweir 	*pOut << "\tfcPlcfmcr: " << fcPlcfmcr << endl1;
667cdf0e10cSrcweir 	*pOut << "\tlcbPlcfmcr: " << lcbPlcfmcr << endl1;
668cdf0e10cSrcweir 	*pOut << "\tfcSttbfmcr: " << fcSttbfmcr << endl1;
669cdf0e10cSrcweir 	*pOut << "\tlcbSttbfmcr: " << lcbSttbfmcr << endl1;
670cdf0e10cSrcweir 	*pOut << "\tfcPrDrvr: " << fcPrDrvr << endl1;
671cdf0e10cSrcweir 	*pOut << "\tlcbPrDrvr: " << lcbPrDrvr << endl1;
672cdf0e10cSrcweir 	*pOut << "\tfcPrEnvPort: " << fcPrEnvPort << endl1;
673cdf0e10cSrcweir 	*pOut << "\tlcbPrEnvPort: " << lcbPrEnvPort << endl1;
674cdf0e10cSrcweir 	*pOut << "\tfcPrEnvLand: " << fcPrEnvLand << endl1;
675cdf0e10cSrcweir 	*pOut << "\tlcbPrEnvLand: " << lcbPrEnvLand << endl1;
676cdf0e10cSrcweir 	*pOut << "\tfcWss: " << fcWss << endl1;
677cdf0e10cSrcweir 	*pOut << "\tlcbWss: " << lcbWss << endl1;
678cdf0e10cSrcweir 	*pOut << "\tfcDop: " << fcDop << endl1;
679cdf0e10cSrcweir 	*pOut << "\tlcbDop: " << lcbDop << endl1;
680cdf0e10cSrcweir 	*pOut << "\tfcSttbfAssoc: " << fcSttbfAssoc << endl1;
681cdf0e10cSrcweir 	*pOut << "\tcbSttbfAssoc: " << cbSttbfAssoc << endl1;
682cdf0e10cSrcweir 	*pOut << "\tfcClx: " << fcClx << endl1;
683cdf0e10cSrcweir 	*pOut << "\tlcbClx: " << lcbClx << endl1;
684cdf0e10cSrcweir 	*pOut << "\tfcPlcfpgdFtn: " << fcPlcfpgdFtn << endl1;
685cdf0e10cSrcweir 	*pOut << "\tlcbPlcfpgdFtn: " << lcbPlcfpgdFtn << endl1;
686cdf0e10cSrcweir 	*pOut << "\tfcAutosaveSource: " << fcAutosaveSource << endl1;
687cdf0e10cSrcweir 	*pOut << "\tlcbAutosaveSource: " << lcbAutosaveSource << endl1;
688cdf0e10cSrcweir 	*pOut << "\tfcGrpStAtnOwners: " << fcGrpStAtnOwners << endl1;
689cdf0e10cSrcweir 	*pOut << "\tlcbGrpStAtnOwners: " << lcbGrpStAtnOwners << endl1;
690cdf0e10cSrcweir 	*pOut << "\tfcSttbfAtnbkmk: " << fcSttbfAtnbkmk << endl1;
691cdf0e10cSrcweir 	*pOut << "\tlcbSttbfAtnbkmk: " << lcbSttbfAtnbkmk << endl1;
692cdf0e10cSrcweir 	*pOut << "\tfcPlcfdoaMom: " << fcPlcfdoaMom << endl1;
693cdf0e10cSrcweir 	*pOut << "\tlcbPlcfdoaMom: " << lcbPlcfdoaMom << endl1;
694cdf0e10cSrcweir 	*pOut << "\tfcPlcfdoaHdr: " << fcPlcfdoaHdr << endl1;
695cdf0e10cSrcweir 	*pOut << "\tlcbPlcfdoaHdr: " << lcbPlcfdoaHdr << endl1;
696cdf0e10cSrcweir 	*pOut << "\tfcPlcfspaMom: " << fcPlcfspaMom << endl1;
697cdf0e10cSrcweir 	*pOut << "\tlcbPlcfspaMom: " << lcbPlcfspaMom << endl1;
698cdf0e10cSrcweir 	*pOut << "\tfcPlcfspaHdr: " << fcPlcfspaHdr << endl1;
699cdf0e10cSrcweir 	*pOut << "\tlcbPlcfspaHdr: " << lcbPlcfspaHdr << endl1;
700cdf0e10cSrcweir 	*pOut << "\tfcPlcfAtnbkf: " << fcPlcfAtnbkf << endl1;
701cdf0e10cSrcweir 	*pOut << "\tlcbPlcfAtnbkf: " << lcbPlcfAtnbkf << endl1;
702cdf0e10cSrcweir 	*pOut << "\tfcPlcfAtnbkl: " << fcPlcfAtnbkl << endl1;
703cdf0e10cSrcweir 	*pOut << "\tlcbPlcfAtnbkl: " << lcbPlcfAtnbkl << endl1;
704cdf0e10cSrcweir 	*pOut << "\tfcPms: " << fcPms << endl1;
705cdf0e10cSrcweir 	*pOut << "\tlcbPMS: " << lcbPMS << endl1;
706cdf0e10cSrcweir 	*pOut << "\tfcFormFldSttbf: " << fcFormFldSttbf << endl1;
707cdf0e10cSrcweir 	*pOut << "\tlcbFormFldSttbf: " << lcbFormFldSttbf << endl1;
708cdf0e10cSrcweir 	*pOut << "\tfcPlcfendRef: " << fcPlcfendRef << endl1;
709cdf0e10cSrcweir 	*pOut << "\tlcbPlcfendRef: " << lcbPlcfendRef << endl1;
710cdf0e10cSrcweir 	*pOut << "\tfcPlcfendTxt: " << fcPlcfendTxt << endl1;
711cdf0e10cSrcweir 	*pOut << "\tlcbPlcfendTxt: " << lcbPlcfendTxt << endl1;
712cdf0e10cSrcweir 	*pOut << "\tfcPlcffldEdn: " << fcPlcffldEdn << endl1;
713cdf0e10cSrcweir 	*pOut << "\tlcbPlcffldEdn: " << lcbPlcffldEdn << endl1;
714cdf0e10cSrcweir 	*pOut << "\tfcPlcfpgdEdn: " << fcPlcfpgdEdn << endl1;
715cdf0e10cSrcweir 	*pOut << "\tlcbPlcfpgdEdn: " << lcbPlcfpgdEdn << endl1;
716cdf0e10cSrcweir 	*pOut << "\tfcDggInfo: " << fcDggInfo << endl1;
717cdf0e10cSrcweir 	*pOut << "\tlcbDggInfo: " << lcbDggInfo << endl1;
718cdf0e10cSrcweir 	*pOut << "\tfcSttbfRMark: " << fcSttbfRMark << endl1;
719cdf0e10cSrcweir 	*pOut << "\tlcbSttbfRMark: " << lcbSttbfRMark << endl1;
720cdf0e10cSrcweir 	*pOut << "\tfcSttbfCaption: " << fcSttbfCaption << endl1;
721cdf0e10cSrcweir 	*pOut << "\tlcbSttbfCaption: " << lcbSttbfCaption << endl1;
722cdf0e10cSrcweir 	*pOut << "\tfcSttbAutoCaption: " << fcSttbAutoCaption << endl1;
723cdf0e10cSrcweir 	*pOut << "\tlcbSttbAutoCaption: " << lcbSttbAutoCaption << endl1;
724cdf0e10cSrcweir 	*pOut << "\tfcPlcfwkb: " << fcPlcfwkb << endl1;
725cdf0e10cSrcweir 	*pOut << "\tlcbPlcfwkb: " << lcbPlcfwkb << endl1;
726cdf0e10cSrcweir 	*pOut << "\tfcPlcfspl: " << fcPlcfspl << endl1;
727cdf0e10cSrcweir 	*pOut << "\tlcbPlcfspl: " << lcbPlcfspl << endl1;
728cdf0e10cSrcweir 	*pOut << "\tfcPlcftxbxTxt: " << fcPlcftxbxTxt << endl1;
729cdf0e10cSrcweir 	*pOut << "\tlcbPlcftxbxTxt: " << lcbPlcftxbxTxt << endl1;
730cdf0e10cSrcweir 	*pOut << "\tfcPlcffldTxbx: " << fcPlcffldTxbx << endl1;
731cdf0e10cSrcweir 	*pOut << "\tlcbPlcffldTxbx: " << lcbPlcffldTxbx << endl1;
732cdf0e10cSrcweir 	*pOut << "\tfcPlcfHdrtxbxTxt: " << fcPlcfHdrtxbxTxt << endl1;
733cdf0e10cSrcweir 	*pOut << "\tlcbPlcfHdrtxbxTxt: " << lcbPlcfHdrtxbxTxt << endl1;
734cdf0e10cSrcweir 	*pOut << "\tfcPlcffldHdrTxbx: " << fcPlcffldHdrTxbx << endl1;
735cdf0e10cSrcweir 	*pOut << "\tlcbPlcffldHdrTxbx: " << lcbPlcffldHdrTxbx << endl1;
736cdf0e10cSrcweir 	*pOut << "\tfcPlcfLst: " << fcPlcfLst << endl1;
737cdf0e10cSrcweir 	*pOut << "\tlcbPlcfLst: " << lcbPlcfLst << endl1;
738cdf0e10cSrcweir 	*pOut << "\tfcPlfLfo: " << fcPlfLfo << endl1;
739cdf0e10cSrcweir 	*pOut << "\tlcbPlfLfo: " << lcbPlfLfo << endl1;
740cdf0e10cSrcweir 	*pOut << "\tfcPlcftxbxBkd: " << fcPlcftxbxBkd << endl1;
741cdf0e10cSrcweir 	*pOut << "\tlcbPlcftxbxBkd: " << lcbPlcftxbxBkd << endl1;
742cdf0e10cSrcweir 	*pOut << "\tfcPlcfHdrtxbxBkd: " << fcPlcfHdrtxbxBkd << endl1;
743cdf0e10cSrcweir 	*pOut << "\tlcbPlcfHdrtxbxBkd: " << lcbPlcfHdrtxbxBkd << endl1;
744cdf0e10cSrcweir 	*pOut << "\tfcSttbListNames: " << fcSttbListNames << endl1;
745cdf0e10cSrcweir 	*pOut << "\tlcbSttbListNames: " << lcbSttbListNames << endl1;
746cdf0e10cSrcweir 
747cdf0e10cSrcweir 	*pOut << "\tpnChpFirst: " << pnChpFirst << endl1;
748cdf0e10cSrcweir 	*pOut << "\tpnPapFirst: " << pnPapFirst << endl1;
749cdf0e10cSrcweir 	*pOut << "\tcpnBteChp: " << cpnBteChp << endl1;
750cdf0e10cSrcweir 	*pOut << "\tcpnBtePap: " << cpnBtePap << endl1;
751cdf0e10cSrcweir 
752cdf0e10cSrcweir 
753cdf0e10cSrcweir 	*pOut << dec << "END FIB" << endl1 << endl1;
754cdf0e10cSrcweir }
755cdf0e10cSrcweir 
756cdf0e10cSrcweir //-----------------------------------------
757cdf0e10cSrcweir //			class DStyle
758cdf0e10cSrcweir //-----------------------------------------
759cdf0e10cSrcweir 
760cdf0e10cSrcweir class DStyle: public WW8Style
761cdf0e10cSrcweir {
762cdf0e10cSrcweir 	sal_uInt8 nVersion;
763cdf0e10cSrcweir public:
DStyle(SvStream & rStream,WW8Fib & rFib)764cdf0e10cSrcweir 	DStyle( SvStream& rStream, WW8Fib& rFib )
765cdf0e10cSrcweir 			: WW8Style( rStream, rFib ){ nVersion = rFib.nVersion; }
766cdf0e10cSrcweir 	void Dump1Style( sal_uInt16 nNr );
767cdf0e10cSrcweir 	void Dump();
768cdf0e10cSrcweir };
769cdf0e10cSrcweir 
770cdf0e10cSrcweir //-----------------------------------------
771cdf0e10cSrcweir //		universelle Hilfsroutinen
772cdf0e10cSrcweir //-----------------------------------------
773cdf0e10cSrcweir 
DumpIt(SvStream & rSt,short nLen)774cdf0e10cSrcweir static void DumpIt( SvStream& rSt, short nLen )
775cdf0e10cSrcweir {
776cdf0e10cSrcweir 	indent( *pOut, rSt );
777cdf0e10cSrcweir 	if( nLen <= 0 ){
778cdf0e10cSrcweir 		*pOut << endl1;
779cdf0e10cSrcweir 		return;
780cdf0e10cSrcweir 	}
781cdf0e10cSrcweir 	while ( nLen  ){
782cdf0e10cSrcweir 		sal_uInt8 c;
783cdf0e10cSrcweir 		xStrm->Read( &c, sizeof(c) );
784cdf0e10cSrcweir 		*pOut << "<0x" << hex2 << (sal_uInt16)c << dec2 << "> ";
785cdf0e10cSrcweir 		nLen--;
786cdf0e10cSrcweir 	}
787cdf0e10cSrcweir 	*pOut << endl1;
788cdf0e10cSrcweir }
789cdf0e10cSrcweir 
DumpItSmall(SvStream & rStrm,short nLen)790cdf0e10cSrcweir static void DumpItSmall( SvStream& rStrm, short nLen )
791cdf0e10cSrcweir {
792cdf0e10cSrcweir 	if( nLen <= 0 )
793cdf0e10cSrcweir 		return;
794cdf0e10cSrcweir 
795cdf0e10cSrcweir 	while ( nLen  )
796cdf0e10cSrcweir 	{
797cdf0e10cSrcweir 		sal_uInt8 c;
798cdf0e10cSrcweir 
799cdf0e10cSrcweir 		rStrm.Read( &c, sizeof(c) );
800cdf0e10cSrcweir 
801cdf0e10cSrcweir 		if( c <= 9 )
802cdf0e10cSrcweir 			*pOut << (sal_uInt16)c;
803cdf0e10cSrcweir 		else
804cdf0e10cSrcweir 			*pOut << "0x" << hex2 << (sal_uInt16)c << dec2;
805cdf0e10cSrcweir 
806cdf0e10cSrcweir 		nLen--;
807cdf0e10cSrcweir 
808cdf0e10cSrcweir 		if( nLen )
809cdf0e10cSrcweir 			*pOut << ',';
810cdf0e10cSrcweir 	}
811cdf0e10cSrcweir }
812cdf0e10cSrcweir 
DumpSprm(sal_uInt8 nVersion,SvStream & rSt,short nSprmsLen)813cdf0e10cSrcweir static short DumpSprm( sal_uInt8 nVersion, SvStream& rSt, short nSprmsLen )
814cdf0e10cSrcweir {
815cdf0e10cSrcweir 	long nSprmPos = rSt.Tell();
816cdf0e10cSrcweir 	sal_uInt8 nDelta;
817cdf0e10cSrcweir 
818cdf0e10cSrcweir 	indent( *pOut, rSt );
819cdf0e10cSrcweir 
820cdf0e10cSrcweir 	sal_uInt8 x[512];
821cdf0e10cSrcweir 	rSt.Read( x, 512 ); 				// Token und folgende lesen
822cdf0e10cSrcweir 
823cdf0e10cSrcweir 	sal_uInt16 nId = WW8GetSprmId( nVersion, x, &nDelta );
824cdf0e10cSrcweir 
825cdf0e10cSrcweir 	short nSprmL = WW8GetSprmSizeBrutto( nVersion, x, &nId );
826cdf0e10cSrcweir 	short nSprmNL = WW8GetSprmSizeNetto( nVersion, x, &nId );
827cdf0e10cSrcweir 
828cdf0e10cSrcweir 	nSprmsLen -= nSprmL;
829cdf0e10cSrcweir 	if( nSprmsLen < 0 )
830cdf0e10cSrcweir 		*pOut << "!UEberhang um " << -nSprmsLen << " Bytes!" << endl1;
831cdf0e10cSrcweir 
832cdf0e10cSrcweir 	// Ausgabe: Token in Dez
833cdf0e10cSrcweir 	if( 8 > nVersion )
834cdf0e10cSrcweir 		*pOut << (sal_uInt16)x[0];
835cdf0e10cSrcweir 	else
836cdf0e10cSrcweir 		*pOut << hex << nId << dec;
837cdf0e10cSrcweir 	*pOut << '/' << nSprmL;  // Laenge incl. alles in Dez
838cdf0e10cSrcweir 	*pOut << '/' << nSprmNL;    // Laenge excl Token in Dez
839cdf0e10cSrcweir 
840cdf0e10cSrcweir 
841cdf0e10cSrcweir 	const SprmDumpInfo& rSprm = WW8GetSprmDumpInfo( nId );
842cdf0e10cSrcweir 
843cdf0e10cSrcweir 	*pOut << " = " << rSprm.pName << ' ';
844cdf0e10cSrcweir 
845cdf0e10cSrcweir 	rSt.Seek( nSprmPos + 1 + nDelta + WW8SprmDataOfs( nId ) );// gehe zum eigentlichen
846cdf0e10cSrcweir 													 // Inhalt
847cdf0e10cSrcweir 	if( rSprm.pOutFnc )
848cdf0e10cSrcweir 		rSprm.pOutFnc( rSt, nSprmNL );		// Rufe Ausgabefunktion
849cdf0e10cSrcweir 	else
850cdf0e10cSrcweir 		DumpItSmall( rSt, nSprmNL );		// oder Dumper
851cdf0e10cSrcweir 	*pOut << endl1;
852cdf0e10cSrcweir 
853cdf0e10cSrcweir 	return nSprmsLen;
854cdf0e10cSrcweir }
855cdf0e10cSrcweir 
DumpSprms(sal_uInt8 nVersion,SvStream & rSt,short nLen)856cdf0e10cSrcweir void DumpSprms( sal_uInt8 nVersion, SvStream& rSt, short nLen )
857cdf0e10cSrcweir {
858cdf0e10cSrcweir 	if( nLen <= 1 || rSt.IsEof() ){
859cdf0e10cSrcweir 		return;
860cdf0e10cSrcweir 	}
861cdf0e10cSrcweir 	begin( *pOut, rSt ) << "Sprms" << endl1;
862cdf0e10cSrcweir 	while ( nLen > 1 )
863cdf0e10cSrcweir 	{
864cdf0e10cSrcweir 		nLen = DumpSprm( nVersion, rSt, nLen );
865cdf0e10cSrcweir 	}
866cdf0e10cSrcweir 	end( *pOut, rSt ) << "Sprms" << endl1;
867cdf0e10cSrcweir }
868cdf0e10cSrcweir 
869cdf0e10cSrcweir // DumpMemSprm() dumpt ein 2-Byte-Sprm, der im WW8_PCD eingebaut ist
DumpMemSprm(sal_uInt8 nVersion,sal_Int16 * pSprm)870cdf0e10cSrcweir static void DumpMemSprm( sal_uInt8 nVersion, sal_Int16* pSprm )
871cdf0e10cSrcweir {
872cdf0e10cSrcweir 	sal_uInt8* p = (sal_uInt8*)pSprm;
873cdf0e10cSrcweir 	sal_uInt16 nId = WW8GetSprmId( nVersion, p, 0 );
874cdf0e10cSrcweir 
875cdf0e10cSrcweir 	*pOut << (sal_uInt16)p[0];						// Ausgabe: Token in Dez
876cdf0e10cSrcweir 	*pOut << '/' << WW8GetSprmSizeBrutto( nVersion, p, &nId );   // Laenge incl. alles in Dez
877cdf0e10cSrcweir 	*pOut << '/' << WW8GetSprmSizeNetto(  nVersion, p, &nId );    // Laenge excl Token in Dez
878cdf0e10cSrcweir 
879cdf0e10cSrcweir 	*pOut << " = " << WW8GetSprmDumpInfo( nId ).pName;
880cdf0e10cSrcweir 
881cdf0e10cSrcweir 	*pOut << " 0x" << hex2 << *(p + 1);
882cdf0e10cSrcweir }
883cdf0e10cSrcweir 
884cdf0e10cSrcweir 
885cdf0e10cSrcweir //-----------------------------------------
886cdf0e10cSrcweir //			Hilfsroutinen: SEPX
887cdf0e10cSrcweir //-----------------------------------------
DumpSepx(sal_uInt8 nVersion,long nPos)888cdf0e10cSrcweir void DumpSepx( sal_uInt8 nVersion, long nPos )
889cdf0e10cSrcweir {
890cdf0e10cSrcweir 	sal_uInt16 nLen;
891cdf0e10cSrcweir 	xStrm->Seek( nPos );
892cdf0e10cSrcweir 	begin( *pOut, *xStrm ) << "Sepx, Len: ";
893cdf0e10cSrcweir 	xStrm->Read( &nLen, 2 );
894cdf0e10cSrcweir 	*pOut << nLen << endl1;
895cdf0e10cSrcweir 
896cdf0e10cSrcweir 	DumpSprms( nVersion, *xStrm, nLen );
897cdf0e10cSrcweir 
898cdf0e10cSrcweir 	end( *pOut, *xStrm ) << "Sepx" << endl1;
899cdf0e10cSrcweir }
900cdf0e10cSrcweir 
901cdf0e10cSrcweir 
902cdf0e10cSrcweir //-----------------------------------------
903cdf0e10cSrcweir //	Hilfsroutinen: FKP.CHPX, FKP.PAPX
904cdf0e10cSrcweir //-----------------------------------------
DumpPhe(WW8_PHE_Base & rPhe)905cdf0e10cSrcweir static void DumpPhe( WW8_PHE_Base& rPhe )
906cdf0e10cSrcweir {
907cdf0e10cSrcweir 	if( rPhe.aBits1 == 0 && rPhe.nlMac == 0
908cdf0e10cSrcweir 		&& SVBT16ToShort( rPhe.dxaCol ) == 0
909cdf0e10cSrcweir 		&& SVBT16ToShort( rPhe.dyl ) == 0 )
910cdf0e10cSrcweir 	{
911cdf0e10cSrcweir 		*pOut << indent2 << "  empty PHE" << endl1;
912cdf0e10cSrcweir 	}
913cdf0e10cSrcweir 	else
914cdf0e10cSrcweir 	{
915cdf0e10cSrcweir 		*pOut << begin2 << "PHE" << endl1;
916cdf0e10cSrcweir 		*pOut << indent2 << "fSpare: " << ( rPhe.aBits1 & 0x1 );
917cdf0e10cSrcweir 		*pOut << ", fUnk: " << (( rPhe.aBits1 >> 1 ) & 1 );
918cdf0e10cSrcweir 		*pOut << ", fDiffLines: " << (( rPhe.aBits1 >> 2 ) & 1 );
919cdf0e10cSrcweir 		*pOut << ", unused: " << (( rPhe.aBits1 >> 3 ) & 0x1F )
920cdf0e10cSrcweir 			  << " (" << (short)(( rPhe.aBits1 >> 2 ) & 0x3F ) +
921cdf0e10cSrcweir 						 		(((short)rPhe.nlMac) << 8)
922cdf0e10cSrcweir 			  << ")";
923cdf0e10cSrcweir 		*pOut << ", nLines: " << (short)rPhe.nlMac << ',' << endl1;
924cdf0e10cSrcweir 		*pOut << indent2 << "dxaCol: " << (short)SVBT16ToShort( rPhe.dxaCol );
925cdf0e10cSrcweir 		if( rPhe.aBits1 & 0x4 )
926cdf0e10cSrcweir 		{
927cdf0e10cSrcweir 			*pOut << ", total height: " << (sal_uInt16)SVBT16ToShort( rPhe.dyl );
928cdf0e10cSrcweir 		}
929cdf0e10cSrcweir 		else
930cdf0e10cSrcweir 		{
931cdf0e10cSrcweir 			*pOut << ", height per line: " << (short)SVBT16ToShort( rPhe.dyl );
932cdf0e10cSrcweir 			*pOut << ", total height: " << rPhe.nlMac * (short)SVBT16ToShort( rPhe.dyl );
933cdf0e10cSrcweir 		}
934cdf0e10cSrcweir 		*pOut << endl1;
935cdf0e10cSrcweir 		*pOut << end2 << "PHE" << endl1;
936cdf0e10cSrcweir 	}
937cdf0e10cSrcweir }
938cdf0e10cSrcweir 
939cdf0e10cSrcweir //typedef enum{ CHP=0, PAP, SEP, PLC_END }ePlcT;
940cdf0e10cSrcweir static char* NameTab[PLCF_END+4]={ "chpx", "papx", "sepx", "head",
941cdf0e10cSrcweir 									"FootnoteRef", "EndnoteRef",
942cdf0e10cSrcweir 									"AnnotationRef" };
943cdf0e10cSrcweir 
DumpFkp(sal_uInt8 nVersion,long nPos,short nItemSize,ePLCFT ePlc)944cdf0e10cSrcweir void DumpFkp( sal_uInt8 nVersion, long nPos, short nItemSize, ePLCFT ePlc )
945cdf0e10cSrcweir {
946cdf0e10cSrcweir 	char nElem;
947cdf0e10cSrcweir 
948cdf0e10cSrcweir 	xStrm->Seek( nPos+511 );
949cdf0e10cSrcweir 	xStrm->Read( &nElem, 1 );
950cdf0e10cSrcweir 
951cdf0e10cSrcweir 
952cdf0e10cSrcweir 	*pOut << 'D' << hex6 << nPos << dec2 << ' ' << indent1 << begin1 << "Fkp.";
953cdf0e10cSrcweir 	*pOut << NameTab[ePlc] << ", ";
954cdf0e10cSrcweir 	*pOut << (sal_uInt16)nElem << " Elements" << endl1;
955cdf0e10cSrcweir 
956cdf0e10cSrcweir 	int i;
957cdf0e10cSrcweir 	WW8_FC aF[2];
958cdf0e10cSrcweir 	sal_uInt8 c;
959cdf0e10cSrcweir 	long nStartOfs = nPos + ( nElem + 1 ) * 4;	// bei dieser Pos faengt Offset-Array an
960cdf0e10cSrcweir 	short nOfs;
961cdf0e10cSrcweir 	WW8_PHE_Base aPhe;
962cdf0e10cSrcweir 
963cdf0e10cSrcweir 	for( i=0; i<nElem; i++ )
964cdf0e10cSrcweir 	{
965cdf0e10cSrcweir 		xStrm->Seek( nPos + i * 4 );
966cdf0e10cSrcweir 		indent( *pOut, *xStrm );
967cdf0e10cSrcweir 		xStrm->Read( aF, sizeof( aF ) );			// lese 2 FCs
968cdf0e10cSrcweir 
969cdf0e10cSrcweir 		xStrm->Seek( nStartOfs + i * nItemSize );
970cdf0e10cSrcweir 		xStrm->Read( &c, 1 );		// lese Word Offset ( evtl. Teil von BX )
971cdf0e10cSrcweir 		if( ePlc == PAP )
972cdf0e10cSrcweir 			xStrm->Read( &aPhe, sizeof( aPhe ) );
973cdf0e10cSrcweir 
974cdf0e10cSrcweir 		nOfs= c * 2;							// -> Byte Offset
975cdf0e10cSrcweir 		xStrm->Seek( nPos + nOfs );
976cdf0e10cSrcweir 		xStrm->Read( &c, 1 );
977cdf0e10cSrcweir 
978cdf0e10cSrcweir 		if( !c )
979cdf0e10cSrcweir 			xStrm->Read( &c, 1 );
980cdf0e10cSrcweir 
981cdf0e10cSrcweir 		*pOut << "Fc: " << hex << aF[0] << ".." << aF[1];
982cdf0e10cSrcweir 		*pOut << " Cp: " << pSBase->WW8Fc2Cp( aF[0] )
983cdf0e10cSrcweir 			  << ".."    << pSBase->WW8Fc2Cp( aF[1] );
984cdf0e10cSrcweir 		*pOut << " Offset: " << nOfs << dec2;
985cdf0e10cSrcweir 		if ( nOfs )
986cdf0e10cSrcweir 		{
987cdf0e10cSrcweir 			switch ( ePlc )
988cdf0e10cSrcweir 			{
989cdf0e10cSrcweir 			case CHP:
990cdf0e10cSrcweir 				*pOut << ", Len: " << (short)c << endl1;
991cdf0e10cSrcweir 				DumpSprms( nVersion, *xStrm, (short)c );
992cdf0e10cSrcweir 				break;
993cdf0e10cSrcweir 
994cdf0e10cSrcweir 			case PAP:
995cdf0e10cSrcweir 				short nLen = c * 2; 	// So weit bis zum naechsten !
996cdf0e10cSrcweir 
997cdf0e10cSrcweir 				short nIStd;
998cdf0e10cSrcweir 
999cdf0e10cSrcweir 				WW8ReadINT16( *xStrm, nIStd );
1000cdf0e10cSrcweir 
1001cdf0e10cSrcweir 				*pOut << ", Len max: " << nLen << ", ID:" << nIStd << endl1;
1002cdf0e10cSrcweir 				DumpSprms( nVersion, *xStrm, nLen - 2 );
1003cdf0e10cSrcweir 				DumpPhe( aPhe );
1004cdf0e10cSrcweir 				break;
1005cdf0e10cSrcweir 			}
1006cdf0e10cSrcweir 		}
1007cdf0e10cSrcweir 		else
1008cdf0e10cSrcweir 		{
1009cdf0e10cSrcweir 			*pOut << dec2 << " No attribute" << endl1;
1010cdf0e10cSrcweir 		}
1011cdf0e10cSrcweir 
1012cdf0e10cSrcweir 	}
1013cdf0e10cSrcweir 	end( *pOut, *xStrm ) << "Fkp." << NameTab[ePlc] << endl1;
1014cdf0e10cSrcweir }
1015cdf0e10cSrcweir 
1016cdf0e10cSrcweir //-----------------------------------------
1017cdf0e10cSrcweir //		WW8_DOP ( Document Properties )
1018cdf0e10cSrcweir //-----------------------------------------
1019cdf0e10cSrcweir 
1020cdf0e10cSrcweir //!!! WW8LoadDop gibt's jetzt auch in WW8scan.cxx
DumpDop(WW8Fib & rFib)1021cdf0e10cSrcweir void DumpDop( WW8Fib& rFib )
1022cdf0e10cSrcweir {
1023cdf0e10cSrcweir 	// nicht loeschen!
1024cdf0e10cSrcweir 	xTableStream->Seek( rFib.fcDop );	// diese Aktion dient lediglich dazu, die
1025cdf0e10cSrcweir 						// Positions-Ausgabe  der folgenden Anweisung
1026cdf0e10cSrcweir 						// mit dem alten Dumper uebereinstimmen zu lassen.
1027cdf0e10cSrcweir 
1028cdf0e10cSrcweir //	*pOut << begin( *pOut, *xTableStream ) << "Dop, Size " << rFib.lcbDop << ", DefaultSize 84" << endl1;
1029cdf0e10cSrcweir 	begin( *pOut, *xTableStream ) << "Dop, Size " << rFib.lcbDop << ", DefaultSize 84" << endl1;
1030cdf0e10cSrcweir 
1031cdf0e10cSrcweir 	WW8Dop* pD = new WW8Dop( *xTableStream, rFib.nFib, rFib.fcDop, rFib.lcbDop );
1032cdf0e10cSrcweir 
1033cdf0e10cSrcweir 	*pOut << indent2 << "fFacingPages : " << pD->fFacingPages << endl1;
1034cdf0e10cSrcweir 	*pOut << indent2 << "fWidowControl : " << pD->fWidowControl << endl1;
1035cdf0e10cSrcweir 	*pOut << indent2 << "fPMHMainDoc : " << pD->fPMHMainDoc << endl1;
1036cdf0e10cSrcweir 	*pOut << indent2 << "grfSuppression : " << pD->grfSuppression << endl1;
1037cdf0e10cSrcweir 	*pOut << indent2 << "fpc : " << pD->fpc << endl1;
1038cdf0e10cSrcweir 	*pOut << indent2 << "grpfIhdt : " << pD->grpfIhdt << endl1;
1039cdf0e10cSrcweir 	*pOut << indent2 << "rncFtn : " << pD->rncFtn << endl1;
1040cdf0e10cSrcweir 	*pOut << indent2 << "nFtn : " << pD->nFtn << endl1;
1041cdf0e10cSrcweir 	*pOut << indent2 << "fOutlineDirtySave : " << pD->fOutlineDirtySave << endl1;
1042cdf0e10cSrcweir 	*pOut << indent2 << "fOnlyMacPics : " << pD->fOnlyMacPics << endl1;
1043cdf0e10cSrcweir 	*pOut << indent2 << "fOnlyWinPics : " << pD->fOnlyWinPics << endl1;
1044cdf0e10cSrcweir 	*pOut << indent2 << "fLabelDoc : " << pD->fLabelDoc << endl1;
1045cdf0e10cSrcweir 	*pOut << indent2 << "fHyphCapitals : " << pD->fHyphCapitals << endl1;
1046cdf0e10cSrcweir 	*pOut << indent2 << "fAutoHyphen : " << pD->fAutoHyphen << endl1;
1047cdf0e10cSrcweir 	*pOut << indent2 << "fFormNoFields : " << pD->fFormNoFields << endl1;
1048cdf0e10cSrcweir 	*pOut << indent2 << "fLinkStyles : " << pD->fLinkStyles << endl1;
1049cdf0e10cSrcweir 	*pOut << indent2 << "fRevMarking : " << pD->fRevMarking << endl1;
1050cdf0e10cSrcweir 	*pOut << indent2 << "fBackup : " << pD->fBackup << endl1;
1051cdf0e10cSrcweir 	*pOut << indent2 << "fExactCWords : " << pD->fExactCWords << endl1;
1052cdf0e10cSrcweir 	*pOut << indent2 << "fPagHidden : " << pD->fPagHidden << endl1;
1053cdf0e10cSrcweir 	*pOut << indent2 << "fPagResults : " << pD->fPagResults << endl1;
1054cdf0e10cSrcweir 	*pOut << indent2 << "fLockAtn : " << pD->fLockAtn << endl1;
1055cdf0e10cSrcweir 	*pOut << indent2 << "fMirrorMargins : " << pD->fMirrorMargins << endl1;
1056cdf0e10cSrcweir 	*pOut << indent2 << "fReadOnlyRecommended : " << pD->fReadOnlyRecommended << endl1;
1057cdf0e10cSrcweir 	*pOut << indent2 << "fDfltTrueType : " << pD->fDfltTrueType << endl1;
1058cdf0e10cSrcweir 	*pOut << indent2 << "fPagSuppressTopSpacing : " << pD->fPagSuppressTopSpacing << endl1;
1059cdf0e10cSrcweir 	*pOut << indent2 << "fProtEnabled : " << pD->fProtEnabled << endl1;
1060cdf0e10cSrcweir 	*pOut << indent2 << "fDispFormFldSel : " << pD->fDispFormFldSel << endl1;
1061cdf0e10cSrcweir 	*pOut << indent2 << "fRMView : " << pD->fRMView << endl1;
1062cdf0e10cSrcweir 	*pOut << indent2 << "fRMPrint : " << pD->fRMPrint << endl1;
1063cdf0e10cSrcweir 	*pOut << indent2 << "fWriteReservation : " << pD->fWriteReservation << endl1;
1064cdf0e10cSrcweir 	*pOut << indent2 << "fLockRev : " << pD->fLockRev << endl1;
1065cdf0e10cSrcweir 	*pOut << indent2 << "fEmbedFonts : " << pD->fEmbedFonts << endl1;
1066cdf0e10cSrcweir 	*pOut << indent2 << "copts_fNoTabForInd : " << pD->copts_fNoTabForInd << endl1;
1067cdf0e10cSrcweir 	*pOut << indent2 << "copts_fNoSpaceRaiseLower : " << pD->copts_fNoSpaceRaiseLower << endl1;
1068cdf0e10cSrcweir 	*pOut << indent2 << "copts_fSupressSpbfAfterPgBrk : " << pD->copts_fSupressSpbfAfterPgBrk << endl1;
1069cdf0e10cSrcweir 	*pOut << indent2 << "copts_fWrapTrailSpaces : " << pD->copts_fWrapTrailSpaces << endl1;
1070cdf0e10cSrcweir 	*pOut << indent2 << "copts_fMapPrintTextColor : " << pD->copts_fMapPrintTextColor << endl1;
1071cdf0e10cSrcweir 	*pOut << indent2 << "copts_fNoColumnBalance : " << pD->copts_fNoColumnBalance << endl1;
1072cdf0e10cSrcweir 	*pOut << indent2 << "copts_fConvMailMergeEsc : " << pD->copts_fConvMailMergeEsc << endl1;
1073cdf0e10cSrcweir 	*pOut << indent2 << "copts_fSupressTopSpacing : " << pD->copts_fSupressTopSpacing << endl1;
1074cdf0e10cSrcweir 	*pOut << indent2 << "copts_fOrigWordTableRules : " << pD->copts_fOrigWordTableRules << endl1;
1075cdf0e10cSrcweir 	*pOut << indent2 << "copts_fTransparentMetafiles : " << pD->copts_fTransparentMetafiles << endl1;
1076cdf0e10cSrcweir 	*pOut << indent2 << "copts_fShowBreaksInFrames : " << pD->copts_fShowBreaksInFrames << endl1;
1077cdf0e10cSrcweir 	*pOut << indent2 << "copts_fSwapBordersFacingPgs : " << pD->copts_fSwapBordersFacingPgs << endl1;
1078cdf0e10cSrcweir 	*pOut << indent2 << "dxaTab : " << pD->dxaTab << endl1;
1079cdf0e10cSrcweir 	*pOut << indent2 << "wSpare : " << pD->wSpare << endl1;
1080cdf0e10cSrcweir 	*pOut << indent2 << "dxaHotZ : " << pD->dxaHotZ << endl1;
1081cdf0e10cSrcweir 	*pOut << indent2 << "cConsecHypLim : " << pD->cConsecHypLim << endl1;
1082cdf0e10cSrcweir 	*pOut << indent2 << "wSpare2 : " << pD->wSpare2 << endl1;
1083cdf0e10cSrcweir 	*pOut << indent2 << "dttmCreated : " << pD->dttmCreated << endl1;
1084cdf0e10cSrcweir 	*pOut << indent2 << "dttmRevised : " << pD->dttmRevised << endl1;
1085cdf0e10cSrcweir 	*pOut << indent2 << "dttmLastPrint : " << pD->dttmLastPrint << endl1;
1086cdf0e10cSrcweir 	*pOut << indent2 << "nRevision : " << pD->nRevision << endl1;
1087cdf0e10cSrcweir 	*pOut << indent2 << "tmEdited : " << pD->tmEdited << endl1;
1088cdf0e10cSrcweir 	*pOut << indent2 << "cWords : " << pD->cWords << endl1;
1089cdf0e10cSrcweir 	*pOut << indent2 << "cCh : " << pD->cCh << endl1;
1090cdf0e10cSrcweir 	*pOut << indent2 << "cPg : " << pD->cPg << endl1;
1091cdf0e10cSrcweir 	*pOut << indent2 << "cParas : " << pD->cParas << endl1;
1092cdf0e10cSrcweir 	*pOut << indent2 << "rncEdn : " << pD->rncEdn << endl1;
1093cdf0e10cSrcweir 	*pOut << indent2 << "nEdn : " << pD->nEdn << endl1;
1094cdf0e10cSrcweir 	*pOut << indent2 << "epc : " << pD->epc << endl1;
1095cdf0e10cSrcweir 	*pOut << indent2 << "fPrintFormData : " << pD->fPrintFormData << endl1;
1096cdf0e10cSrcweir 	*pOut << indent2 << "fSaveFormData : " << pD->fSaveFormData << endl1;
1097cdf0e10cSrcweir 	*pOut << indent2 << "fShadeFormData : " << pD->fShadeFormData << endl1;
1098cdf0e10cSrcweir 	*pOut << indent2 << "fWCFtnEdn : " << pD->fWCFtnEdn << endl1;
1099cdf0e10cSrcweir 	*pOut << indent2 << "cLines : " << pD->cLines << endl1;
1100cdf0e10cSrcweir 	*pOut << indent2 << "cWordsFtnEnd : " << pD->cWordsFtnEnd << endl1;
1101cdf0e10cSrcweir 	*pOut << indent2 << "cChFtnEdn : " << pD->cChFtnEdn << endl1;
1102cdf0e10cSrcweir 	*pOut << indent2 << "cPgFtnEdn : " << pD->cPgFtnEdn << endl1;
1103cdf0e10cSrcweir 	*pOut << indent2 << "cParasFtnEdn : " << pD->cParasFtnEdn << endl1;
1104cdf0e10cSrcweir 	*pOut << indent2 << "cLinesFtnEdn : " << pD->cLinesFtnEdn << endl1;
1105cdf0e10cSrcweir 	*pOut << indent2 << "lKeyProtDoc : " << pD->lKeyProtDoc << endl1;
1106cdf0e10cSrcweir 	*pOut << indent2 << "wvkSaved : " << pD->wvkSaved << endl1;
1107cdf0e10cSrcweir 	*pOut << indent2 << "wScaleSaved : " << pD->wScaleSaved << endl1;
1108cdf0e10cSrcweir 	*pOut << indent2 << "zkSaved : " << pD->zkSaved << endl1;
1109cdf0e10cSrcweir 	*pOut << indent2 << "fNoTabForInd : " << pD->fNoTabForInd << endl1;
1110cdf0e10cSrcweir 	*pOut << indent2 << "fNoSpaceRaiseLower : " << pD->fNoSpaceRaiseLower << endl1;
1111cdf0e10cSrcweir 	*pOut << indent2 << "fSupressSpbfAfterPageBreak : " << pD->fSupressSpbfAfterPageBreak << endl1;
1112cdf0e10cSrcweir 	*pOut << indent2 << "fWrapTrailSpaces : " << pD->fWrapTrailSpaces << endl1;
1113cdf0e10cSrcweir 	*pOut << indent2 << "fMapPrintTextColor : " << pD->fMapPrintTextColor << endl1;
1114cdf0e10cSrcweir 	*pOut << indent2 << "fNoColumnBalance : " << pD->fNoColumnBalance << endl1;
1115cdf0e10cSrcweir 	*pOut << indent2 << "fConvMailMergeEsc : " << pD->fConvMailMergeEsc << endl1;
1116cdf0e10cSrcweir 	*pOut << indent2 << "fSupressTopSpacing : " << pD->fSupressTopSpacing << endl1;
1117cdf0e10cSrcweir 	*pOut << indent2 << "fOrigWordTableRules : " << pD->fOrigWordTableRules << endl1;
1118cdf0e10cSrcweir 	*pOut << indent2 << "fTransparentMetafiles : " << pD->fTransparentMetafiles << endl1;
1119cdf0e10cSrcweir 	*pOut << indent2 << "fShowBreaksInFrames : " << pD->fShowBreaksInFrames << endl1;
1120cdf0e10cSrcweir 	*pOut << indent2 << "fSwapBordersFacingPgs : " << pD->fSwapBordersFacingPgs << endl1;
1121cdf0e10cSrcweir 	*pOut << indent2 << "fSuppressTopSpacingMac5 : " << pD->fSuppressTopSpacingMac5 << endl1;
1122cdf0e10cSrcweir 	*pOut << indent2 << "fTruncDxaExpand : " << pD->fTruncDxaExpand << endl1;
1123cdf0e10cSrcweir 	*pOut << indent2 << "fPrintBodyBeforeHdr : " << pD->fPrintBodyBeforeHdr << endl1;
1124cdf0e10cSrcweir 	*pOut << indent2 << "fNoLeading : " << pD->fNoLeading << endl1;
1125cdf0e10cSrcweir 	*pOut << indent2 << "fMWSmallCaps : " << pD->fMWSmallCaps << endl1;
1126cdf0e10cSrcweir 
1127cdf0e10cSrcweir 	*pOut << indent2 << "adt : " << pD->adt << endl1;
1128cdf0e10cSrcweir 
1129cdf0e10cSrcweir 	*pOut << indent2 << "lvl : " << pD->lvl << endl1;
1130cdf0e10cSrcweir 	*pOut << indent2 << "fHtmlDoc : " << pD->fHtmlDoc << endl1;
1131cdf0e10cSrcweir 	*pOut << indent2 << "fSnapBorder : " << pD->fSnapBorder << endl1;
1132cdf0e10cSrcweir 	*pOut << indent2 << "fIncludeHeader : " << pD->fIncludeHeader << endl1;
1133cdf0e10cSrcweir 	*pOut << indent2 << "fIncludeFooter : " << pD->fIncludeFooter << endl1;
1134cdf0e10cSrcweir 	*pOut << indent2 << "fForcePageSizePag : " << pD->fForcePageSizePag << endl1;
1135cdf0e10cSrcweir 	*pOut << indent2 << "fMinFontSizePag : " << pD->fMinFontSizePag << endl1;
1136cdf0e10cSrcweir 
1137cdf0e10cSrcweir 	*pOut << indent2 << "fHaveVersions : " << pD->fHaveVersions << endl1;
1138cdf0e10cSrcweir 	*pOut << indent2 << "fAutoVersion : " << pD->fAutoVersion << endl1;
1139cdf0e10cSrcweir 	*pOut << indent2 << "cChWS : " << pD->cChWS << endl1;
1140cdf0e10cSrcweir 	*pOut << indent2 << "cChWSFtnEdn : " << pD->cChWSFtnEdn << endl1;
1141cdf0e10cSrcweir 	*pOut << indent2 << "grfDocEvents : " << pD->grfDocEvents << endl1;
1142cdf0e10cSrcweir 	*pOut << indent2 << "cDBC : " << pD->cDBC << endl1;
1143cdf0e10cSrcweir 	*pOut << indent2 << "cDBCFtnEdn : " << pD->cDBCFtnEdn << endl1;
1144cdf0e10cSrcweir 	*pOut << indent2 << "nfcFtnRef : " << pD->nfcFtnRef << endl1;
1145cdf0e10cSrcweir 	*pOut << indent2 << "nfcEdnRef : " << pD->nfcEdnRef << endl1;
1146cdf0e10cSrcweir 	*pOut << indent2 << "hpsZoonFontPag : " << pD->hpsZoonFontPag << endl1;
1147cdf0e10cSrcweir 	*pOut << indent2 << "dywDispPag : " << pD->dywDispPag << endl1;
1148cdf0e10cSrcweir 
1149cdf0e10cSrcweir 	end( *pOut, *xStrm ) << "Dop" << endl1 << endl1;
1150cdf0e10cSrcweir 
1151cdf0e10cSrcweir 	DELETEZ( pD );
1152cdf0e10cSrcweir }
1153cdf0e10cSrcweir 
1154cdf0e10cSrcweir //-----------------------------------------
1155cdf0e10cSrcweir //	  PLCF.PCD ( Piece Table )
1156cdf0e10cSrcweir //-----------------------------------------
1157cdf0e10cSrcweir 
1158cdf0e10cSrcweir #ifdef __WW8_NEEDS_PACK
1159cdf0e10cSrcweir #  pragma pack(2)
1160cdf0e10cSrcweir #endif
1161cdf0e10cSrcweir 
1162cdf0e10cSrcweir struct WW8_PCD1
1163cdf0e10cSrcweir {
1164cdf0e10cSrcweir 	sal_uInt8 aBits1;
1165cdf0e10cSrcweir 	sal_uInt8 aBits2;
1166cdf0e10cSrcweir //	sal_Int16 fNoParaLast : 1;	// when 1, means that piece contains no end of parag
1167cdf0e10cSrcweir //	sal_uInt8 fPaphNil : 1;		// used internally by Word
1168cdf0e10cSrcweir //	sal_uInt8 fCopied : 1;		// used internally by Word
1169cdf0e10cSrcweir 	//			*	int :5
1170cdf0e10cSrcweir //	sal_uInt8 aBits2;			// fn int:8, used internally by Word
1171cdf0e10cSrcweir 	sal_Int32 fc;				// file offset of beginning of piece. The size of th
1172cdf0e10cSrcweir 	sal_Int16 prm;				// PRM contains either a single sprm or else an inde
1173cdf0e10cSrcweir };
1174cdf0e10cSrcweir 
1175cdf0e10cSrcweir #ifdef __WW8_NEEDS_PACK
1176cdf0e10cSrcweir #  pragma pack()
1177cdf0e10cSrcweir #endif
1178cdf0e10cSrcweir 
DumpPLCFPcd(sal_uInt8 nVersion,long nPos,long nLen)1179cdf0e10cSrcweir static void DumpPLCFPcd( sal_uInt8 nVersion, long nPos, long nLen )
1180cdf0e10cSrcweir {
1181cdf0e10cSrcweir 	WW8PLCF aPlc( &xTableStream, nPos , nLen, 8 );
1182cdf0e10cSrcweir 
1183cdf0e10cSrcweir 	*pOut << 'D' << hex6 << nPos << dec2 <<  ' ' << indent1 << begin1;
1184cdf0e10cSrcweir 	*pOut << "Plcx.Pcd, Len: ";
1185cdf0e10cSrcweir 	*pOut << nLen << ", " << aPlc.GetIMax() << " Elements" << endl1;
1186cdf0e10cSrcweir 
1187cdf0e10cSrcweir 	int i;
1188cdf0e10cSrcweir 	for( i=0; i<aPlc.GetIMax(); i++ )
1189cdf0e10cSrcweir 	{
1190cdf0e10cSrcweir 		long start, ende;
1191cdf0e10cSrcweir 		void* pData;
1192cdf0e10cSrcweir 		aPlc.Get( start, ende, pData );
1193cdf0e10cSrcweir 		*pOut << indent2 << " Cp: " << hex6 << start << ".." << hex6 << ende;
1194cdf0e10cSrcweir 
1195cdf0e10cSrcweir 		WW8_PCD1* p = (WW8_PCD1*) pData;
1196cdf0e10cSrcweir 		*pOut << ", Bits: " << hex2  <<  (sal_uInt16)p->aBits1 << ' '
1197cdf0e10cSrcweir 			  << hex2 << (sal_uInt16)p->aBits2;
1198cdf0e10cSrcweir 		*pOut << ", FcStart: ";
1199cdf0e10cSrcweir 		if( 8 <= nVersion )
1200cdf0e10cSrcweir 		{
1201cdf0e10cSrcweir 			sal_Bool bUniCode;
1202cdf0e10cSrcweir 			*pOut << hex6
1203cdf0e10cSrcweir 				  << WW8PLCFx_PCD::TransformPieceAddress( p->fc, bUniCode );
1204cdf0e10cSrcweir 			if( bUniCode )
1205cdf0e10cSrcweir 				*pOut << " (UniCode)";
1206cdf0e10cSrcweir 		}
1207cdf0e10cSrcweir 		else
1208cdf0e10cSrcweir 			*pOut << hex6 << p->fc;
1209cdf0e10cSrcweir 
1210cdf0e10cSrcweir 		*pOut << dec << ", prm ";
1211cdf0e10cSrcweir 		if( p->prm & 0x1 ){
1212cdf0e10cSrcweir 			*pOut << "No: " << ( p->prm >> 1 );
1213cdf0e10cSrcweir 		}else if ( p-> prm == 0 ){
1214cdf0e10cSrcweir 			*pOut << "-";
1215cdf0e10cSrcweir 		}else{
1216cdf0e10cSrcweir 			*pOut << "(Sprm): ";
1217cdf0e10cSrcweir 			DumpMemSprm( nVersion, &(p->prm) );
1218cdf0e10cSrcweir 		}
1219cdf0e10cSrcweir 		*pOut << endl1;
1220cdf0e10cSrcweir 
1221cdf0e10cSrcweir 		aPlc++;
1222cdf0e10cSrcweir 	}
1223cdf0e10cSrcweir 	end( *pOut, *xTableStream ) << "Plcx.Pcd" << endl1;
1224cdf0e10cSrcweir }
1225cdf0e10cSrcweir 
DumpPcd(sal_uInt8 nVersion,long nPos,long nLen)1226cdf0e10cSrcweir static void DumpPcd( sal_uInt8 nVersion, long nPos, long nLen )
1227cdf0e10cSrcweir {
1228cdf0e10cSrcweir 	long nLen1 = nLen;
1229cdf0e10cSrcweir 	xTableStream->Seek( nPos );
1230cdf0e10cSrcweir 
1231cdf0e10cSrcweir 	*pOut << 'D' << hex6 << nPos << dec2 <<  ' ' << indent1 << begin1;
1232cdf0e10cSrcweir 	*pOut << "PieceTable, Len: " << nLen << endl1;
1233cdf0e10cSrcweir 	if( sizeof( WW8_PCD1 ) != 8 )
1234cdf0e10cSrcweir 		*pOut << "!!! Alignment-Problem !!! sizeof( WW8_PCD1 ) != 8 !!! " << endl1;
1235cdf0e10cSrcweir 
1236cdf0e10cSrcweir 	long i = 0;
1237cdf0e10cSrcweir 	while (1){
1238cdf0e10cSrcweir 		sal_uInt8 c;
1239cdf0e10cSrcweir 		sal_Int16 cb;
1240cdf0e10cSrcweir 
1241cdf0e10cSrcweir 		xTableStream->Read( &c, 1 );
1242cdf0e10cSrcweir 		nLen1 --;
1243cdf0e10cSrcweir 		if( c == 2 )
1244cdf0e10cSrcweir 			break;
1245cdf0e10cSrcweir 		xTableStream->Read( &cb, 2 );
1246cdf0e10cSrcweir 		nLen1 -= 2;
1247cdf0e10cSrcweir 		indent( *pOut, *xTableStream ) << "grpprl No. " << i << ", Len: " << cb << endl1;
1248cdf0e10cSrcweir 
1249cdf0e10cSrcweir 		long nPos = xTableStream->Tell();
1250cdf0e10cSrcweir 		DumpSprms( nVersion, *xTableStream, cb );					// Dumpe Sprms
1251cdf0e10cSrcweir 		xTableStream->Seek( nPos + cb );			// gehe hinter grpprl
1252cdf0e10cSrcweir 		nLen1 -= cb;
1253cdf0e10cSrcweir 		i++;
1254cdf0e10cSrcweir //		*pOut << "       " << indent1 << "grpprl: " << cb << "Bytes ueberlesen";
1255cdf0e10cSrcweir //		*pOut << endl1;
1256cdf0e10cSrcweir 	}
1257cdf0e10cSrcweir 	sal_Int32 nLen2;
1258cdf0e10cSrcweir 	xTableStream->Read( &nLen2, 4 );
1259cdf0e10cSrcweir 	nLen1 -= 4;
1260cdf0e10cSrcweir 	if( nLen1 != nLen2 )
1261cdf0e10cSrcweir 		*pOut << "!!! nLen1 ( " << nLen1 << " ) != nLen2 ( " << nLen2 << " ) !"
1262cdf0e10cSrcweir 			  << endl1;
1263cdf0e10cSrcweir 
1264cdf0e10cSrcweir 	DumpPLCFPcd( nVersion, xTableStream->Tell(), nLen2 );
1265cdf0e10cSrcweir 
1266cdf0e10cSrcweir 	end( *pOut, *xTableStream ) << "PieceTable" << endl1 << endl1;
1267cdf0e10cSrcweir }
1268cdf0e10cSrcweir 
1269cdf0e10cSrcweir //-----------------------------------------
1270cdf0e10cSrcweir //	  PLCF.CHPX, PLCF.PAPX, PLCF.SEPX
1271cdf0e10cSrcweir //-----------------------------------------
1272cdf0e10cSrcweir 
DumpPLCF(long nPos,long nLen,ePLCFT ePlc)1273cdf0e10cSrcweir static void DumpPLCF( long nPos, long nLen, ePLCFT ePlc )
1274cdf0e10cSrcweir {
1275cdf0e10cSrcweir 	static int __READONLY_DATA WW8FkpSizeTabVer6[ PLCF_END ] = {
1276cdf0e10cSrcweir 													1,  7, 0 /*, 0, 0, 0*/ };
1277cdf0e10cSrcweir 	static int __READONLY_DATA PlcSizeTabVer6[ PLCF_END+4 ] = {
1278cdf0e10cSrcweir 													2, 2, 12, 0, 2, 2, 20 };
1279cdf0e10cSrcweir 
1280cdf0e10cSrcweir 	static int __READONLY_DATA WW8FkpSizeTabVer8[ PLCF_END ] = {
1281cdf0e10cSrcweir 													1, 13, 0 /*, 0, 0, 0*/ };
1282cdf0e10cSrcweir 	static int __READONLY_DATA PlcSizeTabVer8[ PLCF_END+4 ] = {
1283cdf0e10cSrcweir 													4, 4, 12, 0, 2, 2, 30 };
1284cdf0e10cSrcweir 
1285cdf0e10cSrcweir 	const int* pFkpSizeTab;
1286cdf0e10cSrcweir 	const int* pPlcSizeTab;
1287cdf0e10cSrcweir 
1288cdf0e10cSrcweir 	switch( pWwFib->nVersion )
1289cdf0e10cSrcweir 	{
1290cdf0e10cSrcweir 	case 6:
1291cdf0e10cSrcweir 	case 7: pFkpSizeTab = WW8FkpSizeTabVer6;
1292cdf0e10cSrcweir 			pPlcSizeTab = PlcSizeTabVer6;
1293cdf0e10cSrcweir 			break;
1294cdf0e10cSrcweir 	case 8: pFkpSizeTab = WW8FkpSizeTabVer8;
1295cdf0e10cSrcweir 			pPlcSizeTab = PlcSizeTabVer8;
1296cdf0e10cSrcweir 			break;
1297cdf0e10cSrcweir 	default:// Programm-Fehler!
1298cdf0e10cSrcweir 					/*
1299cdf0e10cSrcweir 						ACHTUNG: im FILTER nicht "sal_False" sondern "!this()" schreiben,
1300cdf0e10cSrcweir 											da sonst Warning unter OS/2
1301cdf0e10cSrcweir 					*/
1302cdf0e10cSrcweir 					ASSERT( sal_False, "Es wurde vergessen, nVersion zu kodieren!" );
1303cdf0e10cSrcweir 					return;
1304cdf0e10cSrcweir 	}
1305cdf0e10cSrcweir 
1306cdf0e10cSrcweir //	SvStream* pSt = (SEP == ePlc) ? &xTableStream : &xStrm;
1307cdf0e10cSrcweir 	SvStream* pSt = &xTableStream;
1308cdf0e10cSrcweir 
1309cdf0e10cSrcweir 	WW8PLCF aPlc( pSt, nPos, nLen, pPlcSizeTab[ ePlc ] );
1310cdf0e10cSrcweir 
1311cdf0e10cSrcweir 	*pOut << 'T' << hex6 << nPos << dec2 <<  ' ' << indent1 << begin1;
1312cdf0e10cSrcweir 	*pOut << "Plcx." << NameTab[ePlc] << ", Len: ";
1313cdf0e10cSrcweir 	*pOut << nLen << ", " << aPlc.GetIMax() << " Elements" << endl1;
1314cdf0e10cSrcweir 
1315cdf0e10cSrcweir 	int i;
1316cdf0e10cSrcweir 	for( i=0; i<aPlc.GetIMax(); i++ )
1317cdf0e10cSrcweir 	{
1318cdf0e10cSrcweir 		long start, ende;
1319cdf0e10cSrcweir 		void* pData;
1320cdf0e10cSrcweir 		aPlc.Get( start, ende, pData );
1321cdf0e10cSrcweir 		*pOut << indent2 << "Plcx." << NameTab[ePlc];
1322cdf0e10cSrcweir 		switch( ePlc ){
1323cdf0e10cSrcweir 		case SEP: {
1324cdf0e10cSrcweir 						*pOut << " Cp: " << hex << start << ".." << ende ;
1325cdf0e10cSrcweir 						long nPo = *((long*)((char*)pData+2));
1326cdf0e10cSrcweir 					if( nPo == 0xffffffffL )
1327cdf0e10cSrcweir 						{
1328cdf0e10cSrcweir 						  *pOut << " Empty" << endl1;
1329cdf0e10cSrcweir 					}
1330cdf0e10cSrcweir 						else
1331cdf0e10cSrcweir 						{
1332cdf0e10cSrcweir 							*pOut << ", Sepx-Position: " << nPo << dec << endl1;
1333cdf0e10cSrcweir 						DumpSepx( pWwFib->nVersion, nPo );
1334cdf0e10cSrcweir 					}
1335cdf0e10cSrcweir 				  }
1336cdf0e10cSrcweir 				  break;
1337cdf0e10cSrcweir 		case CHP:
1338cdf0e10cSrcweir 		case PAP: {
1339cdf0e10cSrcweir 						*pOut << " Fc: " << hex << start << ".." << ende ;
1340cdf0e10cSrcweir 						long nPo;
1341cdf0e10cSrcweir 						switch( pWwFib->nVersion )
1342cdf0e10cSrcweir 						{
1343cdf0e10cSrcweir 						case 6:
1344cdf0e10cSrcweir 						case 7: nPo = *((sal_uInt16*)pData);
1345cdf0e10cSrcweir 										break;
1346cdf0e10cSrcweir 						case 8: nPo = *((sal_uInt32*)pData);
1347cdf0e10cSrcweir 										break;
1348cdf0e10cSrcweir 						default:// Programm-Fehler!
1349cdf0e10cSrcweir 										/*
1350cdf0e10cSrcweir 											ACHTUNG: im FILTER nicht "sal_False" sondern "!this()" schreiben,
1351cdf0e10cSrcweir 																da sonst Warning unter OS/2
1352cdf0e10cSrcweir 										*/
1353cdf0e10cSrcweir 										ASSERT( sal_False, "Es wurde vergessen, nVersion zu kodieren!" );
1354cdf0e10cSrcweir 										return;
1355cdf0e10cSrcweir 						}
1356cdf0e10cSrcweir 
1357cdf0e10cSrcweir 					nPo <<= 9;
1358cdf0e10cSrcweir 					*pOut << ", Offset: " << nPo << dec << endl1;
1359cdf0e10cSrcweir 					DumpFkp( pWwFib->nVersion, nPo, pFkpSizeTab[ ePlc ], ePlc );
1360cdf0e10cSrcweir 				  }
1361cdf0e10cSrcweir 				  break;
1362cdf0e10cSrcweir 
1363cdf0e10cSrcweir 		case PLCF_END+0:
1364cdf0e10cSrcweir 				  *pOut << " Cp: " << hex << start << ".." << ende << dec << endl1;
1365cdf0e10cSrcweir 				  break;
1366cdf0e10cSrcweir 
1367cdf0e10cSrcweir 		case PLCF_END+1:
1368cdf0e10cSrcweir 		case PLCF_END+2:
1369cdf0e10cSrcweir 			{
1370cdf0e10cSrcweir 				*pOut << " Cp: " << hex << start;
1371cdf0e10cSrcweir 				sal_uInt16 nFlags= *((sal_uInt16*)pData);
1372cdf0e10cSrcweir 				*pOut << ", Flags: 0x" << nFlags << dec << endl1;
1373cdf0e10cSrcweir 			}
1374cdf0e10cSrcweir 			break;
1375cdf0e10cSrcweir 
1376cdf0e10cSrcweir 		case PLCF_END+3:
1377cdf0e10cSrcweir 			{
1378cdf0e10cSrcweir 				*pOut << " Cp: " << hex << start << ", Initial: \"";
1379cdf0e10cSrcweir 				const char* p = (char*)pData;
1380cdf0e10cSrcweir 				sal_uInt8 n = *p++;
1381cdf0e10cSrcweir 				while( n-- )
1382cdf0e10cSrcweir 				{
1383cdf0e10cSrcweir 					if( 8 == pWwFib->nVersion )
1384cdf0e10cSrcweir 						++p;
1385cdf0e10cSrcweir 					*pOut << *p++;
1386cdf0e10cSrcweir 				}
1387cdf0e10cSrcweir 
1388cdf0e10cSrcweir 				long nBkmkId;
1389cdf0e10cSrcweir 				sal_uInt16 nId;
1390cdf0e10cSrcweir 				if( 8 == pWwFib->nVersion )
1391cdf0e10cSrcweir 				{
1392cdf0e10cSrcweir 					nId = SVBT16ToShort( ((WW8_ATRD*)pData)->ibst );
1393cdf0e10cSrcweir 					nBkmkId = SVBT32ToUInt32( ((WW8_ATRD*)pData)->ITagBkmk );
1394cdf0e10cSrcweir 				}
1395cdf0e10cSrcweir 				else
1396cdf0e10cSrcweir 				{
1397cdf0e10cSrcweir 					nId = SVBT16ToShort( ((WW67_ATRD*)pData )->ibst );
1398cdf0e10cSrcweir 					nBkmkId = SVBT32ToUInt32( ((WW67_ATRD*)pData )->ITagBkmk );
1399cdf0e10cSrcweir 				}
1400cdf0e10cSrcweir 
1401cdf0e10cSrcweir 				*pOut << "\", AutorId: " << hex << nId
1402cdf0e10cSrcweir 					  << " BkmkId: " << nBkmkId << dec <<endl1;
1403cdf0e10cSrcweir 			}
1404cdf0e10cSrcweir 			break;
1405cdf0e10cSrcweir 
1406cdf0e10cSrcweir 		}
1407cdf0e10cSrcweir 		aPlc++;
1408cdf0e10cSrcweir 	}
1409cdf0e10cSrcweir 	end( *pOut, *xTableStream ) << "Plcx." << NameTab[ePlc] << endl1 << endl1;
1410cdf0e10cSrcweir }
1411cdf0e10cSrcweir 
1412cdf0e10cSrcweir //-----------------------------------------
1413cdf0e10cSrcweir //				Text ohne Attribute
1414cdf0e10cSrcweir //-----------------------------------------
1415cdf0e10cSrcweir 
DumpPlainText1(WW8_CP nStartCp,long nTextLen)1416cdf0e10cSrcweir static void DumpPlainText1( WW8_CP nStartCp, long nTextLen )
1417cdf0e10cSrcweir {
1418cdf0e10cSrcweir 	long l;
1419cdf0e10cSrcweir 	sal_uInt8 c;
1420cdf0e10cSrcweir 
1421cdf0e10cSrcweir 
1422cdf0e10cSrcweir 	xStrm->Seek( pSBase->WW8Cp2Fc( nStartCp ) );
1423cdf0e10cSrcweir 
1424cdf0e10cSrcweir 	for (l=0; l<nTextLen; l++)
1425cdf0e10cSrcweir 	{
1426cdf0e10cSrcweir 		xStrm->Read( &c, sizeof(c) );
1427cdf0e10cSrcweir 		if ( DumpChar( c ) )
1428cdf0e10cSrcweir 		{
1429cdf0e10cSrcweir 			*pOut << endl1;
1430cdf0e10cSrcweir 			indent( *pOut, *xStrm );
1431cdf0e10cSrcweir 		}
1432cdf0e10cSrcweir //		DumpChar( c );
1433cdf0e10cSrcweir 	}
1434cdf0e10cSrcweir }
1435cdf0e10cSrcweir 
DumpShortPlainText(WW8_CP nStartCp,long nTextLen,char * pName)1436cdf0e10cSrcweir void DumpShortPlainText( WW8_CP nStartCp, long nTextLen, char* pName )
1437cdf0e10cSrcweir {
1438cdf0e10cSrcweir 	indent( *pOut, *xStrm ) << pName << " PlainText: Cp: "
1439cdf0e10cSrcweir 									<< hex << nStartCp
1440cdf0e10cSrcweir 									<< ".." << nStartCp + nTextLen << dec
1441cdf0e10cSrcweir 									<< " :\"";
1442cdf0e10cSrcweir 	DumpPlainText1( nStartCp, nTextLen );
1443cdf0e10cSrcweir 	*pOut << "\"" << endl1;
1444cdf0e10cSrcweir }
1445cdf0e10cSrcweir 
DumpPlainText(WW8_CP nStartCp,long nTextLen,char * pName)1446cdf0e10cSrcweir void DumpPlainText( WW8_CP nStartCp, long nTextLen, char* pName )
1447cdf0e10cSrcweir {
1448cdf0e10cSrcweir 	begin( *pOut, *xStrm ) << pName << " Text: Cp: " << hex << nStartCp
1449cdf0e10cSrcweir 									<< ".." << nStartCp + nTextLen << dec
1450cdf0e10cSrcweir 									<< endl1;
1451cdf0e10cSrcweir 	indent( *pOut, *xStrm );
1452cdf0e10cSrcweir 	DumpPlainText1( nStartCp, nTextLen );
1453cdf0e10cSrcweir 	*pOut << endl1;
1454cdf0e10cSrcweir 	end( *pOut, *xStrm ) << pName << " Text" << endl1;
1455cdf0e10cSrcweir }
1456cdf0e10cSrcweir 
1457cdf0e10cSrcweir //-----------------------------------------
1458cdf0e10cSrcweir //				Text mit Attributen
1459cdf0e10cSrcweir //-----------------------------------------
1460cdf0e10cSrcweir 
DumpChar(sal_uInt8 c)1461cdf0e10cSrcweir sal_Bool DumpChar( sal_uInt8 c )
1462cdf0e10cSrcweir {
1463cdf0e10cSrcweir 	if ( ( c >= 32 ) && ( c <= 127 ) ){
1464cdf0e10cSrcweir 		*pOut << c;
1465cdf0e10cSrcweir 		return sal_False;
1466cdf0e10cSrcweir 	}else{
1467cdf0e10cSrcweir 		switch (c){
1468cdf0e10cSrcweir 		case 0xe4:							// dt. Umlaute
1469cdf0e10cSrcweir 		case 0xf6:
1470cdf0e10cSrcweir 		case 0xfc:
1471cdf0e10cSrcweir 		case 0xdf:
1472cdf0e10cSrcweir 		case 0xc4:
1473cdf0e10cSrcweir 		case 0xd6:
1474cdf0e10cSrcweir 		case 0xdc: *pOut << c; return sal_False;
1475cdf0e10cSrcweir 
1476cdf0e10cSrcweir 		case 0xd: *pOut << "<CR>";
1477cdf0e10cSrcweir 				  return sal_True;
1478cdf0e10cSrcweir 		case 0x7:
1479cdf0e10cSrcweir 		case 0xc:  *pOut << "<0x" << hex2 << (sal_uInt16)c << dec2 << '>';
1480cdf0e10cSrcweir 				  return sal_True;
1481cdf0e10cSrcweir 		default:  *pOut << "<0x" << hex2 << (sal_uInt16)c << dec2 << '>';
1482cdf0e10cSrcweir 				  return sal_False;
1483cdf0e10cSrcweir 		}
1484cdf0e10cSrcweir 	}
1485cdf0e10cSrcweir }
1486cdf0e10cSrcweir 
1487cdf0e10cSrcweir //-----------------------------------------
1488cdf0e10cSrcweir //		Header / Footer
1489cdf0e10cSrcweir //-----------------------------------------
1490cdf0e10cSrcweir 
DumpPlcText(WW8_FC nPos,long nLen,long nOfs,char * pName,WW8ScannerBase * pBase,long nStruct=0,FNDumpData pOutFnc=0)1491cdf0e10cSrcweir static void DumpPlcText( WW8_FC nPos, long nLen, long nOfs,
1492cdf0e10cSrcweir 						char* pName, WW8ScannerBase* pBase,
1493cdf0e10cSrcweir 						long nStruct = 0, FNDumpData pOutFnc = 0 )
1494cdf0e10cSrcweir {
1495cdf0e10cSrcweir 	if( !nLen ) return;
1496cdf0e10cSrcweir 
1497cdf0e10cSrcweir 	WW8PLCF aPlc( &xTableStream, nPos , nLen, nStruct );
1498cdf0e10cSrcweir 
1499cdf0e10cSrcweir 	*pOut << 'T' << hex6 << nPos << dec2 <<  ' ' << indent1 << begin1;
1500cdf0e10cSrcweir 	*pOut << "Plc." << pName << " Text, Len: ";
1501cdf0e10cSrcweir 	*pOut << nLen << ", " << aPlc.GetIMax() << " Elements" << endl1;
1502cdf0e10cSrcweir 
1503cdf0e10cSrcweir 	int i;
1504cdf0e10cSrcweir 	for( i=0; i < aPlc.GetIMax(); ++i )
1505cdf0e10cSrcweir 	{
1506cdf0e10cSrcweir 		WW8_CP start, ende;
1507cdf0e10cSrcweir 		WW8_FC start2, ende2;
1508cdf0e10cSrcweir 		void* pData;
1509cdf0e10cSrcweir 		aPlc.Get( start, ende, pData );
1510cdf0e10cSrcweir 		start2 = pSBase->WW8Cp2Fc(start + nOfs );
1511cdf0e10cSrcweir 		ende2 =  pSBase->WW8Cp2Fc(ende + nOfs );
1512cdf0e10cSrcweir 
1513cdf0e10cSrcweir 		*pOut << "       " << indent1 << "Plcx." << pName;
1514cdf0e10cSrcweir 		*pOut << " Cp: " << hex << start << ".." << ende;
1515cdf0e10cSrcweir 		*pOut << " entspricht Fc: " << start2 << ".." << ende2 << dec << endl1;
1516cdf0e10cSrcweir 
1517cdf0e10cSrcweir 		DumpPlainText( nOfs + start, ende - start - 1, pName );
1518cdf0e10cSrcweir 
1519cdf0e10cSrcweir 		if( pOutFnc )
1520cdf0e10cSrcweir 			(*pOutFnc)( pData );
1521cdf0e10cSrcweir 		aPlc++;
1522cdf0e10cSrcweir 	}
1523cdf0e10cSrcweir 	end( *pOut, *xTableStream ) << "Plcx." << pName << endl1 << endl1;
1524cdf0e10cSrcweir }
1525cdf0e10cSrcweir 
DumpHeader(WW8ScannerBase * pBase)1526cdf0e10cSrcweir void DumpHeader( WW8ScannerBase* pBase )
1527cdf0e10cSrcweir {
1528cdf0e10cSrcweir 	DumpPlcText( pWwFib->fcPlcfhdd,
1529cdf0e10cSrcweir 				 pWwFib->lcbPlcfhdd,
1530cdf0e10cSrcweir 				 pWwFib->ccpText + pWwFib->ccpFtn,
1531cdf0e10cSrcweir 				 "Header/Footer", pBase );
1532cdf0e10cSrcweir }
1533cdf0e10cSrcweir 
DumpFootnotes(WW8ScannerBase * pBase)1534cdf0e10cSrcweir static void DumpFootnotes( WW8ScannerBase* pBase )
1535cdf0e10cSrcweir {
1536cdf0e10cSrcweir 	if( !pWwFib->lcbPlcffndRef ){
1537cdf0e10cSrcweir 		*pOut << "No Footnotes" << endl1 << endl1;
1538cdf0e10cSrcweir 		return;
1539cdf0e10cSrcweir 	}
1540cdf0e10cSrcweir 
1541cdf0e10cSrcweir 	DumpPLCF( pWwFib->fcPlcffndRef,
1542cdf0e10cSrcweir 			  pWwFib->lcbPlcffndRef,
1543cdf0e10cSrcweir 			  ePLCFT(/*FNR*/PLCF_END + 1) );
1544cdf0e10cSrcweir 	DumpPlcText( pWwFib->fcPlcffndTxt,
1545cdf0e10cSrcweir 				 pWwFib->lcbPlcffndTxt,
1546cdf0e10cSrcweir 				 pWwFib->ccpText,
1547cdf0e10cSrcweir 				 "FootNote" , pBase );
1548cdf0e10cSrcweir }
1549cdf0e10cSrcweir 
DumpEndnotes(WW8ScannerBase * pBase)1550cdf0e10cSrcweir static void DumpEndnotes( WW8ScannerBase* pBase )
1551cdf0e10cSrcweir {
1552cdf0e10cSrcweir 	if( !pWwFib->lcbPlcfendRef ){
1553cdf0e10cSrcweir 		*pOut << "No Endnotes" << endl1 << endl1;
1554cdf0e10cSrcweir 		return;
1555cdf0e10cSrcweir 	}
1556cdf0e10cSrcweir 
1557cdf0e10cSrcweir 	DumpPLCF( pWwFib->fcPlcfendRef,
1558cdf0e10cSrcweir 			  pWwFib->lcbPlcfendRef,
1559cdf0e10cSrcweir 			  ePLCFT(/*ENR*/PLCF_END + 2) );
1560cdf0e10cSrcweir 	DumpPlcText( pWwFib->fcPlcfendTxt,
1561cdf0e10cSrcweir 				 pWwFib->lcbPlcfendTxt,
1562cdf0e10cSrcweir 				 pWwFib->ccpText + pWwFib->ccpFtn
1563cdf0e10cSrcweir 					+ pWwFib->ccpHdr + pWwFib->ccpAtn,
1564cdf0e10cSrcweir 				 "EndNote", pBase );
1565cdf0e10cSrcweir }
1566cdf0e10cSrcweir 
DumpAnnotations(WW8ScannerBase * pBase)1567cdf0e10cSrcweir static void DumpAnnotations( WW8ScannerBase* pBase )
1568cdf0e10cSrcweir {
1569cdf0e10cSrcweir 	if( !pWwFib->lcbPlcfandRef ){
1570cdf0e10cSrcweir 		*pOut << "No Annotations" << endl1 << endl1;
1571cdf0e10cSrcweir 		return;
1572cdf0e10cSrcweir 	}
1573cdf0e10cSrcweir 
1574cdf0e10cSrcweir 	DumpPLCF( pWwFib->fcPlcfandRef,
1575cdf0e10cSrcweir 			  pWwFib->lcbPlcfandRef,
1576cdf0e10cSrcweir 			  ePLCFT(/*ENR*/PLCF_END + 3) );
1577cdf0e10cSrcweir 	DumpPlcText( pWwFib->fcPlcfandTxt,
1578cdf0e10cSrcweir 				 pWwFib->lcbPlcfandTxt,
1579cdf0e10cSrcweir 				 pWwFib->ccpText + pWwFib->ccpFtn
1580cdf0e10cSrcweir 					+ pWwFib->ccpHdr,
1581cdf0e10cSrcweir 				 "Annotation", pBase );
1582cdf0e10cSrcweir }
1583cdf0e10cSrcweir 
DumpTxtStoryEntry(void * pData)1584cdf0e10cSrcweir void DumpTxtStoryEntry( void* pData )
1585cdf0e10cSrcweir {
1586cdf0e10cSrcweir 	if( 8 == pWwFib->nVersion )
1587cdf0e10cSrcweir 	{
1588cdf0e10cSrcweir 		long* p = (long*)pData;
1589cdf0e10cSrcweir 		begin( *pOut, *xStrm )
1590cdf0e10cSrcweir 			<< "TextboxStory" << hex << endl1;
1591cdf0e10cSrcweir 
1592cdf0e10cSrcweir 		*pOut << "       " << indent1 << "cTxbx/iNextReuse: 0x" << *p++;
1593cdf0e10cSrcweir 		*pOut << " cReusable: 0x" << *p++;
1594cdf0e10cSrcweir 		short* ps = (short*)p;
1595cdf0e10cSrcweir 		*pOut << " fReusable: 0x" << *ps++ << endl1;
1596cdf0e10cSrcweir 		p = (long*)ps;
1597cdf0e10cSrcweir 		++p;		// reserved
1598cdf0e10cSrcweir 		*pOut << "       " << indent1 << "lid: 0x" << *p++;
1599cdf0e10cSrcweir 		*pOut << " txidUndo: 0x" << *p++ << dec << endl1;
1600cdf0e10cSrcweir 
1601cdf0e10cSrcweir 		end( *pOut, *xStrm ) << "TextboxStory" << endl1 << endl1;
1602cdf0e10cSrcweir 	}
1603cdf0e10cSrcweir }
1604cdf0e10cSrcweir 
DumpTextBoxs(WW8ScannerBase * pBase)1605cdf0e10cSrcweir static void DumpTextBoxs( WW8ScannerBase* pBase )
1606cdf0e10cSrcweir {
1607cdf0e10cSrcweir 	if( pWwFib->lcbPlcftxbxTxt )
1608cdf0e10cSrcweir 	{
1609cdf0e10cSrcweir 		DumpPlcText( pWwFib->fcPlcftxbxTxt,
1610cdf0e10cSrcweir 					 pWwFib->lcbPlcftxbxTxt,
1611cdf0e10cSrcweir 					 pWwFib->ccpText + pWwFib->ccpFtn
1612cdf0e10cSrcweir 						+ pWwFib->ccpHdr + pWwFib->ccpAtn + pWwFib->ccpEdn,
1613cdf0e10cSrcweir 					 "TextBoxes", pBase,
1614cdf0e10cSrcweir 					 8 == pWwFib->nVersion ? 22 : 0, &DumpTxtStoryEntry );
1615cdf0e10cSrcweir 	}
1616cdf0e10cSrcweir 	else
1617cdf0e10cSrcweir 		*pOut << "No Textboxes" << endl1 << endl1;
1618cdf0e10cSrcweir 
1619cdf0e10cSrcweir 	if( pWwFib->lcbPlcfHdrtxbxTxt )
1620cdf0e10cSrcweir 		DumpPlcText( pWwFib->fcPlcfHdrtxbxTxt,
1621cdf0e10cSrcweir 					 pWwFib->lcbPlcfHdrtxbxTxt,
1622cdf0e10cSrcweir 					 pWwFib->ccpText + pWwFib->ccpFtn
1623cdf0e10cSrcweir 						+ pWwFib->ccpHdr + pWwFib->ccpAtn + pWwFib->ccpEdn
1624cdf0e10cSrcweir 						+ pWwFib->ccpTxbx,
1625cdf0e10cSrcweir 					 "HeaderTextBoxes", pBase,
1626cdf0e10cSrcweir 					 8 == pWwFib->nVersion ? 22 : 0, &DumpTxtStoryEntry );
1627cdf0e10cSrcweir 	else
1628cdf0e10cSrcweir 		*pOut << "No HeaderTextboxes" << endl1 << endl1;
1629cdf0e10cSrcweir 
1630cdf0e10cSrcweir }
1631cdf0e10cSrcweir 
1632cdf0e10cSrcweir 
DumpDrawObjects(const char * pNm,long nStart,long nLen,long nOffset)1633cdf0e10cSrcweir static void DumpDrawObjects( const char* pNm, long nStart, long nLen,
1634cdf0e10cSrcweir 							long nOffset )
1635cdf0e10cSrcweir {
1636cdf0e10cSrcweir 	if( nStart && nLen )
1637cdf0e10cSrcweir 	{
1638cdf0e10cSrcweir 		WW8PLCFspecial aPLCF( &xTableStream, nStart, nLen,
1639cdf0e10cSrcweir 								8 == pWwFib->nVersion ? 26 : 6 );
1640cdf0e10cSrcweir 		*pOut << 'T' << hex6 << nStart << dec2 << ' ' << indent1 << begin1
1641cdf0e10cSrcweir 			  << pNm << ", Len: " << nLen
1642cdf0e10cSrcweir 			  << ", " << aPLCF.GetIMax() << " Elements" << endl1;
1643cdf0e10cSrcweir 
1644cdf0e10cSrcweir 		for( sal_uInt16 i = 0; i < aPLCF.GetIMax(); ++i )
1645cdf0e10cSrcweir 		{
1646cdf0e10cSrcweir 			long nCp = aPLCF.GetPos( i );
1647cdf0e10cSrcweir 			if( nCp >= LONG_MAX )
1648cdf0e10cSrcweir 				break;
1649cdf0e10cSrcweir 
1650cdf0e10cSrcweir 			*pOut << indent2 << i << ".Cp: 0x" << hex << nCp + nOffset;
1651cdf0e10cSrcweir 			long* pFSPA = (long*)aPLCF.GetData( i );
1652cdf0e10cSrcweir 			if( 8 == pWwFib->nVersion )
1653cdf0e10cSrcweir 			{
1654cdf0e10cSrcweir 				*pOut << " ShapeId: 0x" << *pFSPA++;
1655cdf0e10cSrcweir 				*pOut << " left: " << dec << *pFSPA++;
1656cdf0e10cSrcweir 				*pOut << " top: " << *pFSPA++;
1657cdf0e10cSrcweir 				*pOut << " right: " << *pFSPA++;
1658cdf0e10cSrcweir 				*pOut << " bottom: " << *pFSPA++;
1659cdf0e10cSrcweir 				sal_uInt16* pU = (sal_uInt16*)pFSPA;
1660cdf0e10cSrcweir 				*pOut << " flags: 0x" << hex << *pU++;
1661cdf0e10cSrcweir 				pFSPA = (long*)pU;
1662cdf0e10cSrcweir 				*pOut << " xTxbx: " << dec << *pFSPA;
1663cdf0e10cSrcweir 			}
1664cdf0e10cSrcweir 			else
1665cdf0e10cSrcweir 			{
1666cdf0e10cSrcweir 				*pOut << " FC of DO: 0x" << *pFSPA++;
1667cdf0e10cSrcweir 				*pOut << " ctcbx: " << dec << *(sal_uInt16*)pFSPA;
1668cdf0e10cSrcweir 			}
1669cdf0e10cSrcweir 
1670cdf0e10cSrcweir 			*pOut << endl1;
1671cdf0e10cSrcweir 		}
1672cdf0e10cSrcweir 		*pOut << end1;
1673cdf0e10cSrcweir 	}
1674cdf0e10cSrcweir 	else
1675cdf0e10cSrcweir 		*pOut << "No ";
1676cdf0e10cSrcweir 	*pOut << pNm << endl1 << endl1;
1677cdf0e10cSrcweir }
1678cdf0e10cSrcweir 
DumpTxtboxBrks(const char * pNm,long nStart,long nLen,long nOffset)1679cdf0e10cSrcweir static void DumpTxtboxBrks( const char* pNm, long nStart, long nLen,
1680cdf0e10cSrcweir 							long nOffset )
1681cdf0e10cSrcweir {
1682cdf0e10cSrcweir 	if( nStart && nLen )
1683cdf0e10cSrcweir 	{
1684cdf0e10cSrcweir 		WW8PLCFspecial aPLCF( &xTableStream, nStart, nLen, 6 );
1685cdf0e10cSrcweir 		*pOut << 'T' << hex6 << nStart << dec2 << ' ' << indent1 << begin1
1686cdf0e10cSrcweir 			  << pNm << ", Len: " << nLen
1687cdf0e10cSrcweir 			  << ", " << aPLCF.GetIMax() << " Elements" << endl1;
1688cdf0e10cSrcweir 
1689cdf0e10cSrcweir 		for( sal_uInt16 i = 0; i < aPLCF.GetIMax(); ++i )
1690cdf0e10cSrcweir 		{
1691cdf0e10cSrcweir 			long nCp = aPLCF.GetPos( i );
1692cdf0e10cSrcweir 			if( nCp >= LONG_MAX )
1693cdf0e10cSrcweir 				break;
1694cdf0e10cSrcweir 
1695cdf0e10cSrcweir 			sal_uInt16* pBKD = (sal_uInt16*)aPLCF.GetData( i );
1696cdf0e10cSrcweir 			*pOut << indent2 << i << ".Cp: 0x" << hex << nCp + nOffset
1697cdf0e10cSrcweir 				  << " itxbxs: 0x" << *pBKD++;
1698cdf0e10cSrcweir 			*pOut << " dcpDepend: 0x" << *pBKD++;
1699cdf0e10cSrcweir 			*pOut << " flags: 0x" << hex << *pBKD << dec << endl1;
1700cdf0e10cSrcweir 		}
1701cdf0e10cSrcweir 		*pOut << end2;
1702cdf0e10cSrcweir 	}
1703cdf0e10cSrcweir 	else
1704cdf0e10cSrcweir 		*pOut << "No ";
1705cdf0e10cSrcweir 	*pOut << pNm << endl1 << endl1;
1706cdf0e10cSrcweir }
1707cdf0e10cSrcweir 
DumpFdoa(WW8ScannerBase * pBase)1708cdf0e10cSrcweir static void DumpFdoa( WW8ScannerBase* pBase )
1709cdf0e10cSrcweir {
1710cdf0e10cSrcweir 	long nOffset = pWwFib->ccpText + pWwFib->ccpFtn
1711cdf0e10cSrcweir 						+ pWwFib->ccpHdr + pWwFib->ccpAtn + pWwFib->ccpEdn;
1712cdf0e10cSrcweir 
1713cdf0e10cSrcweir 	if( 8 == pWwFib->nVersion )
1714cdf0e10cSrcweir 	{
1715cdf0e10cSrcweir 		DumpDrawObjects( "DrawObjects in Maintext",
1716cdf0e10cSrcweir 							pWwFib->fcPlcfspaMom, pWwFib->lcbPlcfspaMom,
1717cdf0e10cSrcweir 							/*nOffset*/0 );
1718cdf0e10cSrcweir 		// PLCF fuer TextBox-Break-Deskriptoren im Maintext
1719cdf0e10cSrcweir 		DumpTxtboxBrks( "TextBox-Break-Desk. im Maintext",
1720cdf0e10cSrcweir 						pWwFib->fcPlcftxbxBkd, pWwFib->lcbPlcftxbxBkd,
1721cdf0e10cSrcweir 						nOffset );
1722cdf0e10cSrcweir 	}
1723cdf0e10cSrcweir 	else
1724cdf0e10cSrcweir 		DumpDrawObjects( "DrawObjects in Maintext",
1725cdf0e10cSrcweir 							pWwFib->fcPlcfdoaMom, pWwFib->lcbPlcfdoaMom,
1726cdf0e10cSrcweir 							/*nOffset*/0 );
1727cdf0e10cSrcweir 
1728cdf0e10cSrcweir 	nOffset += pWwFib->ccpHdrTxbx;
1729cdf0e10cSrcweir 
1730cdf0e10cSrcweir 	if( 8 == pWwFib->nVersion )
1731cdf0e10cSrcweir 	{
1732cdf0e10cSrcweir 		DumpDrawObjects( "DrawObjects in Head/Foot",
1733cdf0e10cSrcweir 					pWwFib->fcPlcfspaHdr, pWwFib->lcbPlcfspaHdr,
1734cdf0e10cSrcweir 					/*nOffset*/0 );
1735cdf0e10cSrcweir 		// PLCF fuer TextBox-Break-Deskriptoren im Header-/Footer-Bereich
1736cdf0e10cSrcweir 		DumpTxtboxBrks( "TextBox-Break-Desk. im Head/Foot",
1737cdf0e10cSrcweir 						pWwFib->fcPlcfHdrtxbxBkd, pWwFib->lcbPlcfHdrtxbxBkd,
1738cdf0e10cSrcweir 						nOffset );
1739cdf0e10cSrcweir 	}
1740cdf0e10cSrcweir 	else
1741cdf0e10cSrcweir 		DumpDrawObjects( "DrawObjects in Head/Foot",
1742cdf0e10cSrcweir 					pWwFib->fcPlcfdoaHdr, pWwFib->lcbPlcfdoaHdr,
1743cdf0e10cSrcweir 					/*nOffset*/0 );
1744cdf0e10cSrcweir }
1745cdf0e10cSrcweir 
ReadEsherRec(SvStream & rStrm,sal_uInt8 & rVer,sal_uInt16 & rInst,sal_uInt16 & rFbt,sal_uInt32 & rLength)1746cdf0e10cSrcweir sal_Bool ReadEsherRec( SvStream& rStrm, sal_uInt8& rVer, sal_uInt16& rInst,
1747cdf0e10cSrcweir 					sal_uInt16& rFbt, sal_uInt32& rLength )
1748cdf0e10cSrcweir {
1749cdf0e10cSrcweir 	sal_uInt16 aBits;
1750cdf0e10cSrcweir 	if( !WW8ReadUINT16( rStrm, aBits ) ) return sal_False;
1751cdf0e10cSrcweir 	rVer  =  aBits & 0x000F;
1752cdf0e10cSrcweir 	rInst = (aBits & 0xFFF0) >> 4;
1753cdf0e10cSrcweir 	//----------------------------------------------
1754cdf0e10cSrcweir 	if( !WW8ReadUINT16( rStrm, rFbt ) ) return sal_False;
1755cdf0e10cSrcweir 	//----------------------------------------------
1756cdf0e10cSrcweir 	return WW8ReadUINT32( rStrm, rLength );
1757cdf0e10cSrcweir }
1758cdf0e10cSrcweir 
_GetShapeTypeNm(sal_uInt16 nId)1759cdf0e10cSrcweir const char* _GetShapeTypeNm( sal_uInt16 nId )
1760cdf0e10cSrcweir {
1761cdf0e10cSrcweir 	const char* aNmArr[ 202 + 2 + 1 ] = {
1762cdf0e10cSrcweir /*   0*/	"NotPrimitive","Rectangle","RoundRectangle","Ellipse","Diamond","IsocelesTriangle","RightTriangle","Parallelogram","Trapezoid","Hexagon",
1763cdf0e10cSrcweir /*  10*/	"Octagon","Plus","Star","Arrow","ThickArrow","HomePlate","Cube","Balloon","Seal","Arc",
1764cdf0e10cSrcweir /*  20*/	"Line","Plaque","Can","Donut","TextSimple","TextOctagon","TextHexagon","TextCurve","TextWave","TextRing",
1765cdf0e10cSrcweir /*  30*/	"TextOnCurve","TextOnRing","StraightConnector1","BentConnector2","BentConnector3","BentConnector4","BentConnector5","CurvedConnector2","CurvedConnector3","CurvedConnector4",
1766cdf0e10cSrcweir /*  40*/	"CurvedConnector5","Callout1","Callout2","Callout3","AccentCallout1","AccentCallout2","AccentCallout3","BorderCallout1","BorderCallout2","BorderCallout3",
1767cdf0e10cSrcweir /*  50*/	"AccentBorderCallout1","AccentBorderCallout2","AccentBorderCallout3","Ribbon","Ribbon2","Chevron","Pentagon","NoSmoking","Seal8","Seal16",
1768cdf0e10cSrcweir /*  60*/	"Seal32","WedgeRectCallout","WedgeRRectCallout","WedgeEllipseCallout","Wave","FoldedCorner","LeftArrow","DownArrow","UpArrow","LeftRightArrow",
1769cdf0e10cSrcweir /*  70*/	"UpDownArrow","IrregularSeal1","IrregularSeal2","LightningBolt","Heart","PictureFrame","QuadArrow","LeftArrowCallout","RightArrowCallout","UpArrowCallout",
1770cdf0e10cSrcweir /*  80*/	"DownArrowCallout","LeftRightArrowCallout","UpDownArrowCallout","QuadArrowCallout","Bevel","LeftBracket","RightBracket","LeftBrace","RightBrace","LeftUpArrow",
1771cdf0e10cSrcweir /*  90*/	"BentUpArrow","BentArrow","Seal24","StripedRightArrow","NotchedRightArrow","BlockArc","SmileyFace","VerticalScroll","HorizontalScroll","CircularArrow",
1772cdf0e10cSrcweir /* 100*/	"NotchedCircularArrow","UturnArrow","CurvedRightArrow","CurvedLeftArrow","CurvedUpArrow","CurvedDownArrow","CloudCallout","EllipseRibbon","EllipseRibbon2","FlowChartProcess",
1773cdf0e10cSrcweir /* 110*/	"FlowChartDecision","FlowChartInputOutput","FlowChartPredefinedProcess","FlowChartInternalStorage","FlowChartDocument","FlowChartMultidocument","FlowChartTerminator","FlowChartPreparation","FlowChartManualInput","FlowChartManualOperation",
1774cdf0e10cSrcweir /* 120*/	"FlowChartConnector","FlowChartPunchedCard","FlowChartPunchedTape","FlowChartSummingJunction","FlowChartOr","FlowChartCollate","FlowChartSort","FlowChartExtract","FlowChartMerge","FlowChartOfflineStorage",
1775cdf0e10cSrcweir /* 130*/	"FlowChartOnlineStorage","FlowChartMagneticTape","FlowChartMagneticDisk","FlowChartMagneticDrum","FlowChartDisplay","FlowChartDelay","TextPlainText","TextStop","TextTriangle","TextTriangleInverted",
1776cdf0e10cSrcweir /* 140*/	"TextChevron","TextChevronInverted","TextRingInside","TextRingOutside","TextArchUpCurve","TextArchDownCurve","TextCircleCurve","TextButtonCurve","TextArchUpPour","TextArchDownPour",
1777cdf0e10cSrcweir /* 150*/	"TextCirclePour","TextButtonPour","TextCurveUp","TextCurveDown","TextCascadeUp","TextCascadeDown","TextWave1","TextWave2","TextWave3","TextWave4",
1778cdf0e10cSrcweir /* 160*/	"TextInflate","TextDeflate","TextInflateBottom","TextDeflateBottom","TextInflateTop","TextDeflateTop","TextDeflateInflate","TextDeflateInflateDeflate","TextFadeRight","TextFadeLeft",
1779cdf0e10cSrcweir /* 170*/	"TextFadeUp","TextFadeDown","TextSlantUp","TextSlantDown","TextCanUp","TextCanDown","FlowChartAlternateProcess","FlowChartOffpageConnector","Callout90","AccentCallout90",
1780cdf0e10cSrcweir /* 180*/	"BorderCallout90","AccentBorderCallout90","LeftRightUpArrow","Sun","Moon","BracketPair","BracePair","Seal4","DoubleWave","ActionButtonBlank",
1781cdf0e10cSrcweir /* 190*/	"ActionButtonHome","ActionButtonHelp","ActionButtonInformation","ActionButtonForwardNext","ActionButtonBackPrevious","ActionButtonEnd","ActionButtonBeginning","ActionButtonReturn","ActionButtonDocument","ActionButtonSound",
1782cdf0e10cSrcweir /* 200*/	"ActionButtonMovie","HostControl","TextBox","Nil", "???"
1783cdf0e10cSrcweir 	};
1784cdf0e10cSrcweir 	if( 203 < nId )
1785cdf0e10cSrcweir 		nId = 204;
1786cdf0e10cSrcweir 	return aNmArr[ nId ];
1787cdf0e10cSrcweir }
1788cdf0e10cSrcweir 
DumpEscherProp(sal_uInt16 nId,sal_Bool bBid,sal_Bool bComplex,sal_uInt32 nOp,sal_uInt32 & rStreamOffset)1789cdf0e10cSrcweir void DumpEscherProp( sal_uInt16 nId, sal_Bool bBid, sal_Bool bComplex, sal_uInt32 nOp,
1790cdf0e10cSrcweir 						sal_uInt32& rStreamOffset )
1791cdf0e10cSrcweir {
1792cdf0e10cSrcweir 	const char* pRecNm = 0;
1793cdf0e10cSrcweir 	switch( nId )
1794cdf0e10cSrcweir 	{
1795cdf0e10cSrcweir 	case 4:		pRecNm = "DFF_Prop_Rotation"; break;
1796cdf0e10cSrcweir // Protection
1797cdf0e10cSrcweir 	case 119:	pRecNm = "DFF_Prop_LockRotation"; break;
1798cdf0e10cSrcweir 	case 120:	pRecNm = "DFF_Prop_LockAspectRatio"; break;
1799cdf0e10cSrcweir 	case 121:	pRecNm = "DFF_Prop_LockPosition"; break;
1800cdf0e10cSrcweir 	case 122:	pRecNm = "DFF_Prop_LockAgainstSelect"; break;
1801cdf0e10cSrcweir 	case 123:	pRecNm = "DFF_Prop_LockCropping"; break;
1802cdf0e10cSrcweir 	case 124:	pRecNm = "DFF_Prop_LockVertices"; break;
1803cdf0e10cSrcweir 	case 125:	pRecNm = "DFF_Prop_LockText"; break;
1804cdf0e10cSrcweir 	case 126:	pRecNm = "DFF_Prop_LockAdjustHandles"; break;
1805cdf0e10cSrcweir 	case 127:	pRecNm = "DFF_Prop_LockAgainstGrouping"; break;
1806cdf0e10cSrcweir // Text
1807cdf0e10cSrcweir 	case 128:	pRecNm = "DFF_Prop_lTxid"; break;
1808cdf0e10cSrcweir 	case 129:	pRecNm = "DFF_Prop_dxTextLeft"; break;
1809cdf0e10cSrcweir 	case 130:	pRecNm = "DFF_Prop_dyTextTop"; break;
1810cdf0e10cSrcweir 	case 131:	pRecNm = "DFF_Prop_dxTextRight"; break;
1811cdf0e10cSrcweir 	case 132:	pRecNm = "DFF_Prop_dyTextBottom"; break;
1812cdf0e10cSrcweir 	case 133:	pRecNm = "DFF_Prop_WrapText"; break;
1813cdf0e10cSrcweir 	case 134:	pRecNm = "DFF_Prop_scaleText"; break;
1814cdf0e10cSrcweir 	case 135:	pRecNm = "DFF_Prop_anchorText"; break;
1815cdf0e10cSrcweir 	case 136:	pRecNm = "DFF_Prop_txflTextFlow"; break;
1816cdf0e10cSrcweir 	case 137:	pRecNm = "DFF_Prop_cdirFont"; break;
1817cdf0e10cSrcweir 	case 138:	pRecNm = "DFF_Prop_hspNext"; break;
1818cdf0e10cSrcweir 	case 139:	pRecNm = "DFF_Prop_txdir"; break;
1819cdf0e10cSrcweir 	case 187:	pRecNm = "DFF_Prop_SelectText"; break;
1820cdf0e10cSrcweir 	case 188:	pRecNm = "DFF_Prop_AutoTextMargin"; break;
1821cdf0e10cSrcweir 	case 189:	pRecNm = "DFF_Prop_RotateText"; break;
1822cdf0e10cSrcweir 	case 190:	pRecNm = "DFF_Prop_FitShapeToText"; break;
1823cdf0e10cSrcweir 	case 191:	pRecNm = "DFF_Prop_FitTextToShape"; break;
1824cdf0e10cSrcweir // GeoText
1825cdf0e10cSrcweir 	case 192:	pRecNm = "DFF_Prop_gtextUNICODE"; break;
1826cdf0e10cSrcweir 	case 193:	pRecNm = "DFF_Prop_gtextRTF"; break;
1827cdf0e10cSrcweir 	case 194:	pRecNm = "DFF_Prop_gtextAlign"; break;
1828cdf0e10cSrcweir 	case 195:	pRecNm = "DFF_Prop_gtextSize"; break;
1829cdf0e10cSrcweir 	case 196:	pRecNm = "DFF_Prop_gtextSpacing"; break;
1830cdf0e10cSrcweir 	case 197:	pRecNm = "DFF_Prop_gtextFont"; break;
1831cdf0e10cSrcweir 	case 240:	pRecNm = "DFF_Prop_gtextFReverseRows"; break;
1832cdf0e10cSrcweir 	case 241:	pRecNm = "DFF_Prop_fGtext"; break;
1833cdf0e10cSrcweir 	case 242:	pRecNm = "DFF_Prop_gtextFVertical"; break;
1834cdf0e10cSrcweir 	case 243:	pRecNm = "DFF_Prop_gtextFKern"; break;
1835cdf0e10cSrcweir 	case 244:	pRecNm = "DFF_Prop_gtextFTight"; break;
1836cdf0e10cSrcweir 	case 245:	pRecNm = "DFF_Prop_gtextFStretch"; break;
1837cdf0e10cSrcweir 	case 246:	pRecNm = "DFF_Prop_gtextFShrinkFit"; break;
1838cdf0e10cSrcweir 	case 247:	pRecNm = "DFF_Prop_gtextFBestFit"; break;
1839cdf0e10cSrcweir 	case 248:	pRecNm = "DFF_Prop_gtextFNormalize"; break;
1840cdf0e10cSrcweir 	case 249:	pRecNm = "DFF_Prop_gtextFDxMeasure"; break;
1841cdf0e10cSrcweir 	case 250:	pRecNm = "DFF_Prop_gtextFBold"; break;
1842cdf0e10cSrcweir 	case 251:	pRecNm = "DFF_Prop_gtextFItalic"; break;
1843cdf0e10cSrcweir 	case 252:	pRecNm = "DFF_Prop_gtextFUnderline"; break;
1844cdf0e10cSrcweir 	case 253:	pRecNm = "DFF_Prop_gtextFShadow"; break;
1845cdf0e10cSrcweir 	case 254:	pRecNm = "DFF_Prop_gtextFSmallcaps"; break;
1846cdf0e10cSrcweir 	case 255:	pRecNm = "DFF_Prop_gtextFStrikethrough"; break;
1847cdf0e10cSrcweir // Blip
1848cdf0e10cSrcweir 	case 256:	pRecNm = "DFF_Prop_cropFromTop"; break;
1849cdf0e10cSrcweir 	case 257:	pRecNm = "DFF_Prop_cropFromBottom"; break;
1850cdf0e10cSrcweir 	case 258:	pRecNm = "DFF_Prop_cropFromLeft"; break;
1851cdf0e10cSrcweir 	case 259:	pRecNm = "DFF_Prop_cropFromRight"; break;
1852cdf0e10cSrcweir 	case 260:	pRecNm = "DFF_Prop_pib"; break;
1853cdf0e10cSrcweir 	case 261:	pRecNm = "DFF_Prop_pibName"; break;
1854cdf0e10cSrcweir 	case 262:	pRecNm = "DFF_Prop_pibFlags"; break;
1855cdf0e10cSrcweir 	case 263:	pRecNm = "DFF_Prop_pictureTransparent"; break;
1856cdf0e10cSrcweir 	case 264:	pRecNm = "DFF_Prop_pictureContrast"; break;
1857cdf0e10cSrcweir 	case 265:	pRecNm = "DFF_Prop_pictureBrightness"; break;
1858cdf0e10cSrcweir 	case 266:	pRecNm = "DFF_Prop_pictureGamma"; break;
1859cdf0e10cSrcweir 	case 267:	pRecNm = "DFF_Prop_pictureId"; break;
1860cdf0e10cSrcweir 	case 268:	pRecNm = "DFF_Prop_pictureDblCrMod"; break;
1861cdf0e10cSrcweir 	case 269:	pRecNm = "DFF_Prop_pictureFillCrMod"; break;
1862cdf0e10cSrcweir 	case 270:	pRecNm = "DFF_Prop_pictureLineCrMod"; break;
1863cdf0e10cSrcweir 	case 271:	pRecNm = "DFF_Prop_pibPrint"; break;
1864cdf0e10cSrcweir 	case 272:	pRecNm = "DFF_Prop_pibPrintName"; break;
1865cdf0e10cSrcweir 	case 273:	pRecNm = "DFF_Prop_pibPrintFlags"; break;
1866cdf0e10cSrcweir 	case 316:	pRecNm = "DFF_Prop_fNoHitTestPicture"; break;
1867cdf0e10cSrcweir 	case 317:	pRecNm = "DFF_Prop_pictureGray"; break;
1868cdf0e10cSrcweir 	case 318:	pRecNm = "DFF_Prop_pictureBiLevel"; break;
1869cdf0e10cSrcweir 	case 319:	pRecNm = "DFF_Prop_pictureActive"; break;
1870cdf0e10cSrcweir // Geometry
1871cdf0e10cSrcweir 	case 320:	pRecNm = "DFF_Prop_geoLeft"; break;
1872cdf0e10cSrcweir 	case 321:	pRecNm = "DFF_Prop_geoTop"; break;
1873cdf0e10cSrcweir 	case 322:	pRecNm = "DFF_Prop_geoRight"; break;
1874cdf0e10cSrcweir 	case 323:	pRecNm = "DFF_Prop_geoBottom"; break;
1875cdf0e10cSrcweir 	case 324:	pRecNm = "DFF_Prop_shapePath"; break;
1876cdf0e10cSrcweir 	case 325:	pRecNm = "DFF_Prop_pVertices"; break;
1877cdf0e10cSrcweir 	case 326:	pRecNm = "DFF_Prop_pSegmentInfo"; break;
1878cdf0e10cSrcweir 	case 327:	pRecNm = "DFF_Prop_adjustValue"; break;
1879cdf0e10cSrcweir 	case 328:	pRecNm = "DFF_Prop_adjust2Value"; break;
1880cdf0e10cSrcweir 	case 329:	pRecNm = "DFF_Prop_adjust3Value"; break;
1881cdf0e10cSrcweir 	case 330:	pRecNm = "DFF_Prop_adjust4Value"; break;
1882cdf0e10cSrcweir 	case 331:	pRecNm = "DFF_Prop_adjust5Value"; break;
1883cdf0e10cSrcweir 	case 332:	pRecNm = "DFF_Prop_adjust6Value"; break;
1884cdf0e10cSrcweir 	case 333:	pRecNm = "DFF_Prop_adjust7Value"; break;
1885cdf0e10cSrcweir 	case 334:	pRecNm = "DFF_Prop_adjust8Value"; break;
1886cdf0e10cSrcweir 	case 335:	pRecNm = "DFF_Prop_adjust9Value"; break;
1887cdf0e10cSrcweir 	case 336:	pRecNm = "DFF_Prop_adjust10Value"; break;
1888cdf0e10cSrcweir 	case 378:	pRecNm = "DFF_Prop_fShadowOK"; break;
1889cdf0e10cSrcweir 	case 379:	pRecNm = "DFF_Prop_f3DOK"; break;
1890cdf0e10cSrcweir 	case 380:	pRecNm = "DFF_Prop_fLineOK"; break;
1891cdf0e10cSrcweir 	case 381:	pRecNm = "DFF_Prop_fGtextOK"; break;
1892cdf0e10cSrcweir 	case 382:	pRecNm = "DFF_Prop_fFillShadeShapeOK"; break;
1893cdf0e10cSrcweir 	case 383:	pRecNm = "DFF_Prop_fFillOK"; break;
1894cdf0e10cSrcweir // FillStyle
1895cdf0e10cSrcweir 	case 384:	pRecNm = "DFF_Prop_fillType"; break;
1896cdf0e10cSrcweir 	case 385:	pRecNm = "DFF_Prop_fillColor"; break;
1897cdf0e10cSrcweir 	case 386:	pRecNm = "DFF_Prop_fillOpacity"; break;
1898cdf0e10cSrcweir 	case 387:	pRecNm = "DFF_Prop_fillBackColor"; break;
1899cdf0e10cSrcweir 	case 388:	pRecNm = "DFF_Prop_fillBackOpacity"; break;
1900cdf0e10cSrcweir 	case 389:	pRecNm = "DFF_Prop_fillCrMod"; break;
1901cdf0e10cSrcweir 	case 390:	pRecNm = "DFF_Prop_fillBlip"; break;
1902cdf0e10cSrcweir 	case 391:	pRecNm = "DFF_Prop_fillBlipName"; break;
1903cdf0e10cSrcweir 	case 392:	pRecNm = "DFF_Prop_fillBlipFlags"; break;
1904cdf0e10cSrcweir 	case 393:	pRecNm = "DFF_Prop_fillWidth"; break;
1905cdf0e10cSrcweir 	case 394:	pRecNm = "DFF_Prop_fillHeight"; break;
1906cdf0e10cSrcweir 	case 395:	pRecNm = "DFF_Prop_fillAngle"; break;
1907cdf0e10cSrcweir 	case 396:	pRecNm = "DFF_Prop_fillFocus"; break;
1908cdf0e10cSrcweir 	case 397:	pRecNm = "DFF_Prop_fillToLeft"; break;
1909cdf0e10cSrcweir 	case 398:	pRecNm = "DFF_Prop_fillToTop"; break;
1910cdf0e10cSrcweir 	case 399:	pRecNm = "DFF_Prop_fillToRight"; break;
1911cdf0e10cSrcweir 	case 400:	pRecNm = "DFF_Prop_fillToBottom"; break;
1912cdf0e10cSrcweir 	case 401:	pRecNm = "DFF_Prop_fillRectLeft"; break;
1913cdf0e10cSrcweir 	case 402:	pRecNm = "DFF_Prop_fillRectTop"; break;
1914cdf0e10cSrcweir 	case 403:	pRecNm = "DFF_Prop_fillRectRight"; break;
1915cdf0e10cSrcweir 	case 404:	pRecNm = "DFF_Prop_fillRectBottom"; break;
1916cdf0e10cSrcweir 	case 405:	pRecNm = "DFF_Prop_fillDztype"; break;
1917cdf0e10cSrcweir 	case 406:	pRecNm = "DFF_Prop_fillShadePreset"; break;
1918cdf0e10cSrcweir 	case 407:	pRecNm = "DFF_Prop_fillShadeColors"; break;
1919cdf0e10cSrcweir 	case 408:	pRecNm = "DFF_Prop_fillOriginX"; break;
1920cdf0e10cSrcweir 	case 409:	pRecNm = "DFF_Prop_fillOriginY"; break;
1921cdf0e10cSrcweir 	case 410:	pRecNm = "DFF_Prop_fillShapeOriginX"; break;
1922cdf0e10cSrcweir 	case 411:	pRecNm = "DFF_Prop_fillShapeOriginY"; break;
1923cdf0e10cSrcweir 	case 412:	pRecNm = "DFF_Prop_fillShadeType"; break;
1924cdf0e10cSrcweir 	case 443:	pRecNm = "DFF_Prop_fFilled"; break;
1925cdf0e10cSrcweir 	case 444:	pRecNm = "DFF_Prop_fHitTestFill"; break;
1926cdf0e10cSrcweir 	case 445:	pRecNm = "DFF_Prop_fillShape"; break;
1927cdf0e10cSrcweir 	case 446:	pRecNm = "DFF_Prop_fillUseRect"; break;
1928cdf0e10cSrcweir 	case 447:	pRecNm = "DFF_Prop_fNoFillHitTest"; break;
1929cdf0e10cSrcweir // LineStyle
1930cdf0e10cSrcweir 	case 448:	pRecNm = "DFF_Prop_lineColor"; break;
1931cdf0e10cSrcweir 	case 449:	pRecNm = "DFF_Prop_lineOpacity"; break;
1932cdf0e10cSrcweir 	case 450:	pRecNm = "DFF_Prop_lineBackColor"; break;
1933cdf0e10cSrcweir 	case 451:	pRecNm = "DFF_Prop_lineCrMod"; break;
1934cdf0e10cSrcweir 	case 452:	pRecNm = "DFF_Prop_lineType"; break;
1935cdf0e10cSrcweir 	case 453:	pRecNm = "DFF_Prop_lineFillBlip"; break;
1936cdf0e10cSrcweir 	case 454:	pRecNm = "DFF_Prop_lineFillBlipName"; break;
1937cdf0e10cSrcweir 	case 455:	pRecNm = "DFF_Prop_lineFillBlipFlags"; break;
1938cdf0e10cSrcweir 	case 456:	pRecNm = "DFF_Prop_lineFillWidth"; break;
1939cdf0e10cSrcweir 	case 457:	pRecNm = "DFF_Prop_lineFillHeight"; break;
1940cdf0e10cSrcweir 	case 458:	pRecNm = "DFF_Prop_lineFillDztype"; break;
1941cdf0e10cSrcweir 	case 459:	pRecNm = "DFF_Prop_lineWidth"; break;
1942cdf0e10cSrcweir 	case 460:	pRecNm = "DFF_Prop_lineMiterLimit"; break;
1943cdf0e10cSrcweir 	case 461:	pRecNm = "DFF_Prop_lineStyle"; break;
1944cdf0e10cSrcweir 	case 462:	pRecNm = "DFF_Prop_lineDashing"; break;
1945cdf0e10cSrcweir 	case 463:	pRecNm = "DFF_Prop_lineDashStyle"; break;
1946cdf0e10cSrcweir 	case 464:	pRecNm = "DFF_Prop_lineStartArrowhead"; break;
1947cdf0e10cSrcweir 	case 465:	pRecNm = "DFF_Prop_lineEndArrowhead"; break;
1948cdf0e10cSrcweir 	case 466:	pRecNm = "DFF_Prop_lineStartArrowWidth"; break;
1949cdf0e10cSrcweir 	case 467:	pRecNm = "DFF_Prop_lineStartArrowLength"; break;
1950cdf0e10cSrcweir 	case 468:	pRecNm = "DFF_Prop_lineEndArrowWidth"; break;
1951cdf0e10cSrcweir 	case 469:	pRecNm = "DFF_Prop_lineEndArrowLength"; break;
1952cdf0e10cSrcweir 	case 470:	pRecNm = "DFF_Prop_lineJoinStyle"; break;
1953cdf0e10cSrcweir 	case 471:	pRecNm = "DFF_Prop_lineEndCapStyle"; break;
1954cdf0e10cSrcweir 	case 507:	pRecNm = "DFF_Prop_fArrowheadsOK"; break;
1955cdf0e10cSrcweir 	case 508:	pRecNm = "DFF_Prop_fLine"; break;
1956cdf0e10cSrcweir 	case 509:	pRecNm = "DFF_Prop_fHitTestLine"; break;
1957cdf0e10cSrcweir 	case 510:	pRecNm = "DFF_Prop_lineFillShape"; break;
1958cdf0e10cSrcweir 	case 511:	pRecNm = "DFF_Prop_fNoLineDrawDash"; break;
1959cdf0e10cSrcweir // ShadowStyle
1960cdf0e10cSrcweir 	case 512:	pRecNm = "DFF_Prop_shadowType"; break;
1961cdf0e10cSrcweir 	case 513:	pRecNm = "DFF_Prop_shadowColor"; break;
1962cdf0e10cSrcweir 	case 514:	pRecNm = "DFF_Prop_shadowHighlight"; break;
1963cdf0e10cSrcweir 	case 515:	pRecNm = "DFF_Prop_shadowCrMod"; break;
1964cdf0e10cSrcweir 	case 516:	pRecNm = "DFF_Prop_shadowOpacity"; break;
1965cdf0e10cSrcweir 	case 517:	pRecNm = "DFF_Prop_shadowOffsetX"; break;
1966cdf0e10cSrcweir 	case 518:	pRecNm = "DFF_Prop_shadowOffsetY"; break;
1967cdf0e10cSrcweir 	case 519:	pRecNm = "DFF_Prop_shadowSecondOffsetX"; break;
1968cdf0e10cSrcweir 	case 520:	pRecNm = "DFF_Prop_shadowSecondOffsetY"; break;
1969cdf0e10cSrcweir 	case 521:	pRecNm = "DFF_Prop_shadowScaleXToX"; break;
1970cdf0e10cSrcweir 	case 522:	pRecNm = "DFF_Prop_shadowScaleYToX"; break;
1971cdf0e10cSrcweir 	case 523:	pRecNm = "DFF_Prop_shadowScaleXToY"; break;
1972cdf0e10cSrcweir 	case 524:	pRecNm = "DFF_Prop_shadowScaleYToY"; break;
1973cdf0e10cSrcweir 	case 525:	pRecNm = "DFF_Prop_shadowPerspectiveX"; break;
1974cdf0e10cSrcweir 	case 526:	pRecNm = "DFF_Prop_shadowPerspectiveY"; break;
1975cdf0e10cSrcweir 	case 527:	pRecNm = "DFF_Prop_shadowWeight"; break;
1976cdf0e10cSrcweir 	case 528:	pRecNm = "DFF_Prop_shadowOriginX"; break;
1977cdf0e10cSrcweir 	case 529:	pRecNm = "DFF_Prop_shadowOriginY"; break;
1978cdf0e10cSrcweir 	case 574:	pRecNm = "DFF_Prop_fShadow"; break;
1979cdf0e10cSrcweir 	case 575:	pRecNm = "DFF_Prop_fshadowObscured"; break;
1980cdf0e10cSrcweir // PerspectiveStyle
1981cdf0e10cSrcweir 	case 576:	pRecNm = "DFF_Prop_perspectiveType"; break;
1982cdf0e10cSrcweir 	case 577:	pRecNm = "DFF_Prop_perspectiveOffsetX"; break;
1983cdf0e10cSrcweir 	case 578:	pRecNm = "DFF_Prop_perspectiveOffsetY"; break;
1984cdf0e10cSrcweir 	case 579:	pRecNm = "DFF_Prop_perspectiveScaleXToX"; break;
1985cdf0e10cSrcweir 	case 580:	pRecNm = "DFF_Prop_perspectiveScaleYToX"; break;
1986cdf0e10cSrcweir 	case 581:	pRecNm = "DFF_Prop_perspectiveScaleXToY"; break;
1987cdf0e10cSrcweir 	case 582:	pRecNm = "DFF_Prop_perspectiveScaleYToY"; break;
1988cdf0e10cSrcweir 	case 583:	pRecNm = "DFF_Prop_perspectivePerspectiveX"; break;
1989cdf0e10cSrcweir 	case 584:	pRecNm = "DFF_Prop_perspectivePerspectiveY"; break;
1990cdf0e10cSrcweir 	case 585:	pRecNm = "DFF_Prop_perspectiveWeight"; break;
1991cdf0e10cSrcweir 	case 586:	pRecNm = "DFF_Prop_perspectiveOriginX"; break;
1992cdf0e10cSrcweir 	case 587:	pRecNm = "DFF_Prop_perspectiveOriginY"; break;
1993cdf0e10cSrcweir 	case 639:	pRecNm = "DFF_Prop_fPerspective"; break;
1994cdf0e10cSrcweir // 3D Object
1995cdf0e10cSrcweir 	case 640:	pRecNm = "DFF_Prop_c3DSpecularAmt"; break;
1996cdf0e10cSrcweir 	case 641:	pRecNm = "DFF_Prop_c3DDiffuseAmt"; break;
1997cdf0e10cSrcweir 	case 642:	pRecNm = "DFF_Prop_c3DShininess"; break;
1998cdf0e10cSrcweir 	case 643:	pRecNm = "DFF_Prop_c3DEdgeThickness"; break;
1999cdf0e10cSrcweir 	case 644:	pRecNm = "DFF_Prop_c3DExtrudeForward"; break;
2000cdf0e10cSrcweir 	case 645:	pRecNm = "DFF_Prop_c3DExtrudeBackward"; break;
2001cdf0e10cSrcweir 	case 646:	pRecNm = "DFF_Prop_c3DExtrudePlane"; break;
2002cdf0e10cSrcweir 	case 647:	pRecNm = "DFF_Prop_c3DExtrusionColor"; break;
2003cdf0e10cSrcweir 	case 648:	pRecNm = "DFF_Prop_c3DCrMod"; break;
2004cdf0e10cSrcweir 	case 700:	pRecNm = "DFF_Prop_f3D"; break;
2005cdf0e10cSrcweir 	case 701:	pRecNm = "DFF_Prop_fc3DMetallic"; break;
2006cdf0e10cSrcweir 	case 702:	pRecNm = "DFF_Prop_fc3DUseExtrusionColor"; break;
2007cdf0e10cSrcweir 	case 703:	pRecNm = "DFF_Prop_fc3DLightFace"; break;
2008cdf0e10cSrcweir // 3D Style
2009cdf0e10cSrcweir 	case 704:	pRecNm = "DFF_Prop_c3DYRotationAngle"; break;
2010cdf0e10cSrcweir 	case 705:	pRecNm = "DFF_Prop_c3DXRotationAngle"; break;
2011cdf0e10cSrcweir 	case 706:	pRecNm = "DFF_Prop_c3DRotationAxisX"; break;
2012cdf0e10cSrcweir 	case 707:	pRecNm = "DFF_Prop_c3DRotationAxisY"; break;
2013cdf0e10cSrcweir 	case 708:	pRecNm = "DFF_Prop_c3DRotationAxisZ"; break;
2014cdf0e10cSrcweir 	case 709:	pRecNm = "DFF_Prop_c3DRotationAngle"; break;
2015cdf0e10cSrcweir 	case 710:	pRecNm = "DFF_Prop_c3DRotationCenterX"; break;
2016cdf0e10cSrcweir 	case 711:	pRecNm = "DFF_Prop_c3DRotationCenterY"; break;
2017cdf0e10cSrcweir 	case 712:	pRecNm = "DFF_Prop_c3DRotationCenterZ"; break;
2018cdf0e10cSrcweir 	case 713:	pRecNm = "DFF_Prop_c3DRenderMode"; break;
2019cdf0e10cSrcweir 	case 714:	pRecNm = "DFF_Prop_c3DTolerance"; break;
2020cdf0e10cSrcweir 	case 715:	pRecNm = "DFF_Prop_c3DXViewpoint"; break;
2021cdf0e10cSrcweir 	case 716:	pRecNm = "DFF_Prop_c3DYViewpoint"; break;
2022cdf0e10cSrcweir 	case 717:	pRecNm = "DFF_Prop_c3DZViewpoint"; break;
2023cdf0e10cSrcweir 	case 718:	pRecNm = "DFF_Prop_c3DOriginX"; break;
2024cdf0e10cSrcweir 	case 719:	pRecNm = "DFF_Prop_c3DOriginY"; break;
2025cdf0e10cSrcweir 	case 720:	pRecNm = "DFF_Prop_c3DSkewAngle"; break;
2026cdf0e10cSrcweir 	case 721:	pRecNm = "DFF_Prop_c3DSkewAmount"; break;
2027cdf0e10cSrcweir 	case 722:	pRecNm = "DFF_Prop_c3DAmbientIntensity"; break;
2028cdf0e10cSrcweir 	case 723:	pRecNm = "DFF_Prop_c3DKeyX"; break;
2029cdf0e10cSrcweir 	case 724:	pRecNm = "DFF_Prop_c3DKeyY"; break;
2030cdf0e10cSrcweir 	case 725:	pRecNm = "DFF_Prop_c3DKeyZ"; break;
2031cdf0e10cSrcweir 	case 726:	pRecNm = "DFF_Prop_c3DKeyIntensity"; break;
2032cdf0e10cSrcweir 	case 727:	pRecNm = "DFF_Prop_c3DFillX"; break;
2033cdf0e10cSrcweir 	case 728:	pRecNm = "DFF_Prop_c3DFillY"; break;
2034cdf0e10cSrcweir 	case 729:	pRecNm = "DFF_Prop_c3DFillZ"; break;
2035cdf0e10cSrcweir 	case 730:	pRecNm = "DFF_Prop_c3DFillIntensity"; break;
2036cdf0e10cSrcweir 	case 763:	pRecNm = "DFF_Prop_fc3DConstrainRotation"; break;
2037cdf0e10cSrcweir 	case 764:	pRecNm = "DFF_Prop_fc3DRotationCenterAuto"; break;
2038cdf0e10cSrcweir 	case 765:	pRecNm = "DFF_Prop_fc3DParallel"; break;
2039cdf0e10cSrcweir 	case 766:	pRecNm = "DFF_Prop_fc3DKeyHarsh"; break;
2040cdf0e10cSrcweir 	case 767:	pRecNm = "DFF_Prop_fc3DFillHarsh"; break;
2041cdf0e10cSrcweir // Shape
2042cdf0e10cSrcweir 	case 769:	pRecNm = "DFF_Prop_hspMaster"; break;
2043cdf0e10cSrcweir 	case 771:	pRecNm = "DFF_Prop_cxstyle"; break;
2044cdf0e10cSrcweir 	case 772:	pRecNm = "DFF_Prop_bWMode"; break;
2045cdf0e10cSrcweir 	case 773:	pRecNm = "DFF_Prop_bWModePureBW"; break;
2046cdf0e10cSrcweir 	case 774:	pRecNm = "DFF_Prop_bWModeBW"; break;
2047cdf0e10cSrcweir 	case 826:	pRecNm = "DFF_Prop_fOleIcon"; break;
2048cdf0e10cSrcweir 	case 827:	pRecNm = "DFF_Prop_fPreferRelativeResize"; break;
2049cdf0e10cSrcweir 	case 828:	pRecNm = "DFF_Prop_fLockShapeType"; break;
2050cdf0e10cSrcweir 	case 830:	pRecNm = "DFF_Prop_fDeleteAttachedObject"; break;
2051cdf0e10cSrcweir 	case 831:	pRecNm = "DFF_Prop_fBackground"; break;
2052cdf0e10cSrcweir 
2053cdf0e10cSrcweir // Callout
2054cdf0e10cSrcweir 	case 832:	pRecNm = "DFF_Prop_spcot"; break;
2055cdf0e10cSrcweir 	case 833:	pRecNm = "DFF_Prop_dxyCalloutGap"; break;
2056cdf0e10cSrcweir 	case 834:	pRecNm = "DFF_Prop_spcoa"; break;
2057cdf0e10cSrcweir 	case 835:	pRecNm = "DFF_Prop_spcod"; break;
2058cdf0e10cSrcweir 	case 836:	pRecNm = "DFF_Prop_dxyCalloutDropSpecified"; break;
2059cdf0e10cSrcweir 	case 837:	pRecNm = "DFF_Prop_dxyCalloutLengthSpecified"; break;
2060cdf0e10cSrcweir 	case 889:	pRecNm = "DFF_Prop_fCallout"; break;
2061cdf0e10cSrcweir 	case 890:	pRecNm = "DFF_Prop_fCalloutAccentBar"; break;
2062cdf0e10cSrcweir 	case 891:	pRecNm = "DFF_Prop_fCalloutTextBorder"; break;
2063cdf0e10cSrcweir 	case 892:	pRecNm = "DFF_Prop_fCalloutMinusX"; break;
2064cdf0e10cSrcweir 	case 893:	pRecNm = "DFF_Prop_fCalloutMinusY"; break;
2065cdf0e10cSrcweir 	case 894:	pRecNm = "DFF_Prop_fCalloutDropAuto"; break;
2066cdf0e10cSrcweir 	case 895:	pRecNm = "DFF_Prop_fCalloutLengthSpecified"; break;
2067cdf0e10cSrcweir 
2068cdf0e10cSrcweir // GroupShape
2069cdf0e10cSrcweir 	case 896:	pRecNm = "DFF_Prop_wzName"; break;
2070cdf0e10cSrcweir 	case 897:	pRecNm = "DFF_Prop_wzDescription"; break;
2071cdf0e10cSrcweir 	case 898:	pRecNm = "DFF_Prop_pihlShape"; break;
2072cdf0e10cSrcweir 	case 899:	pRecNm = "DFF_Prop_pWrapPolygonVertices"; break;
2073cdf0e10cSrcweir 	case 900:	pRecNm = "DFF_Prop_dxWrapDistLeft"; break;
2074cdf0e10cSrcweir 	case 901:	pRecNm = "DFF_Prop_dyWrapDistTop"; break;
2075cdf0e10cSrcweir 	case 902:	pRecNm = "DFF_Prop_dxWrapDistRight"; break;
2076cdf0e10cSrcweir 	case 903:	pRecNm = "DFF_Prop_dyWrapDistBottom"; break;
2077cdf0e10cSrcweir 	case 904:	pRecNm = "DFF_Prop_lidRegroup"; break;
2078cdf0e10cSrcweir 	case 953:	pRecNm = "DFF_Prop_fEditedWrap"; break;
2079cdf0e10cSrcweir 	case 954:	pRecNm = "DFF_Prop_fBehindDocument"; break;
2080cdf0e10cSrcweir 	case 955:	pRecNm = "DFF_Prop_fOnDblClickNotify"; break;
2081cdf0e10cSrcweir 	case 956:	pRecNm = "DFF_Prop_fIsButton"; break;
2082cdf0e10cSrcweir 	case 957:	pRecNm = "DFF_Prop_fOneD"; break;
2083cdf0e10cSrcweir 	case 958:	pRecNm = "DFF_Prop_fHidden"; break;
2084cdf0e10cSrcweir 	case 959:	pRecNm = "DFF_Prop_fPrint"; break;
2085cdf0e10cSrcweir 	}
2086cdf0e10cSrcweir 
2087cdf0e10cSrcweir 	*pOut << "      " << indent1 << ' ';
2088cdf0e10cSrcweir 	if( pRecNm )
2089cdf0e10cSrcweir 		*pOut << pRecNm;
2090cdf0e10cSrcweir 	else
2091cdf0e10cSrcweir 		*pOut << "Prop" ;
2092cdf0e10cSrcweir 
2093cdf0e10cSrcweir 	*pOut 	<< " Id: " << dec << nId << " (=0x" << hex << nId << ')';
2094cdf0e10cSrcweir 	if( bBid )
2095cdf0e10cSrcweir 		*pOut << " Bid: 0x" << (sal_uInt16)bBid;
2096cdf0e10cSrcweir 
2097cdf0e10cSrcweir 	if( bComplex )
2098cdf0e10cSrcweir 	{
2099cdf0e10cSrcweir 		*pOut << " Cmpl: 0x" << (sal_uInt16)bComplex;
2100cdf0e10cSrcweir 		// ....
2101cdf0e10cSrcweir 		rStreamOffset += nOp;
2102cdf0e10cSrcweir 	}
2103cdf0e10cSrcweir //	else
2104cdf0e10cSrcweir 		*pOut << " op: 0x" << nOp;
2105cdf0e10cSrcweir 
2106cdf0e10cSrcweir 	*pOut << dec << endl1;
2107cdf0e10cSrcweir }
2108cdf0e10cSrcweir 
DumpEscherRec(sal_uLong nPos,sal_uInt8 nVer,sal_uInt16 nInst,sal_uInt16 nFbt,sal_uInt32 nLength)2109cdf0e10cSrcweir void DumpEscherRec( sal_uLong nPos, sal_uInt8 nVer, sal_uInt16 nInst,
2110cdf0e10cSrcweir 					sal_uInt16 nFbt, sal_uInt32 nLength )
2111cdf0e10cSrcweir {
2112cdf0e10cSrcweir 	const char* pRecNm = 0;
2113cdf0e10cSrcweir 	switch( nFbt )
2114cdf0e10cSrcweir 	{
2115cdf0e10cSrcweir 	case 0xF000:	pRecNm = "DFF_msofbtDggContainer"; break;
2116cdf0e10cSrcweir 	case 0xF006:	pRecNm = "DFF_msofbtDgg"; break;
2117cdf0e10cSrcweir 	case 0xF016:	pRecNm = "DFF_msofbtCLSID"; break;
2118cdf0e10cSrcweir 	case 0xF00B:	pRecNm = "DFF_msofbtOPT"; break;
2119cdf0e10cSrcweir 	case 0xF11A:	pRecNm = "DFF_msofbtColorMRU"; break;
2120cdf0e10cSrcweir 	case 0xF11E:	pRecNm = "DFF_msofbtSplitMenuColors"; break;
2121cdf0e10cSrcweir 	case 0xF001:	pRecNm = "DFF_msofbtBstoreContainer"; break;
2122cdf0e10cSrcweir 	case 0xF007:	pRecNm = "DFF_msofbtBSE"; break;
2123cdf0e10cSrcweir 	case 0xF018:	pRecNm = "DFF_msofbtBlipFirst"; break;
2124cdf0e10cSrcweir 	case 0xF117:	pRecNm = "DFF_msofbtBlipLast"; break;
2125cdf0e10cSrcweir 	case 0xF002:	pRecNm = "DFF_msofbtDgContainer"; break;
2126cdf0e10cSrcweir 	case 0xF008:	pRecNm = "DFF_msofbtDg"; break;
2127cdf0e10cSrcweir 	case 0xF118:	pRecNm = "DFF_msofbtRegroupItems"; break;
2128cdf0e10cSrcweir 	case 0xF120:	pRecNm = "DFF_msofbtColorScheme"; break;
2129cdf0e10cSrcweir 	case 0xF003:	pRecNm = "DFF_msofbtSpgrContainer"; break;
2130cdf0e10cSrcweir 	case 0xF004:	pRecNm = "DFF_msofbtSpContainer"; break;
2131cdf0e10cSrcweir 	case 0xF009:	pRecNm = "DFF_msofbtSpgr"; break;
2132cdf0e10cSrcweir 	case 0xF00A:	pRecNm = "DFF_msofbtSp"; break;
2133cdf0e10cSrcweir 	case 0xF00C:	pRecNm = "DFF_msofbtTextbox"; break;
2134cdf0e10cSrcweir 	case 0xF00D:	pRecNm = "DFF_msofbtClientTextbox"; break;
2135cdf0e10cSrcweir 	case 0xF00E:	pRecNm = "DFF_msofbtAnchor"; break;
2136cdf0e10cSrcweir 	case 0xF00F:	pRecNm = "DFF_msofbtChildAnchor"; break;
2137cdf0e10cSrcweir 	case 0xF010:	pRecNm = "DFF_msofbtClientAnchor"; break;
2138cdf0e10cSrcweir 	case 0xF011:	pRecNm = "DFF_msofbtClientData"; break;
2139cdf0e10cSrcweir 	case 0xF11F:	pRecNm = "DFF_msofbtOleObject"; break;
2140cdf0e10cSrcweir 	case 0xF11D:	pRecNm = "DFF_msofbtDeletedPspl"; break;
2141cdf0e10cSrcweir 	case 0xF005:	pRecNm = "DFF_msofbtSolverContainer"; break;
2142cdf0e10cSrcweir 	case 0xF012:	pRecNm = "DFF_msofbtConnectorRule"; break;
2143cdf0e10cSrcweir 	case 0xF013:	pRecNm = "DFF_msofbtAlignRule"; break;
2144cdf0e10cSrcweir 	case 0xF014:	pRecNm = "DFF_msofbtArcRule"; break;
2145cdf0e10cSrcweir 	case 0xF015:	pRecNm = "DFF_msofbtClientRule"; break;
2146cdf0e10cSrcweir 	case 0xF017:	pRecNm = "DFF_msofbtCalloutRule"; break;
2147cdf0e10cSrcweir 	case 0xF122:	pRecNm = "DFF_msofbtUDefProp"; break;
2148cdf0e10cSrcweir 	}
2149cdf0e10cSrcweir 
2150cdf0e10cSrcweir 	*pOut << hex6 << nPos << indent1;
2151cdf0e10cSrcweir 	if( pRecNm )
2152cdf0e10cSrcweir 		*pOut << pRecNm;
2153cdf0e10cSrcweir 	else
2154cdf0e10cSrcweir 		*pOut << "Record:";
2155cdf0e10cSrcweir 	*pOut << " Id: 0x" << hex << nFbt << " Instance: 0x" << nInst
2156cdf0e10cSrcweir 		  << " Version: 0x" << (sal_uInt16)nVer << " Laenge: 0x" << nLength
2157cdf0e10cSrcweir 		  << dec << endl1;
2158cdf0e10cSrcweir 
2159cdf0e10cSrcweir 	switch( nFbt )
2160cdf0e10cSrcweir 	{
2161cdf0e10cSrcweir 	case 0xf00b:		// DFF_msofbtOPT
2162cdf0e10cSrcweir 		{
2163cdf0e10cSrcweir 			sal_uInt16 nId; sal_uInt32 nOp, nStreamOffset = nInst * 6;
2164cdf0e10cSrcweir 			sal_Bool bBid, bComplex;
2165cdf0e10cSrcweir 			for( sal_uInt16 n = 0; n < nInst; ++n )
2166cdf0e10cSrcweir 			{
2167cdf0e10cSrcweir 				if( !WW8ReadUINT16( *xTableStream, nId ) ||
2168cdf0e10cSrcweir 					!WW8ReadUINT32( *xTableStream, nOp ))
2169cdf0e10cSrcweir 					break;
2170cdf0e10cSrcweir 				bBid = ( nId >> 14 ) & 1;
2171cdf0e10cSrcweir 				bComplex = ( nId >> 15 ) & 1;
2172cdf0e10cSrcweir 				nId &= 0x3fff;
2173cdf0e10cSrcweir 
2174cdf0e10cSrcweir 				::DumpEscherProp( nId, bBid, bComplex, nOp, nStreamOffset );
2175cdf0e10cSrcweir 			}
2176cdf0e10cSrcweir 		}
2177cdf0e10cSrcweir 		break;
2178cdf0e10cSrcweir 
2179cdf0e10cSrcweir 	case 0xF00d:		// DFF_msofbtClientTextbox
2180cdf0e10cSrcweir 	case 0xF010:		// DFF_msofbtClientAnchor
2181cdf0e10cSrcweir 	case 0xF011:		// DFF_msofbtClientData
2182cdf0e10cSrcweir 		{
2183cdf0e10cSrcweir 			sal_uInt32 nData;
2184cdf0e10cSrcweir 			if( 4 == nLength && WW8ReadUINT32( *xTableStream, nData ))
2185cdf0e10cSrcweir 				*pOut << "      " << indent1 << " Data: "
2186cdf0e10cSrcweir 					  << hex << nData << dec << endl1;
2187cdf0e10cSrcweir 		}
2188cdf0e10cSrcweir 		break;
2189cdf0e10cSrcweir 
2190cdf0e10cSrcweir 	case 0xf00a:		// DFF_msofbtSp
2191cdf0e10cSrcweir 		{
2192cdf0e10cSrcweir 			sal_uInt32 nId, nData;
2193cdf0e10cSrcweir 			if( WW8ReadUINT32( *xTableStream, nId ) &&
2194cdf0e10cSrcweir 				WW8ReadUINT32( *xTableStream, nData ))
2195cdf0e10cSrcweir 			{
2196cdf0e10cSrcweir 				*pOut << "      " << indent1 << " \""
2197cdf0e10cSrcweir 					  << _GetShapeTypeNm( nInst )
2198cdf0e10cSrcweir 					  << "\" Id: 0x" << hex << nId
2199cdf0e10cSrcweir 					  << " Flags: 0x" << nData << dec << endl1;
2200cdf0e10cSrcweir 			}
2201cdf0e10cSrcweir 		}
2202cdf0e10cSrcweir 		break;
2203cdf0e10cSrcweir 
2204cdf0e10cSrcweir 	case 0xf009: 		// DFF_msofbtSpgr
2205cdf0e10cSrcweir 	case 0xf00f: 		// DFF_msofbtChildAnchor
2206cdf0e10cSrcweir 		{
2207cdf0e10cSrcweir 			sal_uInt32 nL, nT, nR, nB;
2208cdf0e10cSrcweir 			if( WW8ReadUINT32( *xTableStream, nL ) &&
2209cdf0e10cSrcweir 				WW8ReadUINT32( *xTableStream, nT ) &&
2210cdf0e10cSrcweir 				WW8ReadUINT32( *xTableStream, nR ) &&
2211cdf0e10cSrcweir 				WW8ReadUINT32( *xTableStream, nB ) )
2212cdf0e10cSrcweir 			{
2213cdf0e10cSrcweir 				*pOut << "      " << indent1 << " Rect: (L/T/R/B): " << dec
2214cdf0e10cSrcweir 					  << nL << '/' << nT << '/' << nR << '/' << nB << endl;
2215cdf0e10cSrcweir 			}
2216cdf0e10cSrcweir 		}
2217cdf0e10cSrcweir 		break;
2218cdf0e10cSrcweir 
2219cdf0e10cSrcweir 	case 0xf006:    //ESCHER_Dgg
2220cdf0e10cSrcweir 		{
2221cdf0e10cSrcweir 			sal_uInt32 spidMax, 	// The current maximum shape ID
2222cdf0e10cSrcweir 				   cidcl,		// The number of ID clusters (FIDCLs)
2223cdf0e10cSrcweir 				   cspSaved,	// The total number of shapes saved
2224cdf0e10cSrcweir 				 				// (including deleted shapes, if undo
2225cdf0e10cSrcweir 				 				// information was saved)
2226cdf0e10cSrcweir 				   cdgSaved;	// The total number of drawings saved
2227cdf0e10cSrcweir 
2228cdf0e10cSrcweir 			if( WW8ReadUINT32( *xTableStream, spidMax ) &&
2229cdf0e10cSrcweir 				WW8ReadUINT32( *xTableStream, cidcl ) &&
2230cdf0e10cSrcweir 				WW8ReadUINT32( *xTableStream, cspSaved ) &&
2231cdf0e10cSrcweir 				WW8ReadUINT32( *xTableStream, cdgSaved ))
2232cdf0e10cSrcweir 			{
2233cdf0e10cSrcweir 				*pOut << "      " << indent1 << " " << hex
2234cdf0e10cSrcweir 					  << " spidMax: 0x" << spidMax
2235cdf0e10cSrcweir 					  << " cidcl: 0x" << cidcl
2236cdf0e10cSrcweir 					  << " cspSaved: 0x" << cspSaved
2237cdf0e10cSrcweir 					  << " cdgSaved: 0x" << cdgSaved
2238cdf0e10cSrcweir 					  << dec << endl1;
2239cdf0e10cSrcweir 
2240cdf0e10cSrcweir 
2241cdf0e10cSrcweir 				sal_uInt32 dgid,    // DG owning the SPIDs in this cluster
2242cdf0e10cSrcweir 	   				   cspidCur;  // number of SPIDs used so far
2243cdf0e10cSrcweir 
2244cdf0e10cSrcweir 				for( sal_uInt32 n = 1; n < cidcl; ++n )
2245cdf0e10cSrcweir 				{
2246cdf0e10cSrcweir 					if( !WW8ReadUINT32( *xTableStream, dgid ) ||
2247cdf0e10cSrcweir 						!WW8ReadUINT32( *xTableStream, cspidCur ))
2248cdf0e10cSrcweir 						break;
2249cdf0e10cSrcweir 
2250cdf0e10cSrcweir 					*pOut << "      " << indent1 << "  " << hex
2251cdf0e10cSrcweir 						  << " dgid: 0x" << dgid
2252cdf0e10cSrcweir 						  << " cspidCur: 0x" << cspidCur
2253cdf0e10cSrcweir 						  << dec << endl1;
2254cdf0e10cSrcweir 				}
2255cdf0e10cSrcweir 			}
2256cdf0e10cSrcweir 		}
2257cdf0e10cSrcweir 		break;
2258cdf0e10cSrcweir 
2259cdf0e10cSrcweir 	case 0xF122:
2260cdf0e10cSrcweir 		{
2261cdf0e10cSrcweir 			if( 3 < nLength )
2262cdf0e10cSrcweir 			{
2263cdf0e10cSrcweir 				*pOut << "      " << indent1 << " Data:" << hex;
2264cdf0e10cSrcweir 				sal_uInt8 nParam;
2265cdf0e10cSrcweir 				for( sal_uInt32 n = 0; n < nLength; ++n )
2266cdf0e10cSrcweir 				{
2267cdf0e10cSrcweir 					if( !WW8ReadBYTE( *xTableStream, nParam ) )
2268cdf0e10cSrcweir 						break;
2269cdf0e10cSrcweir 
2270cdf0e10cSrcweir 					sal_uInt16 nHexParam = nParam;
2271cdf0e10cSrcweir 					*pOut << " 0x" << nHexParam;
2272cdf0e10cSrcweir 				}
2273cdf0e10cSrcweir 				*pOut << dec << endl1;
2274cdf0e10cSrcweir 			}
2275cdf0e10cSrcweir 		}
2276cdf0e10cSrcweir 		break;
2277cdf0e10cSrcweir 
2278cdf0e10cSrcweir 	case 0xF016:	//ESCHER_CLSID
2279cdf0e10cSrcweir 	case 0xF11A:	//ESCHER_ColorMRU
2280cdf0e10cSrcweir 	case 0xF11E:	//ESCHER_SplitMenuColors
2281cdf0e10cSrcweir //	case 0xF001:	//ESCHER_BstoreContainer
2282cdf0e10cSrcweir 	case 0xF007:	//ESCHER_BSE
2283cdf0e10cSrcweir 	case 0xF018:	//ESCHER_BlipFirst
2284cdf0e10cSrcweir 	case 0xF117:	//ESCHER_BlipLast
2285cdf0e10cSrcweir 	case 0xF118:	//ESCHER_RegroupItems
2286cdf0e10cSrcweir 	case 0xF120:	//ESCHER_ColorScheme
2287cdf0e10cSrcweir 	case 0xF00C:	//ESCHER_Textbox
2288cdf0e10cSrcweir 	case 0xF00E:	//ESCHER_Anchor
2289cdf0e10cSrcweir 	case 0xF11F:	//ESCHER_OleObject
2290cdf0e10cSrcweir 	case 0xF11D:	//ESCHER_DeletedPspl
2291cdf0e10cSrcweir 	case 0xF005:	//ESCHER_SolverContainer
2292cdf0e10cSrcweir 	case 0xF012:	//ESCHER_ConnectorRule
2293cdf0e10cSrcweir 	case 0xF013:	//ESCHER_AlignRule
2294cdf0e10cSrcweir 	case 0xF014:	//ESCHER_ArcRule
2295cdf0e10cSrcweir 	case 0xF015:	//ESCHER_ClientRule
2296cdf0e10cSrcweir 	case 0xF017:	//ESCHER_CalloutRule
2297cdf0e10cSrcweir 	case 0xF119:	//ESCHER_Selection
2298cdf0e10cSrcweir 	case 0xf008:    //ESCHER_Dg
2299cdf0e10cSrcweir 		{
2300cdf0e10cSrcweir 			int nCnt = 128;
2301cdf0e10cSrcweir 			while( nLength )
2302cdf0e10cSrcweir 			{
2303cdf0e10cSrcweir 				if( 128 == nCnt || 16 == ++nCnt )
2304cdf0e10cSrcweir 				{
2305cdf0e10cSrcweir 					if( 128 != nCnt )
2306cdf0e10cSrcweir 						*pOut << endl1;
2307cdf0e10cSrcweir 					*pOut << "      " << indent1 << " Data: ";
2308cdf0e10cSrcweir 					nCnt = 0;
2309cdf0e10cSrcweir 				}
2310cdf0e10cSrcweir 
2311cdf0e10cSrcweir 				static char __READONLY_DATA sHex[17] = { "0123456789abcdef" };
2312cdf0e10cSrcweir 				sal_uInt8 c;
2313cdf0e10cSrcweir 				*xTableStream >> c;
2314cdf0e10cSrcweir 				*pOut << sHex[ ( c & 0xf0 ) >> 4 ] << sHex[ c & 0x0f ] << ' ';
2315cdf0e10cSrcweir 				--nLength;
2316cdf0e10cSrcweir 			}
2317cdf0e10cSrcweir 			*pOut << dec << endl1;
2318cdf0e10cSrcweir 		}
2319cdf0e10cSrcweir 		break;
2320cdf0e10cSrcweir 	}
2321cdf0e10cSrcweir 
2322cdf0e10cSrcweir 
2323cdf0e10cSrcweir }
2324cdf0e10cSrcweir 
2325cdf0e10cSrcweir 
DumpEscherRecs(sal_uLong nPos,sal_uInt32 nLength)2326cdf0e10cSrcweir void DumpEscherRecs( sal_uLong nPos, sal_uInt32 nLength )
2327cdf0e10cSrcweir {
2328cdf0e10cSrcweir 	begin( *pOut, *xTableStream ) << endl1;
2329cdf0e10cSrcweir 
2330cdf0e10cSrcweir 	sal_uInt16 nOldFbt = 0;
2331cdf0e10cSrcweir 	sal_uLong nReadLen = 0;
2332cdf0e10cSrcweir 	while( nReadLen < nLength )
2333cdf0e10cSrcweir 	{
2334cdf0e10cSrcweir 		sal_uInt8 nVer;
2335cdf0e10cSrcweir 		sal_uInt16 nInst, nFbt;
2336cdf0e10cSrcweir 		sal_uInt32 nRecLen;
2337cdf0e10cSrcweir 
2338cdf0e10cSrcweir 		if( !::ReadEsherRec( *xTableStream, nVer, nInst, nFbt, nRecLen ))
2339cdf0e10cSrcweir 			break;
2340cdf0e10cSrcweir 
2341cdf0e10cSrcweir 		if( (0xf000 > nFbt) )//|| (0xf122 < nFbt) )
2342cdf0e10cSrcweir 		{
2343cdf0e10cSrcweir 			xTableStream->Seek( nPos + nReadLen );
2344cdf0e10cSrcweir 			unsigned char c;
2345cdf0e10cSrcweir 			*xTableStream >> c;
2346cdf0e10cSrcweir 
2347cdf0e10cSrcweir 			++nReadLen;
2348cdf0e10cSrcweir 			if(    ( !::ReadEsherRec( *xTableStream, nVer, nInst, nFbt, nRecLen ) )
2349cdf0e10cSrcweir 				|| ( 0xf000 > nFbt )
2350cdf0e10cSrcweir 				//|| ( 0xf122 < nFbt )
2351cdf0e10cSrcweir 				)
2352cdf0e10cSrcweir 				break;
2353cdf0e10cSrcweir 
2354cdf0e10cSrcweir 			*pOut << hex6 << nPos + nReadLen - 1 << indent1
2355cdf0e10cSrcweir 					<< "DummyChar: 0x" << hex << (int)c << dec << endl1;
2356cdf0e10cSrcweir 		}
2357cdf0e10cSrcweir 
2358cdf0e10cSrcweir 		::DumpEscherRec( nPos + nReadLen, nVer, nInst,
2359cdf0e10cSrcweir 						nFbt, nRecLen );
2360cdf0e10cSrcweir 
2361cdf0e10cSrcweir 		nReadLen += 2 * sizeof( sal_uInt32 );
2362cdf0e10cSrcweir 		switch( nFbt )
2363cdf0e10cSrcweir 		{
2364cdf0e10cSrcweir 		case 0xF000:
2365cdf0e10cSrcweir 		case 0xF001:	//ESCHER_BstoreContainer
2366cdf0e10cSrcweir 		case 0xF002:
2367cdf0e10cSrcweir 		case 0xF003:
2368cdf0e10cSrcweir 		case 0xF004:
2369cdf0e10cSrcweir 			DumpEscherRecs( nPos + nReadLen, nRecLen );
2370cdf0e10cSrcweir 			break;
2371cdf0e10cSrcweir 		}
2372cdf0e10cSrcweir 
2373cdf0e10cSrcweir 		nReadLen += nRecLen;
2374cdf0e10cSrcweir 		xTableStream->Seek( nPos + nReadLen );
2375cdf0e10cSrcweir 		nOldFbt = nFbt;
2376cdf0e10cSrcweir 	}
2377cdf0e10cSrcweir 	end( *pOut, *xTableStream ) << endl1;
2378cdf0e10cSrcweir }
2379cdf0e10cSrcweir 
2380cdf0e10cSrcweir 
DumpDrawing()2381cdf0e10cSrcweir void DumpDrawing()
2382cdf0e10cSrcweir {
2383cdf0e10cSrcweir 	if( pWwFib->lcbDggInfo )
2384cdf0e10cSrcweir 	{
2385cdf0e10cSrcweir 		sal_uLong nOldPos = xTableStream->Tell(), nReadLen = 0;
2386cdf0e10cSrcweir 		xTableStream->Seek( pWwFib->fcDggInfo );
2387cdf0e10cSrcweir 
2388cdf0e10cSrcweir 		*pOut << endl << hex6 << pWwFib->fcDggInfo << dec2 <<  ' ' << indent1
2389cdf0e10cSrcweir 			  << begin1 << "Escher (DggInfo): Len: " << pWwFib->lcbDggInfo
2390cdf0e10cSrcweir 			  << endl1;
2391cdf0e10cSrcweir 
2392cdf0e10cSrcweir 		::DumpEscherRecs( pWwFib->fcDggInfo, (sal_uLong)pWwFib->lcbDggInfo );
2393cdf0e10cSrcweir 
2394cdf0e10cSrcweir 		end( *pOut, *xTableStream ) << endl1 << endl1;
2395cdf0e10cSrcweir 		xTableStream->Seek( nOldPos );
2396cdf0e10cSrcweir 	}
2397cdf0e10cSrcweir }
2398cdf0e10cSrcweir 
2399cdf0e10cSrcweir 
2400cdf0e10cSrcweir //-----------------------------------------
2401cdf0e10cSrcweir //		Hilfroutinen fuer Styles
2402cdf0e10cSrcweir //-----------------------------------------
2403cdf0e10cSrcweir 
DumpStyleUPX(sal_uInt8 nVersion,short nLen,sal_Bool bPAP)2404cdf0e10cSrcweir static short DumpStyleUPX( sal_uInt8 nVersion, short nLen, sal_Bool bPAP )
2405cdf0e10cSrcweir {
2406cdf0e10cSrcweir 	short cbUPX;
2407cdf0e10cSrcweir 	sal_Bool bEmpty;
2408cdf0e10cSrcweir 
2409cdf0e10cSrcweir 
2410cdf0e10cSrcweir 	if( nLen <= 0 ){
2411cdf0e10cSrcweir 		indent( *pOut, *xTableStream );
2412cdf0e10cSrcweir 		*pOut << "very empty UPX." << ((bPAP) ? "papx " : "chpx ");
2413cdf0e10cSrcweir 		*pOut << "Len:" << nLen << endl1;
2414cdf0e10cSrcweir 		return nLen;
2415cdf0e10cSrcweir 	}
2416cdf0e10cSrcweir 
2417cdf0e10cSrcweir 	nLen -= WW8SkipOdd( &xTableStream );
2418cdf0e10cSrcweir 	indent( *pOut, *xTableStream );
2419cdf0e10cSrcweir 
2420cdf0e10cSrcweir 	xTableStream->Read( &cbUPX, 2 );
2421cdf0e10cSrcweir 	nLen-=	2;
2422cdf0e10cSrcweir 
2423cdf0e10cSrcweir 	if ( cbUPX > nLen )
2424cdf0e10cSrcweir 	{
2425cdf0e10cSrcweir 		*pOut << "!cbUPX auf nLen verkleinert! ";
2426cdf0e10cSrcweir 		cbUPX = nLen;
2427cdf0e10cSrcweir 	}
2428cdf0e10cSrcweir 
2429cdf0e10cSrcweir 	bEmpty = ( cbUPX <= 0 ) || ( bPAP && ( cbUPX <= 2 ) );
2430cdf0e10cSrcweir 
2431cdf0e10cSrcweir 	if ( bEmpty )
2432cdf0e10cSrcweir 		*pOut << "empty ";
2433cdf0e10cSrcweir 	else
2434cdf0e10cSrcweir 		*pOut << begin1;
2435cdf0e10cSrcweir 
2436cdf0e10cSrcweir 	*pOut << "UPX." << ((bPAP) ? "papx " : "chpx ");
2437cdf0e10cSrcweir 	*pOut << "Len:" << nLen << " cbUPX:" << cbUPX << ' ';
2438cdf0e10cSrcweir 
2439cdf0e10cSrcweir 	if( bPAP )
2440cdf0e10cSrcweir 	{
2441cdf0e10cSrcweir 		sal_uInt16 id;
2442cdf0e10cSrcweir 
2443cdf0e10cSrcweir 		xTableStream->Read( &id, 2 );
2444cdf0e10cSrcweir 		cbUPX-=  2;
2445cdf0e10cSrcweir 		nLen-=	2;
2446cdf0e10cSrcweir 		*pOut << "ID:" << id;
2447cdf0e10cSrcweir 	}
2448cdf0e10cSrcweir 
2449cdf0e10cSrcweir 	*pOut << endl1;
2450cdf0e10cSrcweir 
2451cdf0e10cSrcweir 	sal_uLong nPos = xTableStream->Tell();				// falls etwas falsch interpretiert
2452cdf0e10cSrcweir 										// wird, gehts danach wieder richtig
2453cdf0e10cSrcweir 	DumpSprms( nVersion, *xTableStream, cbUPX );
2454cdf0e10cSrcweir 
2455cdf0e10cSrcweir 	if ( xTableStream->Tell() != nPos + cbUPX ){
2456cdf0e10cSrcweir 		*pOut << "!Um " << xTableStream->Tell() - nPos + cbUPX
2457cdf0e10cSrcweir 			 << " Bytes falsch positioniert!" << endl1;
2458cdf0e10cSrcweir 		xTableStream->Seek( nPos+cbUPX );
2459cdf0e10cSrcweir 	}
2460cdf0e10cSrcweir 
2461cdf0e10cSrcweir 	nLen -= cbUPX;
2462cdf0e10cSrcweir 
2463cdf0e10cSrcweir 	if ( !bEmpty )
2464cdf0e10cSrcweir 		end( *pOut, *xTableStream ) << "UPX." << ((bPAP) ? "papx " : "chpx ") << endl1;
2465cdf0e10cSrcweir 
2466cdf0e10cSrcweir 	return nLen;
2467cdf0e10cSrcweir }
2468cdf0e10cSrcweir 
DumpStyleGrupx(sal_uInt8 nVersion,short nLen,sal_Bool bPara)2469cdf0e10cSrcweir static void DumpStyleGrupx( sal_uInt8 nVersion, short nLen, sal_Bool bPara )
2470cdf0e10cSrcweir {
2471cdf0e10cSrcweir 	if( nLen <= 0 )
2472cdf0e10cSrcweir 		return;
2473cdf0e10cSrcweir 	nLen -= WW8SkipOdd( &xTableStream );
2474cdf0e10cSrcweir 
2475cdf0e10cSrcweir 	begin( *pOut, *xTableStream ) << "Grupx, Len:" << nLen << endl1;
2476cdf0e10cSrcweir 
2477cdf0e10cSrcweir 	if( bPara ) nLen = DumpStyleUPX( nVersion, nLen, sal_True );	// Grupx.Papx
2478cdf0e10cSrcweir 	DumpStyleUPX( nVersion, nLen, sal_False );										// Grupx.Chpx
2479cdf0e10cSrcweir 
2480cdf0e10cSrcweir 	end( *pOut, *xTableStream ) << "Grupx" << endl1;
2481cdf0e10cSrcweir }
2482cdf0e10cSrcweir 
PrintStyleId(sal_uInt16 nId)2483cdf0e10cSrcweir static void PrintStyleId( sal_uInt16 nId )
2484cdf0e10cSrcweir {
2485cdf0e10cSrcweir 	switch ( nId ){
2486cdf0e10cSrcweir 	case 0xffe: *pOut << "User "; break;
2487cdf0e10cSrcweir 	case 0xfff: *pOut << "Nil "; break;
2488cdf0e10cSrcweir 	default:	*pOut <<  nId << ' '; break;
2489cdf0e10cSrcweir 	}
2490cdf0e10cSrcweir }
2491cdf0e10cSrcweir 
2492cdf0e10cSrcweir //-----------------------------------------
2493cdf0e10cSrcweir //				Styles
2494cdf0e10cSrcweir //-----------------------------------------
2495cdf0e10cSrcweir 
Dump1Style(sal_uInt16 nNr)2496cdf0e10cSrcweir void DStyle::Dump1Style( sal_uInt16 nNr )
2497cdf0e10cSrcweir {
2498cdf0e10cSrcweir 	short nSkip, cbStd;
2499cdf0e10cSrcweir 	String aStr;
2500cdf0e10cSrcweir 	char c;
2501cdf0e10cSrcweir 	indent( *pOut, *xTableStream );
2502cdf0e10cSrcweir 
2503cdf0e10cSrcweir 	WW8_STD* pStd = Read1Style( nSkip, &aStr, &cbStd ); // lese Style
2504cdf0e10cSrcweir 
2505cdf0e10cSrcweir 	if ( aStr.Len() )										// echter Style
2506cdf0e10cSrcweir 	{
2507cdf0e10cSrcweir 		*pOut << begin1;
2508cdf0e10cSrcweir 		switch ( pStd->sgc ){
2509cdf0e10cSrcweir 		case 1:  c = 'P'; break;
2510cdf0e10cSrcweir 		case 2:  c = 'C'; break;
2511cdf0e10cSrcweir 		default: c = '?'; break;
2512cdf0e10cSrcweir 		}
2513cdf0e10cSrcweir 		*pOut << c << "-Style Nr:" << nNr << ' ';
2514cdf0e10cSrcweir 		*pOut << "ID:"; PrintStyleId( pStd->sti );
2515cdf0e10cSrcweir 		*pOut << "BasedOn:"; PrintStyleId( pStd->istdBase );
2516cdf0e10cSrcweir 		ByteString sName( aStr, RTL_TEXTENCODING_MS_1252 );
2517cdf0e10cSrcweir 		*pOut << "Next:" << pStd->istdNext << " Name:\"" << sName.GetBuffer() << "\"";
2518cdf0e10cSrcweir 		*pOut << endl1 << "                       ";
2519cdf0e10cSrcweir 		*pOut << "cbStd:" << cbStd << ' ';
2520cdf0e10cSrcweir 		*pOut << "No of Upx & Upe:" << pStd->cupx << ' ';
2521cdf0e10cSrcweir 		*pOut << "bchUpe:" << pStd->bchUpe << ' ';
2522cdf0e10cSrcweir 		*pOut << "nSkip:" << nSkip << endl1;
2523cdf0e10cSrcweir 	}else{									// leerer Slot
2524cdf0e10cSrcweir 		*pOut << "empty Slot Nr:" << nNr << endl1;
2525cdf0e10cSrcweir 	}
2526cdf0e10cSrcweir 
2527cdf0e10cSrcweir 	long nPos = xTableStream->Tell();				// falls etwas falsch interpretiert
2528cdf0e10cSrcweir 										// wird, gehts danach wieder richtig
2529cdf0e10cSrcweir 
2530cdf0e10cSrcweir 	if( pStd && ( pStd->sgc == 1 || pStd->sgc == 2 ) )
2531cdf0e10cSrcweir 		DumpStyleGrupx( nVersion, nSkip, pStd->sgc == 1 );
2532cdf0e10cSrcweir 
2533cdf0e10cSrcweir 	if ( aStr.Len() ) 								// echter Style
2534cdf0e10cSrcweir 		end( *pOut, *xTableStream ) << c << "-Style" << endl1;
2535cdf0e10cSrcweir 
2536cdf0e10cSrcweir 	xTableStream->Seek( nPos+nSkip );
2537cdf0e10cSrcweir 
2538cdf0e10cSrcweir 	DELETEZ( pStd );
2539cdf0e10cSrcweir }
2540cdf0e10cSrcweir 
Dump()2541cdf0e10cSrcweir void DStyle::Dump()
2542cdf0e10cSrcweir {
2543cdf0e10cSrcweir 	*pOut << hex6 << nStyleStart << ' ' << dec2 << indent1;
2544cdf0e10cSrcweir 
2545cdf0e10cSrcweir 	*pOut << begin1 	  << cstd << " Styles, ";
2546cdf0e10cSrcweir 	*pOut << "Base:"      << cbSTDBaseInFile;
2547cdf0e10cSrcweir 	*pOut << ", Written:" << (fStdStylenamesWritten) ? 'T' : 'F';
2548cdf0e10cSrcweir 	*pOut << ", MaxSti:"  << stiMaxWhenSaved;
2549cdf0e10cSrcweir 	*pOut << ", MaxFix:"  << istdMaxFixedWhenSaved;
2550cdf0e10cSrcweir 	*pOut << ", BuildIn:" << nVerBuiltInNamesWhenSaved;
2551cdf0e10cSrcweir 	*pOut << ", StdFnt:"  << ftcStandardChpStsh << endl1;
2552cdf0e10cSrcweir 
2553cdf0e10cSrcweir 	sal_uInt16 i;
2554cdf0e10cSrcweir 	for( i=0; i<cstd; i++ )
2555cdf0e10cSrcweir 		Dump1Style( i );
2556cdf0e10cSrcweir 
2557cdf0e10cSrcweir 	end( *pOut, *xTableStream ) << "Styles" << endl1 << endl1;
2558cdf0e10cSrcweir }
2559cdf0e10cSrcweir 
2560cdf0e10cSrcweir //-----------------------------------------
2561cdf0e10cSrcweir //				Main
2562cdf0e10cSrcweir //-----------------------------------------
2563cdf0e10cSrcweir 
2564cdf0e10cSrcweir //char cName [266];
2565cdf0e10cSrcweir //char cOutName [266];
2566cdf0e10cSrcweir 
PrepareConvert(String & rName,String & rOutName,String & rMess)2567cdf0e10cSrcweir int PrepareConvert( String& rName, String& rOutName, String& rMess )
2568cdf0e10cSrcweir {
2569cdf0e10cSrcweir 	pxStor = new SvStorageRef( new SvStorage( rName, STREAM_STD_READ ) );
2570cdf0e10cSrcweir 	xStrm = (*pxStor)->OpenStream( String::CreateFromAscii( "WordDocument" ),
2571cdf0e10cSrcweir 										STREAM_STD_READ );
2572cdf0e10cSrcweir 
2573cdf0e10cSrcweir 	if ( !xStrm.Is() /* || xStrm->GetError() */ ){
2574cdf0e10cSrcweir 		rMess.AppendAscii( "Kann StorageStream \"WordDocument\" in " );
2575cdf0e10cSrcweir 		rMess += rName;
2576cdf0e10cSrcweir 		rMess.AppendAscii( " nicht zum Lesen oeffnen" );
2577cdf0e10cSrcweir 		DELETEZ( pxStor );
2578cdf0e10cSrcweir 		return 1;
2579cdf0e10cSrcweir 	}
2580cdf0e10cSrcweir 
2581cdf0e10cSrcweir 	sal_uLong nL;
2582cdf0e10cSrcweir 	if ( xStrm->Read( &nL, sizeof( nL ) ) == 0 ){
2583cdf0e10cSrcweir 		rMess.AppendAscii( "Kann aus StorageStream \"WordDocument\" in ");
2584cdf0e10cSrcweir 		rMess += rName;
2585cdf0e10cSrcweir 		rMess.AppendAscii( " nicht Lesen" );
2586cdf0e10cSrcweir 		return 1;
2587cdf0e10cSrcweir 	}
2588cdf0e10cSrcweir 	xStrm->Seek( 0 );
2589cdf0e10cSrcweir 
2590cdf0e10cSrcweir 	ByteString sOutName( rOutName, RTL_TEXTENCODING_MS_1252 );
2591cdf0e10cSrcweir 	pOut = new fstream( sOutName.GetBuffer(), ios::out );
2592cdf0e10cSrcweir 	if ( !pOut )
2593cdf0e10cSrcweir 	{
2594cdf0e10cSrcweir 		rMess.AppendAscii( "Kann Ausgabedatei " );
2595cdf0e10cSrcweir 		rMess += rOutName;
2596cdf0e10cSrcweir 		rMess.AppendAscii( " nicht zum Schreiben oeffnen" );
2597cdf0e10cSrcweir 		return 1;
2598cdf0e10cSrcweir 	}
2599cdf0e10cSrcweir 
2600cdf0e10cSrcweir 	rMess.AppendAscii( "Ausgabe von " );
2601cdf0e10cSrcweir 	rMess += rName;
2602cdf0e10cSrcweir 	rMess.AppendAscii( " in Datei " );
2603cdf0e10cSrcweir 	rMess += rOutName;
2604cdf0e10cSrcweir 	rMess.AppendAscii(  "......" );
2605cdf0e10cSrcweir 
2606cdf0e10cSrcweir 	if ( xStrm->Read( &nL, sizeof( nL ) ) == 0 ){
2607cdf0e10cSrcweir 		return 1;
2608cdf0e10cSrcweir 	}
2609cdf0e10cSrcweir 	xStrm->Seek( 0 );
2610cdf0e10cSrcweir 
2611cdf0e10cSrcweir 	return 0;
2612cdf0e10cSrcweir }
2613cdf0e10cSrcweir 
DoConvert(const String & rName,sal_uInt8 nVersion)2614cdf0e10cSrcweir int DoConvert( const String& rName, sal_uInt8 nVersion )
2615cdf0e10cSrcweir {
2616cdf0e10cSrcweir 	sal_uLong nL;
2617cdf0e10cSrcweir 	if ( xStrm->Read( &nL, sizeof( nL ) ) == 0 ){
2618cdf0e10cSrcweir 		return 1;
2619cdf0e10cSrcweir 	}
2620cdf0e10cSrcweir 	xStrm->Seek( 0 );
2621cdf0e10cSrcweir 
2622cdf0e10cSrcweir 	pWwFib = new DFib( *xStrm, nVersion );
2623cdf0e10cSrcweir 
2624cdf0e10cSrcweir 	if ( pWwFib->nFibError )
2625cdf0e10cSrcweir 		return 1;
2626cdf0e10cSrcweir 
2627cdf0e10cSrcweir 	// Nachdem wir nun den FIB eingelesen haben, wissen wir ja,
2628cdf0e10cSrcweir 	// welcher Table-Stream gueltig ist.
2629cdf0e10cSrcweir 	// Diesen oeffnen wir nun.
2630cdf0e10cSrcweir 
2631cdf0e10cSrcweir 	switch( pWwFib->nVersion )	// 6 steht fuer "6 ODER 7",  7 steht fuer "NUR 7"
2632cdf0e10cSrcweir 	{
2633cdf0e10cSrcweir 	case 6:
2634cdf0e10cSrcweir 	case 7:
2635cdf0e10cSrcweir 			xTableStream = &xStrm;
2636cdf0e10cSrcweir 			xDataStream = &xStrm;
2637cdf0e10cSrcweir 					break;
2638cdf0e10cSrcweir 	case 8:
2639cdf0e10cSrcweir 			xTableStream = (*pxStor)->OpenStream( String::CreateFromAscii(
2640cdf0e10cSrcweir 						( 1 == pWwFib->fWhichTblStm ) ? "1Table" : "0Table" ),
2641cdf0e10cSrcweir 						STREAM_STD_READ );
2642cdf0e10cSrcweir 			xDataStream = (*pxStor)->OpenStream( String::CreateFromAscii(
2643cdf0e10cSrcweir 							"Data" ), STREAM_STD_READ | STREAM_NOCREATE );
2644cdf0e10cSrcweir 			if( !xDataStream.Is() || SVSTREAM_OK != xDataStream->GetError() )
2645cdf0e10cSrcweir 				xDataStream = &xStrm;
2646cdf0e10cSrcweir 					break;
2647cdf0e10cSrcweir 	default:// Programm-Fehler!
2648cdf0e10cSrcweir 					/*
2649cdf0e10cSrcweir 						ACHTUNG: im FILTER nicht "sal_False" sondern "!this()" schreiben,
2650cdf0e10cSrcweir 											da sonst Warning unter OS/2
2651cdf0e10cSrcweir 					*/
2652cdf0e10cSrcweir 					ASSERT( sal_False, "Es wurde vergessen, nVersion zu kodieren!" );
2653cdf0e10cSrcweir 					return 1;
2654cdf0e10cSrcweir 	}
2655cdf0e10cSrcweir 
2656cdf0e10cSrcweir 
2657cdf0e10cSrcweir 	// dann erstmal den Dateinamen schreiben:
2658cdf0e10cSrcweir 	{
2659cdf0e10cSrcweir 		ByteString sName( rName, RTL_TEXTENCODING_MS_1252 );
2660cdf0e10cSrcweir 		*pOut << "Datei: " << sName.GetBuffer() << endl;
2661cdf0e10cSrcweir 	}
2662cdf0e10cSrcweir 	pSBase = new WW8ScannerBase( &xStrm, &xTableStream, &xDataStream, pWwFib );
2663cdf0e10cSrcweir 
2664cdf0e10cSrcweir 	// erstmal die Lowlevel-Funktionen
2665cdf0e10cSrcweir 
2666cdf0e10cSrcweir 	((DFib*)pWwFib)->Dump();														// FIB
2667cdf0e10cSrcweir 	DumpDop(  *pWwFib );																					// WW8_DOP
2668cdf0e10cSrcweir 
2669cdf0e10cSrcweir 	if(	( 8 > pWwFib->nVersion && pWwFib->fComplex ) ||
2670cdf0e10cSrcweir 		pWwFib->lcbClx )
2671cdf0e10cSrcweir 		DumpPcd( pWwFib->nVersion, pWwFib->fcClx, pWwFib->lcbClx );
2672cdf0e10cSrcweir 
2673cdf0e10cSrcweir 	DumpBookLow();
2674cdf0e10cSrcweir 
2675cdf0e10cSrcweir 	DumpBookHigh();
2676cdf0e10cSrcweir 
2677cdf0e10cSrcweir 
2678cdf0e10cSrcweir 	DumpPLCF( pWwFib->fcPlcfsed, pWwFib->lcbPlcfsed, SEP ); 			// SEPX
2679cdf0e10cSrcweir 
2680cdf0e10cSrcweir 	DumpPLCF( pWwFib->fcPlcfbteChpx, pWwFib->lcbPlcfbteChpx, CHP ); // CHPX
2681cdf0e10cSrcweir 
2682cdf0e10cSrcweir 	DumpPLCF( pWwFib->fcPlcfbtePapx, pWwFib->lcbPlcfbtePapx, PAP ); // PAPX
2683cdf0e10cSrcweir 
2684cdf0e10cSrcweir 	{
2685cdf0e10cSrcweir 		DStyle aStyle( *xTableStream, *pWwFib );										// Styles
2686cdf0e10cSrcweir 		aStyle.Dump();
2687cdf0e10cSrcweir 	}
2688cdf0e10cSrcweir 
2689cdf0e10cSrcweir 	DumpFonts();														// WW8_FFN
2690cdf0e10cSrcweir 
2691cdf0e10cSrcweir   // ... und jetzt die High-Level-Funktionen
2692cdf0e10cSrcweir 
2693cdf0e10cSrcweir 	WW8_CP nStartCp = 0;
2694cdf0e10cSrcweir 
2695cdf0e10cSrcweir 	DumpPlainText( nStartCp, pWwFib->ccpText, "Main" );
2696cdf0e10cSrcweir 	*pOut << endl1;
2697cdf0e10cSrcweir 	DumpField1( pWwFib->fcPlcffldMom, pWwFib->lcbPlcffldMom,
2698cdf0e10cSrcweir 				"MainText Fields" );
2699cdf0e10cSrcweir 
2700cdf0e10cSrcweir 	DumpHeader( pSBase );											// Header / Footer
2701cdf0e10cSrcweir 	DumpField1( pWwFib->fcPlcffldHdr, pWwFib->lcbPlcffldHdr,
2702cdf0e10cSrcweir 				"Header/Footer Fields" );
2703cdf0e10cSrcweir 
2704cdf0e10cSrcweir 	DumpFootnotes( pSBase );
2705cdf0e10cSrcweir 	DumpField1( pWwFib->fcPlcffldFtn, pWwFib->lcbPlcffldFtn,
2706cdf0e10cSrcweir 				"Footnote Fields" );
2707cdf0e10cSrcweir 
2708cdf0e10cSrcweir 	DumpEndnotes( pSBase );
2709cdf0e10cSrcweir 	DumpField1( pWwFib->fcPlcffldEdn, pWwFib->lcbPlcffldEdn,
2710cdf0e10cSrcweir 				"Endnote Fields" );
2711cdf0e10cSrcweir 
2712cdf0e10cSrcweir 	DumpAnnotations( pSBase );
2713cdf0e10cSrcweir 
2714cdf0e10cSrcweir 	DumpTextBoxs( pSBase );
2715cdf0e10cSrcweir 
2716cdf0e10cSrcweir 	DumpField1( pWwFib->fcPlcffldTxbx, pWwFib->lcbPlcffldTxbx,
2717cdf0e10cSrcweir 				"Textbox Fields" );
2718cdf0e10cSrcweir 	DumpField1( pWwFib->fcPlcffldHdrTxbx, pWwFib->lcbPlcffldHdrTxbx,
2719cdf0e10cSrcweir 				"Header/Footer Textbox Fields" );
2720cdf0e10cSrcweir 
2721cdf0e10cSrcweir 	if( 8 == pWwFib->nVersion )
2722cdf0e10cSrcweir 		DumpNumList();
2723cdf0e10cSrcweir 
2724cdf0e10cSrcweir 	DumpFdoa( pSBase );
2725cdf0e10cSrcweir 
2726cdf0e10cSrcweir 	if( pWwFib->lcbPlcfspaHdr || pWwFib->lcbPlcfspaMom )
2727cdf0e10cSrcweir 		DumpDrawing();
2728cdf0e10cSrcweir 
2729cdf0e10cSrcweir 	DELETEZ( pSBase );
2730cdf0e10cSrcweir 	DELETEZ( pWwFib );
2731cdf0e10cSrcweir 	return 0;
2732cdf0e10cSrcweir }
2733cdf0e10cSrcweir 
DeInit()2734cdf0e10cSrcweir void DeInit()
2735cdf0e10cSrcweir {
2736cdf0e10cSrcweir //	DELETEZ( aWwStor );
2737cdf0e10cSrcweir 	xStrm.Clear();
2738cdf0e10cSrcweir 	DELETEZ( pxStor );
2739cdf0e10cSrcweir 	DELETEZ( pOut );
2740cdf0e10cSrcweir }
2741cdf0e10cSrcweir 
2742cdf0e10cSrcweir 
2743