summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/dump
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ww8/dump')
-rw-r--r--sw/source/filter/ww8/dump/dump8.cxx171
-rw-r--r--sw/source/filter/ww8/dump/dump8a.cxx2746
-rw-r--r--sw/source/filter/ww8/dump/msvbasic.cxx536
-rw-r--r--sw/source/filter/ww8/dump/msvbasic.hxx102
-rw-r--r--sw/source/filter/ww8/dump/ww8darr.cxx546
-rw-r--r--sw/source/filter/ww8/dump/ww8darr.hxx43
-rw-r--r--sw/source/filter/ww8/dump/ww8dout.cxx419
-rw-r--r--sw/source/filter/ww8/dump/ww8dout.hxx86
-rw-r--r--sw/source/filter/ww8/dump/ww8scan.cxx6667
-rw-r--r--sw/source/filter/ww8/dump/ww8scan.hxx1488
-rw-r--r--sw/source/filter/ww8/dump/ww8struc.hxx815
11 files changed, 0 insertions, 13619 deletions
diff --git a/sw/source/filter/ww8/dump/dump8.cxx b/sw/source/filter/ww8/dump/dump8.cxx
deleted file mode 100644
index f0679da25067..000000000000
--- a/sw/source/filter/ww8/dump/dump8.cxx
+++ /dev/null
@@ -1,171 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-
-
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/msgbox.hxx>
-
-#include <sot/storage.hxx>
-
-// globale Vars
-
-char** pPara;
-
-// Deklarationen
-
-int PrepareConvert( String& rName, String& rOutName, String& rMess );
-int DoConvert( const String& rName, sal_uInt8 nVersion );
-void DeInit();
-
-
-
-// -----------------------------------------------------------------------
-
-class MyApp : public Application
-{
-public:
- void Main();
-};
-
-// -----------------------------------------------------------------------
-
-MyApp aMyApp;
-
-// -----------------------------------------------------------------------
-
-class MyWin : public WorkWindow
-{
- String& rMessg;
-public:
- MyWin( Window* pParent, WinBits aWinStyle, String& rMess ) :
- WorkWindow(pParent, aWinStyle), rMessg( rMess ) {}
-
- void Paint( const Rectangle& );
- void Resize();
-
- void MouseButtonDown( const MouseEvent& rMEvt );
- void KeyInput( const KeyEvent& rKEvt );
-};
-
-// -----------------------------------------------------------------------
-
-extern SvStorageStreamRef xStrm;
-
-void MyApp::Main()
-{
- SvFactory::Init();
- String aMess, aName, aOutName;
- sal_uInt8 nVersion = 8;
-
- int nArgs = GetCommandLineParamCount();
- if (nArgs)
- {
- aName = GetCommandLineParam( 0 );
- if (aName.Search('.') == STRING_NOTFOUND)
- aName.AppendAscii( ".doc" );
- if (nArgs >= 2)
- {
- aOutName = GetCommandLineParam( 1 );
- if (nArgs > 2)
- {
- nVersion = GetCommandLineParam( 2 ).ToInt32();
- if( 6 > nVersion || 8 < nVersion )
- {
- aMess.AssignAscii( "Aufruf: Dump1 InFile [OutFile] [6|7|8]" );
- }
- }
- }
- else
- {
- aOutName = aName;
- aOutName.Erase(aOutName.Search('.'));
- aOutName.AppendAscii( ".dmp" );
- }
- }
-
- sal_Bool bOk = !aMess.Len()
- && !PrepareConvert( aName, aOutName, aMess )
- && !DoConvert( aName, nVersion );
-
- if( !bOk )
- {
- MyWin aMainWin( NULL, WB_APP | WB_STDWORK, aMess );
-
- aMainWin.SetText( String::CreateFromAscii( "WW8-Dumper" ));
- aMainWin.Show();
- aMainWin.Invalidate();
-
- Execute();
- }
- DeInit();
-// SvFactory::DeInit();
-}
-
-// -----------------------------------------------------------------------
-
-void MyWin::Paint( const Rectangle& )
-{
- String aText( String::CreateFromAscii( "Dumper fuer WinWord-Dateien !\n"
- "Die Wandlung ging schief. Ist es wirklich ein WW-File ?" ));
-
- Size aWinSize = GetOutputSizePixel();
- Size aTextSize( GetTextWidth( aText ), GetTextHeight());
- Point aPos( aWinSize.Width() / 2 - aTextSize.Width() / 2,
- aWinSize.Height() / 2 - aTextSize.Height() / 2 );
-
- DrawText( aPos, aText );
-
- aPos.Y() += 20;
- DrawText( aPos, rMessg );
-}
-
-// -----------------------------------------------------------------------
-
-void MyWin::Resize()
-{
- Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-void MyWin::MouseButtonDown( const MouseEvent& )
-{
-}
-
-// -----------------------------------------------------------------------
-
-void MyWin::KeyInput( const KeyEvent& rKEvt )
-{
- WorkWindow::KeyInput( rKEvt );
-}
-
-
-
diff --git a/sw/source/filter/ww8/dump/dump8a.cxx b/sw/source/filter/ww8/dump/dump8a.cxx
deleted file mode 100644
index 687386b1c9c0..000000000000
--- a/sw/source/filter/ww8/dump/dump8a.cxx
+++ /dev/null
@@ -1,2746 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-
-
-//#include <stdio.h> // SEEK_SET
-#include <string.h> // memset(), ...
-#include <io.h> // access()
-
-
-//#include "defs.hxx"
-#include <tools/solar.h>
-#include <sot/storage.hxx>
-#include "ww8struc.hxx"
-#include "ww8scan.hxx"
-#include "ww8darr.hxx"
-#include "ww8dout.hxx"
-
-#define ASSERT( a, b ) ( (a)?(void)0:(void)(*pOut<<endl1<<"ASSERTION failed "<< __FILE__<<__LINE__<< b <<endl1) )
-
-
-#define nWW8MaxListLevel 9
-
-WW8ScannerBase* pSBase = 0;
-//WW8PLCFMan* pPLCFMan = 0;
-
-WW8Fib* pWwFib = 0;
-SvStorageRef* pxStor;
-SvStorageStreamRef xStrm;
-SvStorageStreamRef xTableStream; // ist bei Ver6-7 mit xStrm identisch,
- // ansonsten entweder 0TABLE oder 1TABLE
-SvStorageStreamRef xDataStream; // ist bei Ver6-7 mit xStrm identisch,
- // ansonsten DATA
-
-typedef void (*FNDumpData)( void* );
-
-sal_Bool DumpChar( sal_uInt8 c );
-void DumpShortPlainText( WW8_CP nStartCp, long nTextLen, char* pName );
-void DumpPlainText( WW8_CP nStartCp, long nTextLen, char* pName );
-void DumpSprms( sal_uInt8 nVersion, SvStream& rSt, short nLen );
-
-
-sal_Bool WW8ReadINT32( SvStream& rStrm, sal_Int32& rTarget )
-{
- rStrm >> rTarget;
- return sal_True;
-
-
- SVBT32 nData;
- sal_Bool bOk = sal_True;
- if( 4 == rStrm.Read( &nData, 4 ) )
- rTarget = SVBT32ToUInt32( nData );
- else
- bOk = sal_False;
- return bOk;
-}
-
-sal_Bool WW8ReadINT16( SvStream& rStrm, sal_Int16& rTarget )
-{
- rStrm >> rTarget;
- return sal_True;
-
-
- SVBT16 nData;
- sal_Bool bOk = sal_True;
- if( 2 == rStrm.Read( &nData, 2 ) )
- {
- rTarget = SVBT16ToShort( nData );
- }
- else
- bOk = sal_False;
- return bOk;
-}
-
-sal_Bool WW8ReadBYTE( SvStream& rStrm, sal_uInt8& rTarget )
-{
- rStrm >> rTarget;
- return sal_True;
-
-
- SVBT8 nData;
- sal_Bool bOk = sal_True;
- if( 1 == rStrm.Read( &nData, 1 ) )
- rTarget = SVBT8ToByte( nData );
- else
- bOk = sal_False;
- return bOk;
-}
-
-sal_Bool WW8ReadUINT32( SvStream& rStrm, sal_uInt32& rTarget )
- { return WW8ReadINT32( rStrm, (sal_Int32&) rTarget ); }
-
-sal_Bool WW8ReadUINT16( SvStream& rStrm, sal_uInt16& rTarget )
- { return WW8ReadINT16( rStrm, (sal_Int16&) rTarget ); }
-
-
-static void Dump_LVL( sal_uInt16 nLevel )
-{
- indent( *pOut, *xTableStream );
-
- long nStart, dxaSpace, dxaIndent;
- sal_uInt8 nfc, nFlags, ixchFollow, cbChpx, cbPapx;
- sal_uInt8 aOfsNumsXCH[nWW8MaxListLevel];
- *xTableStream >> nStart >> nfc >> nFlags;
- xTableStream->Read( aOfsNumsXCH, 9 );
- *xTableStream >> ixchFollow >> dxaSpace >> dxaIndent
- >> cbChpx >> cbPapx;
- xTableStream->SeekRel( 2 );
-
- *pOut << " Level: " << nLevel << endl1;
- *pOut << indent2 << " Start: " << nStart
- << " Fmt: " << (sal_uInt16)nfc
- << " Follow: ";
- if( 0 == ixchFollow ) *pOut << "tab";
- else if( 1 == ixchFollow ) *pOut << "blank";
- else if( 2 == ixchFollow ) *pOut << "nothing";
- *pOut << endl1 << indent2<< " dxSpace: " << dxaSpace
- << " dxaIndent: " << dxaIndent << " LevelCharPos: ";
-
- for( sal_uInt8 x = 0; x < nWW8MaxListLevel; ++x )
- *pOut << (sal_uInt16)aOfsNumsXCH[ x ] << ", ";
- *pOut << endl1;
-
- if( cbPapx )
- {
- sal_uLong nXPos = xTableStream->Tell();
- DumpSprms( pWwFib->nVersion, *xTableStream, cbPapx );
- xTableStream->Seek( nXPos + cbPapx );
- }
- if( cbChpx )
- {
- sal_uLong nXPos = xTableStream->Tell();
- DumpSprms( pWwFib->nVersion, *xTableStream, cbChpx );
- xTableStream->Seek( nXPos + cbChpx );
- }
-
- sal_uInt16 nStrLen, nC;
- *xTableStream >> nStrLen;
- char* pStr = new char[ nStrLen+1 ], *p = pStr;
- while( nStrLen-- )
- {
- *xTableStream >> nC;
- if( 10 > nC ) nC += 0x30;
- *pStr++ = (char)nC;
- }
- *pStr = 0;
- *pOut << indent2 << "Str: \"" << p << '\"' << endl1 << endl1;
-}
-
-static void DumpNumList()
-{
- if( pWwFib->lcbSttbListNames )
- {
- sal_uLong nOldPos = xTableStream->Tell();
- xTableStream->Seek( pWwFib->fcSttbListNames );
-
- *pOut << endl1;
- begin( *pOut, *xTableStream ) << "ListNames, Size ";
-
- sal_uInt16 nDummy;
- sal_uInt32 nCount;
- *xTableStream >> nDummy >> nCount;
-
- *pOut << nCount << ", Dummy: " << nDummy << endl1;
-
- *pOut << indent2;
- for( ; nCount; --nCount )
- {
- sal_uInt16 nLen, nC;
- *xTableStream >> nLen;
- char * pChar = new char[ nLen + 1 ], *p = pChar;
- while( nLen-- )
- {
- *xTableStream >> nC;
- *pChar++ = (char)nC;
- }
- *pChar = 0;
- *pOut << '\"' << p << '\"';
- if( 1 < nCount ) *pOut << ", ";
- delete p;
- }
- *pOut << endl1;
-
- end( *pOut, *xTableStream ) << "ListNames" << endl1;
- xTableStream->Seek( nOldPos );
- }
-
- if( pWwFib->lcbPlcfLst )
- {
- sal_uLong nOldPos = xTableStream->Tell();
- xTableStream->Seek( pWwFib->fcPlcfLst );
-
- *pOut << endl1;
- begin( *pOut, *xTableStream ) << "LiST Data on File, Size ";
-
- sal_uInt16 nCount;
- *xTableStream >> nCount;
- *pOut << nCount << endl1;
-
- sal_uLong nLVLPos = pWwFib->fcPlcfLst + ( nCount * 0x1c ) + 2;
-
- // 1.1 alle LST einlesen
- for( sal_uInt16 nList = 0; nList < nCount; nList++ )
- {
- indent( *pOut, *xTableStream );
-
- sal_uInt8 nByte;
- sal_uInt32 nLstId, nTplId;
- *xTableStream >> nLstId >> nTplId;
-
- sal_uInt16 aStyleIdArr[ nWW8MaxListLevel ];
- for( sal_uInt16 nLevel = 0; nLevel < nWW8MaxListLevel; nLevel++ )
- *xTableStream >> aStyleIdArr[ nLevel ];
- *xTableStream >> nByte;
- xTableStream->SeekRel( 1 ); // Dummy ueberlesen
-
- *pOut << "ListId: " << nLstId
- << " TemplateId " << nTplId << endl1
- << indent2 << " StyleIds: ";
- for( nLevel = 0; nLevel < nWW8MaxListLevel; nLevel++ )
- *pOut << aStyleIdArr[ nLevel ] << ", ";
-
- *pOut << endl1;
- if( 1 & nByte ) *pOut << " <simple List>";
- if( 2 & nByte ) *pOut << " <restart at new section>";
- if( 3 & nByte ) *pOut << endl1;
-
- sal_uLong nTmpPos = xTableStream->Tell();
- xTableStream->Seek( nLVLPos );
-
- // 1.2 alle LVL aller aLST einlesen
- for( nLevel = 0; nLevel < ((1 & nByte) ? 1 : nWW8MaxListLevel); nLevel++ )
- Dump_LVL( nLevel );
-
- nLVLPos = xTableStream->Tell();
- xTableStream->Seek( nTmpPos );
- }
-
- end( *pOut, *xTableStream ) << "LiST Data on File" << endl1;
- xTableStream->Seek( nOldPos );
- }
-
- if( pWwFib->lcbPlfLfo )
- {
- sal_uLong nOldPos = xTableStream->Tell();
- xTableStream->Seek( pWwFib->fcPlfLfo );
-
- *pOut << endl1;
- begin( *pOut, *xTableStream ) << "List Format Override, Size ";
-
- sal_uInt32 nCount, nLstId;
- *xTableStream >> nCount;
- *pOut << nCount << endl1;
-
- sal_uLong nLVLPos = pWwFib->fcPlfLfo + ( nCount * 0x10 ) + 4;
-
- for( ; nCount; --nCount )
- {
- indent( *pOut, *xTableStream );
-
- sal_uInt8 nLevels;
- *xTableStream >> nLstId;
- xTableStream->SeekRel( 8 );
- *xTableStream >> nLevels;
- xTableStream->SeekRel( 3 );
-
- *pOut << "ListId: " << nLstId
- << " Override Levels: " << (sal_uInt16)nLevels << endl1;
-
- sal_uLong nTmpPos = xTableStream->Tell();
- xTableStream->Seek( nLVLPos );
-
- for( sal_uInt8 nLvl = 0; nLvl < nLevels; ++nLvl )
- {
- sal_uInt32 nStartAt;
- sal_uInt8 nFlags;
- do {
- *xTableStream >> nFlags;
- } while( 0xFF == nFlags );
- xTableStream->SeekRel( -1 );
-
- indent( *pOut, *xTableStream );
- *xTableStream >> nStartAt >> nFlags;
- xTableStream->SeekRel( 3 );
-
- if( nFlags & 0x10 ) *pOut << "<Override start>";
- if( nFlags & 0x20 ) *pOut << "<Override formattting>";
- if( nFlags & 0x30 ) *pOut << endl1;
-
- if( nFlags & 0x20 )
- Dump_LVL( nFlags & 0x0F );
- }
- nLVLPos = xTableStream->Tell();
- xTableStream->Seek( nTmpPos );
- }
-
- end( *pOut, *xTableStream ) << "List Format Override" << endl1 << endl1;
- xTableStream->Seek( nOldPos );
- }
-}
-
-static void DumpBookLow()
-{
- *pOut << begin2 << "Bookmarks Low" << endl1;
- *pOut << indent2 <<"Start: Adr " << hex6 << pWwFib->fcPlcfbkf
- << ", Len: " << pWwFib->lcbPlcfbkf << endl1;
- *pOut << indent2 << "End: Adr " << hex6 << pWwFib->fcPlcfbkl
- << ", Len: " << pWwFib->lcbPlcfbkl << endl1;
- *pOut << indent2 << "Strings: Adr " << hex6 << pWwFib->fcSttbfbkmk
- << ", Len: " << pWwFib->lcbSttbfbkmk << endl1;
- *pOut << endl1;
-
- WW8PLCFspecial aStarts( &xStrm, pWwFib->fcPlcfbkf, pWwFib->lcbPlcfbkf, 4 );
- WW8PLCFspecial aEnds( &xStrm, pWwFib->fcPlcfbkl, pWwFib->lcbPlcfbkl, 0, -1, sal_True );
-
- sal_uInt16 i = 0;
- while( 1 ){
- long nStart = aStarts.GetPos( i );
- if( nStart >= LONG_MAX )
- break;
-
- *pOut << indent2 << i << ".StartCp: " << hex6 << nStart;
-
- const void* p = aStarts.GetData( i );
- if( p ){
- *pOut << ", EndIdx: ";
- sal_uInt16 nEndIdx = *((sal_uInt16*)p);
- *pOut << nEndIdx;
- long nEnd = aEnds.GetPos( nEndIdx );
- *pOut << ", End: " << hex6 << nEnd << hex
- << ", Len: " << nEnd - nStart << dec;
- }else{
- *pOut << " aStarts.GetData() ging schief.";
- }
-
- *pOut << endl1;
- i++;
- }
- *pOut << end2 << "Bookmarks Low" << endl1 << endl1;
-}
-
-static void DumpBookHigh()
-{
- WW8PLCFx_Book aBook( &xStrm, &xTableStream, *pWwFib, 0 );
- if( !aBook.GetIMax() ){
- *pOut << indent1 << "No Bookmarks" << endl1 << endl1;
- return;
- }
-
- *pOut << indent1 << begin1 << "Bookmarks High" << endl1;
-
- sal_uInt16 i = 0;
- while( 1 )
- {
- long nPos = aBook.Where();
- if( nPos >= LONG_MAX )
- break;
- *pOut << indent2 << i << ". Cp:" << hex6 << nPos << dec;
- *pOut << ( ( aBook.GetIsEnd() ) ? " Ende " : " Anfang" );
- *pOut << " Handle: " << aBook.GetHandle();
-// *pOut << " Len: " << hex4 << aBook.GetLen() << dec;
- ByteString sName( *aBook.GetName(), RTL_TEXTENCODING_MS_1252 );
- if( sName.Len() )
- *pOut << " Name: " << sName.GetBuffer() << endl1;
- else
- *pOut << endl1;
- aBook++;
- i++;
- }
- *pOut << end2 << "Bookmarks High" << endl1 << endl1;
-}
-
-static sal_Bool DumpField3( WW8PLCFspecial& rPlc )
-{
- WW8FieldDesc aF;
-
- sal_Bool bOk = WW8GetFieldPara( pWwFib->nVersion, rPlc, aF );
- if( !bOk )
- {
- *pOut << " " << indent1 << "no WW8GetFieldPara()" << endl1;
- return sal_False;
- }
- *pOut << " " << indent1 << begin1 << "Field Cp: " << hex
- << aF.nSCode << ", Len: " << aF.nLCode << "; Cp: " << aF.nSRes
- << ", Len: "<< aF.nLRes << ", Typ: " << dec << (sal_uInt16)aF.nId
- << ", Options: " << hex << (sal_uInt16)aF.nOpt;
- if( aF.bCodeNest )
- *pOut << " Code Nested";
- if( aF.bResNest )
- *pOut << " Result Nested";
- *pOut << endl1;
- DumpShortPlainText( aF.nSCode, aF.nLCode, "Code" );
- DumpShortPlainText( aF.nSRes, aF.nLRes, "Result" );
- *pOut << " " << end1 << "Field" << endl1;
- return sal_True;
-}
-
-static sal_Bool DumpField2( WW8PLCFspecial& rPlc )
-{
- WW8_CP nSCode, nECode, nSRes, nERes;
- void* pData;
- if( !rPlc.Get( nSCode, pData ) ) // Ende des Plc1 ?
- return sal_False;
- rPlc++;
-
- if( ((sal_uInt8*)pData)[0] != 19 ){
- *pOut << "Field Error, " << (sal_uInt16)((sal_uInt8*)pData)[0] << endl1;
- return sal_True; // nicht abbrechen
- }
-
- *pOut << " " << indent1 << begin1 << "Field" << " Cp: " << hex
- << nSCode << " Typ: " << dec << (sal_uInt16)((sal_uInt8*)pData)[1] << endl1;
-
- if( !rPlc.Get( nECode, pData ) ) // Ende des Plc1 ?
- return sal_False;
-
- DumpShortPlainText( nSCode, nECode - nSCode, "Code" ); // Code, bei nested abgeschnitten
- nSRes = nECode; // Default
-
-
- while( ((sal_uInt8*)pData)[0] == 19 ){ // immer noch neue (nested) Anfaenge ?
- DumpField2( rPlc ); // nested Field im Beschreibungsteil
- if( !rPlc.Get( nSRes, pData ) ) // Ende des Plc1 ?
- return sal_False;
- }
-
- if( ((sal_uInt8*)pData)[0] == 20 ){ // Field Separator ?
- rPlc++;
- *pOut << " " << indent1 << "Field Seperator" << " Cp: " << hex << nSRes
- << ", Flags = 0x" << hex << (sal_uInt16)((sal_uInt8*)pData)[1] << dec << endl1;
- if( !rPlc.Get( nERes, pData ) ) // Ende des Plc1 ?
- return sal_False;
-
- while( ((sal_uInt8*)pData)[0] == 19 ){ // immer noch neue (nested) Anfaenge ?
- DumpField2( rPlc ); // nested Field im Resultatteil
- if( !rPlc.Get( nERes, pData ) ) // Ende des Plc1 ?
- return sal_False;
- }
- DumpShortPlainText( nSRes, nERes - nSRes, "Result" ); // Result, bei nested incl. nested Field
-
- }else{
- nERes = nSRes; // Kein Result vorhanden
- }
-
- rPlc++;
- if( ((sal_uInt8*)pData)[0] == 21 ){ // Field Ende ?
- *pOut << " " << end1 << " Field " << " Cp: " << hex << nERes
- << ", Flags = 0x" << hex << (sal_uInt16)((sal_uInt8*)pData)[1] << dec << endl1;
- }else{
- *pOut << " Unknown Field Type" << endl1;
- *pOut << " " << end1 << " Field " << endl1;
- }
-
- return sal_True;
-}
-
-static void DumpField1( WW8_FC nPos, long nLen, char* pName )
-{
- if( !nLen )
- {
- *pOut << pName << ": No Fields" << endl1 << endl1;
- return;
- }
-
- WW8PLCFspecial aPlc( &xTableStream, nPos, nLen, 2 );
-
- *pOut << hex6 << nPos << dec2 << ' ' << indent1 << begin1;
- *pOut << "Plc." << pName << ", Len: ";
- *pOut << nLen << ", ca. " << aPlc.GetIMax()/3 << " Elements"
-
- << " Idx: " << (long)aPlc.GetIdx()
- << " IMax: " << aPlc.GetIMax()
-
- << endl1;
-
-// while( DumpField2( aPlc ) ){}
- while( (long)aPlc.GetIdx() < aPlc.GetIMax() )
- {
- DumpField3( aPlc );
- aPlc++;
- }
-
- end( *pOut, *xStrm ) << "Plcx." << pName << endl1 << endl1;
-}
-
-
-//-----------------------------------------
-static void DumpFonts()
-{
- WW8Fonts aFonts( *xTableStream, *pWwFib );
-
- sal_uInt16 i;
-
- *pOut << endl1;
- *pOut << 'T' << hex6 << pWwFib->fcSttbfffn << dec2 << ' ' << indent1 << begin1 << "FFNs" << endl1;
-
- ByteString sOut;
-
- for( i=0; i<aFonts.GetMax(); i++){
- // const
- WW8_FFN* p = (WW8_FFN*)aFonts.GetFont( i );
-
- sOut = ByteString( p->sFontname, RTL_TEXTENCODING_MS_1252 );
- *pOut << "Id:" << i << " Name:\"" << sOut.GetBuffer() << '"'; // Name
- if( p->ibszAlt ) // gibt es einen alternativen Font ?
- {
- sOut = ByteString( p->sFontname.Copy( p->ibszAlt ),
- RTL_TEXTENCODING_MS_1252 );
- *pOut << ", Alternativ:" << '"' << sOut.GetBuffer() << '"';
- }
- *pOut << ", PitchRequest:" << (short)p->prg << ", TrueType:" << (short)p->fTrueType;
- *pOut << ", FontFamily:" << (short)p->ff;
- *pOut << ", BaseWeight:" << p->wWeight;
- *pOut << ", CharacterSet:" << (short)p->chs;
- *pOut << endl1;
- }
- *pOut << " " << end1 << "FFNs" << endl1 << endl1;
-}
-
-
-//-----------------------------------------
-// class DFib
-//-----------------------------------------
-
-class DFib: public WW8Fib
-{
-public:
- DFib( SvStream& rStrm, sal_uInt8 nVersion ) : WW8Fib( rStrm, nVersion ) {}
- void Dump();
-};
-
-//-----------------------------------------
-
-void DFib::Dump()
-{
- *pOut << "Adressen: FIB " << hex << 0 << ", Text "
- << fcMin << ", TextLen " << ccpText
- << ", Styles " << fcStshf << endl1;
-
- *pOut << "\twIdent: " << wIdent << endl1;
- *pOut << "\tnFib: " << nFib << endl1;
- *pOut << "\tnProduct: " << nProduct << endl1;
- *pOut << "\tlid: " << lid << endl1;
- *pOut << "\tpnNext: " << pnNext << endl1;
-
- *pOut << "\tfDot: " << (fDot ? '1' : '0') << endl1;
- *pOut << "\tfGlsy: " << (fGlsy ? '1' : '0') << endl1;
- *pOut << "\tfComplex: " << (fComplex ? '1' : '0') << endl1;
- *pOut << "\tfHasPic: " << (fHasPic ? '1' : '0') << endl1;
- *pOut << "\tcQuickSaves: " << (sal_uInt16)cQuickSaves << endl1;
- *pOut << "\tfEncrypted: " << (fEncrypted ? '1' : '0') << endl1;
- *pOut << "\tfWhichTblStm: " << (fWhichTblStm ? '1' : '0') << endl1;
- *pOut << "\tfExtChar: " << (fExtChar ? '1' : '0') << endl1;
-
- *pOut << "\tnFibBack: " << nFibBack << endl1;
- *pOut << "\tlKey1: " << lKey1 << endl1;
- *pOut << "\tlKey2: " << lKey2 << endl1;
- *pOut << "\tenvr: " << envr << endl1;
-
- *pOut << "\tfMac: " << (fMac ? '1' : '0') << endl1;
- *pOut << "\tfEmptySpecial: " << (fEmptySpecial ? '1' : '0') << endl1;
- *pOut << "\tfLoadOverridePage: " << (fLoadOverridePage ? '1' : '0') << endl1;
- *pOut << "\tfFuturesavedUndo: " << (fFuturesavedUndo ? '1' : '0') << endl1;
- *pOut << "\tfWord97Saved: " << (fWord97Saved ? '1' : '0') << endl1;
-
- *pOut << "\tchse: " << chse << endl1;
- *pOut << "\tchseTables: " << chseTables << endl1;
- *pOut << "\tfcMin: " << fcMin << endl1;
- *pOut << "\tfcMac: " << fcMac << endl1;
- *pOut << "\tcsw: " << csw << endl1;
- *pOut << "\twMagicCreated: " << wMagicCreated << endl1;
- *pOut << "\twMagicRevised: " << wMagicRevised << endl1;
- *pOut << "\twMagicCreatedPrivate: " << wMagicCreatedPrivate << endl1;
- *pOut << "\twMagicRevisedPrivate: " << wMagicRevisedPrivate << endl1;
- *pOut << "\tlidFE: " << lidFE << endl1;
- *pOut << "\tclw: " << clw << endl1;
- *pOut << "\tcbMac: " << cbMac << endl1;
- *pOut << "\tccpText: " << ccpText << endl1;
- *pOut << "\tccpFtn: " << ccpFtn << endl1;
- *pOut << "\tccpHdr: " << ccpHdr << endl1;
- *pOut << "\tccpMcr: " << ccpMcr << endl1;
- *pOut << "\tccpAtn: " << ccpAtn << endl1;
- *pOut << "\tccpEdn: " << ccpEdn << endl1;
- *pOut << "\tccpTxbx: " << ccpTxbx << endl1;
- *pOut << "\tccpHdrTxbx: " << ccpHdrTxbx << endl1;
- *pOut << "\tpnFbpChpFirst: " << pnFbpChpFirst << endl1;
- *pOut << "\tpnFbpPapFirst: " << pnFbpPapFirst << endl1;
- *pOut << "\tpnFbpLvcFirst: " << pnFbpLvcFirst << endl1;
- *pOut << "\tpnLvcFirst: " << pnLvcFirst << endl1;
- *pOut << "\tcpnBteLvc: " << cpnBteLvc << endl1;
- *pOut << "\tfcIslandFirst: " << fcIslandFirst << endl1;
- *pOut << "\tfcIslandLim: " << fcIslandLim << endl1;
- *pOut << "\tcfclcb: " << cfclcb << endl1;
- *pOut << "\tfcStshfOrig: " << fcStshfOrig << endl1;
- *pOut << "\tlcbStshfOrig: " << lcbStshfOrig << endl1;
- *pOut << "\tfcStshf: " << fcStshf << endl1;
- *pOut << "\tlcbStshf: " << lcbStshf << endl1;
- *pOut << "\tfcPlcffndRef: " << fcPlcffndRef << endl1;
- *pOut << "\tlcbPlcffndRef: " << lcbPlcffndRef << endl1;
- *pOut << "\tfcPlcffndTxt: " << fcPlcffndTxt << endl1;
- *pOut << "\tlcbPlcffndTxt: " << lcbPlcffndTxt << endl1;
- *pOut << "\tfcPlcfandRef: " << fcPlcfandRef << endl1;
- *pOut << "\tlcbPlcfandRef: " << lcbPlcfandRef << endl1;
- *pOut << "\tfcPlcfandTxt: " << fcPlcfandTxt << endl1;
- *pOut << "\tlcbPlcfandTxt: " << lcbPlcfandTxt << endl1;
- *pOut << "\tfcPlcfsed: " << fcPlcfsed << endl1;
- *pOut << "\tlcbPlcfsed: " << lcbPlcfsed << endl1;
- *pOut << "\tfcPlcfpad: " << fcPlcfpad << endl1;
- *pOut << "\tlcbPlcfpad: " << lcbPlcfpad << endl1;
- *pOut << "\tfcPlcfphe: " << fcPlcfphe << endl1;
- *pOut << "\tlcbPlcfphe: " << lcbPlcfphe << endl1;
- *pOut << "\tfcSttbfglsy: " << fcSttbfglsy << endl1;
- *pOut << "\tlcbSttbfglsy: " << lcbSttbfglsy << endl1;
- *pOut << "\tfcPlcfglsy: " << fcPlcfglsy << endl1;
- *pOut << "\tlcbPlcfglsy: " << lcbPlcfglsy << endl1;
- *pOut << "\tfcPlcfhdd: " << fcPlcfhdd << endl1;
- *pOut << "\tlcbPlcfhdd: " << lcbPlcfhdd << endl1;
- *pOut << "\tfcPlcfbteChpx: " << fcPlcfbteChpx << endl1;
- *pOut << "\tlcbPlcfbteChpx: " << lcbPlcfbteChpx << endl1;
- *pOut << "\tfcPlcfbtePapx: " << fcPlcfbtePapx << endl1;
- *pOut << "\tlcbPlcfbtePapx: " << lcbPlcfbtePapx << endl1;
- *pOut << "\tfcPlcfsea: " << fcPlcfsea << endl1;
- *pOut << "\tlcbPlcfsea: " << lcbPlcfsea << endl1;
- *pOut << "\tfcSttbfffn: " << fcSttbfffn << endl1;
- *pOut << "\tlcbSttbfffn: " << lcbSttbfffn << endl1;
- *pOut << "\tfcPlcffldMom: " << fcPlcffldMom << endl1;
- *pOut << "\tlcbPlcffldMom: " << lcbPlcffldMom << endl1;
- *pOut << "\tfcPlcffldHdr: " << fcPlcffldHdr << endl1;
- *pOut << "\tlcbPlcffldHdr: " << lcbPlcffldHdr << endl1;
- *pOut << "\tfcPlcffldFtn: " << fcPlcffldFtn << endl1;
- *pOut << "\tlcbPlcffldFtn: " << lcbPlcffldFtn << endl1;
- *pOut << "\tfcPlcffldAtn: " << fcPlcffldAtn << endl1;
- *pOut << "\tlcbPlcffldAtn: " << lcbPlcffldAtn << endl1;
- *pOut << "\tfcPlcffldMcr: " << fcPlcffldMcr << endl1;
- *pOut << "\tlcbPlcffldMcr: " << lcbPlcffldMcr << endl1;
- *pOut << "\tfcSttbfbkmk: " << fcSttbfbkmk << endl1;
- *pOut << "\tlcbSttbfbkmk: " << lcbSttbfbkmk << endl1;
- *pOut << "\tfcPlcfbkf: " << fcPlcfbkf << endl1;
- *pOut << "\tlcbPlcfbkf: " << lcbPlcfbkf << endl1;
- *pOut << "\tfcPlcfbkl: " << fcPlcfbkl << endl1;
- *pOut << "\tlcbPlcfbkl: " << lcbPlcfbkl << endl1;
- *pOut << "\tfcCmds: " << fcCmds << endl1;
- *pOut << "\tlcbCmds: " << lcbCmds << endl1;
- *pOut << "\tfcPlcfmcr: " << fcPlcfmcr << endl1;
- *pOut << "\tlcbPlcfmcr: " << lcbPlcfmcr << endl1;
- *pOut << "\tfcSttbfmcr: " << fcSttbfmcr << endl1;
- *pOut << "\tlcbSttbfmcr: " << lcbSttbfmcr << endl1;
- *pOut << "\tfcPrDrvr: " << fcPrDrvr << endl1;
- *pOut << "\tlcbPrDrvr: " << lcbPrDrvr << endl1;
- *pOut << "\tfcPrEnvPort: " << fcPrEnvPort << endl1;
- *pOut << "\tlcbPrEnvPort: " << lcbPrEnvPort << endl1;
- *pOut << "\tfcPrEnvLand: " << fcPrEnvLand << endl1;
- *pOut << "\tlcbPrEnvLand: " << lcbPrEnvLand << endl1;
- *pOut << "\tfcWss: " << fcWss << endl1;
- *pOut << "\tlcbWss: " << lcbWss << endl1;
- *pOut << "\tfcDop: " << fcDop << endl1;
- *pOut << "\tlcbDop: " << lcbDop << endl1;
- *pOut << "\tfcSttbfAssoc: " << fcSttbfAssoc << endl1;
- *pOut << "\tcbSttbfAssoc: " << cbSttbfAssoc << endl1;
- *pOut << "\tfcClx: " << fcClx << endl1;
- *pOut << "\tlcbClx: " << lcbClx << endl1;
- *pOut << "\tfcPlcfpgdFtn: " << fcPlcfpgdFtn << endl1;
- *pOut << "\tlcbPlcfpgdFtn: " << lcbPlcfpgdFtn << endl1;
- *pOut << "\tfcAutosaveSource: " << fcAutosaveSource << endl1;
- *pOut << "\tlcbAutosaveSource: " << lcbAutosaveSource << endl1;
- *pOut << "\tfcGrpStAtnOwners: " << fcGrpStAtnOwners << endl1;
- *pOut << "\tlcbGrpStAtnOwners: " << lcbGrpStAtnOwners << endl1;
- *pOut << "\tfcSttbfAtnbkmk: " << fcSttbfAtnbkmk << endl1;
- *pOut << "\tlcbSttbfAtnbkmk: " << lcbSttbfAtnbkmk << endl1;
- *pOut << "\tfcPlcfdoaMom: " << fcPlcfdoaMom << endl1;
- *pOut << "\tlcbPlcfdoaMom: " << lcbPlcfdoaMom << endl1;
- *pOut << "\tfcPlcfdoaHdr: " << fcPlcfdoaHdr << endl1;
- *pOut << "\tlcbPlcfdoaHdr: " << lcbPlcfdoaHdr << endl1;
- *pOut << "\tfcPlcfspaMom: " << fcPlcfspaMom << endl1;
- *pOut << "\tlcbPlcfspaMom: " << lcbPlcfspaMom << endl1;
- *pOut << "\tfcPlcfspaHdr: " << fcPlcfspaHdr << endl1;
- *pOut << "\tlcbPlcfspaHdr: " << lcbPlcfspaHdr << endl1;
- *pOut << "\tfcPlcfAtnbkf: " << fcPlcfAtnbkf << endl1;
- *pOut << "\tlcbPlcfAtnbkf: " << lcbPlcfAtnbkf << endl1;
- *pOut << "\tfcPlcfAtnbkl: " << fcPlcfAtnbkl << endl1;
- *pOut << "\tlcbPlcfAtnbkl: " << lcbPlcfAtnbkl << endl1;
- *pOut << "\tfcPms: " << fcPms << endl1;
- *pOut << "\tlcbPMS: " << lcbPMS << endl1;
- *pOut << "\tfcFormFldSttbf: " << fcFormFldSttbf << endl1;
- *pOut << "\tlcbFormFldSttbf: " << lcbFormFldSttbf << endl1;
- *pOut << "\tfcPlcfendRef: " << fcPlcfendRef << endl1;
- *pOut << "\tlcbPlcfendRef: " << lcbPlcfendRef << endl1;
- *pOut << "\tfcPlcfendTxt: " << fcPlcfendTxt << endl1;
- *pOut << "\tlcbPlcfendTxt: " << lcbPlcfendTxt << endl1;
- *pOut << "\tfcPlcffldEdn: " << fcPlcffldEdn << endl1;
- *pOut << "\tlcbPlcffldEdn: " << lcbPlcffldEdn << endl1;
- *pOut << "\tfcPlcfpgdEdn: " << fcPlcfpgdEdn << endl1;
- *pOut << "\tlcbPlcfpgdEdn: " << lcbPlcfpgdEdn << endl1;
- *pOut << "\tfcDggInfo: " << fcDggInfo << endl1;
- *pOut << "\tlcbDggInfo: " << lcbDggInfo << endl1;
- *pOut << "\tfcSttbfRMark: " << fcSttbfRMark << endl1;
- *pOut << "\tlcbSttbfRMark: " << lcbSttbfRMark << endl1;
- *pOut << "\tfcSttbfCaption: " << fcSttbfCaption << endl1;
- *pOut << "\tlcbSttbfCaption: " << lcbSttbfCaption << endl1;
- *pOut << "\tfcSttbAutoCaption: " << fcSttbAutoCaption << endl1;
- *pOut << "\tlcbSttbAutoCaption: " << lcbSttbAutoCaption << endl1;
- *pOut << "\tfcPlcfwkb: " << fcPlcfwkb << endl1;
- *pOut << "\tlcbPlcfwkb: " << lcbPlcfwkb << endl1;
- *pOut << "\tfcPlcfspl: " << fcPlcfspl << endl1;
- *pOut << "\tlcbPlcfspl: " << lcbPlcfspl << endl1;
- *pOut << "\tfcPlcftxbxTxt: " << fcPlcftxbxTxt << endl1;
- *pOut << "\tlcbPlcftxbxTxt: " << lcbPlcftxbxTxt << endl1;
- *pOut << "\tfcPlcffldTxbx: " << fcPlcffldTxbx << endl1;
- *pOut << "\tlcbPlcffldTxbx: " << lcbPlcffldTxbx << endl1;
- *pOut << "\tfcPlcfHdrtxbxTxt: " << fcPlcfHdrtxbxTxt << endl1;
- *pOut << "\tlcbPlcfHdrtxbxTxt: " << lcbPlcfHdrtxbxTxt << endl1;
- *pOut << "\tfcPlcffldHdrTxbx: " << fcPlcffldHdrTxbx << endl1;
- *pOut << "\tlcbPlcffldHdrTxbx: " << lcbPlcffldHdrTxbx << endl1;
- *pOut << "\tfcPlcfLst: " << fcPlcfLst << endl1;
- *pOut << "\tlcbPlcfLst: " << lcbPlcfLst << endl1;
- *pOut << "\tfcPlfLfo: " << fcPlfLfo << endl1;
- *pOut << "\tlcbPlfLfo: " << lcbPlfLfo << endl1;
- *pOut << "\tfcPlcftxbxBkd: " << fcPlcftxbxBkd << endl1;
- *pOut << "\tlcbPlcftxbxBkd: " << lcbPlcftxbxBkd << endl1;
- *pOut << "\tfcPlcfHdrtxbxBkd: " << fcPlcfHdrtxbxBkd << endl1;
- *pOut << "\tlcbPlcfHdrtxbxBkd: " << lcbPlcfHdrtxbxBkd << endl1;
- *pOut << "\tfcSttbListNames: " << fcSttbListNames << endl1;
- *pOut << "\tlcbSttbListNames: " << lcbSttbListNames << endl1;
-
- *pOut << "\tpnChpFirst: " << pnChpFirst << endl1;
- *pOut << "\tpnPapFirst: " << pnPapFirst << endl1;
- *pOut << "\tcpnBteChp: " << cpnBteChp << endl1;
- *pOut << "\tcpnBtePap: " << cpnBtePap << endl1;
-
-
- *pOut << dec << "END FIB" << endl1 << endl1;
-}
-
-//-----------------------------------------
-// class DStyle
-//-----------------------------------------
-
-class DStyle: public WW8Style
-{
- sal_uInt8 nVersion;
-public:
- DStyle( SvStream& rStream, WW8Fib& rFib )
- : WW8Style( rStream, rFib ){ nVersion = rFib.nVersion; }
- void Dump1Style( sal_uInt16 nNr );
- void Dump();
-};
-
-//-----------------------------------------
-// universelle Hilfsroutinen
-//-----------------------------------------
-
-static void DumpIt( SvStream& rSt, short nLen )
-{
- indent( *pOut, rSt );
- if( nLen <= 0 ){
- *pOut << endl1;
- return;
- }
- while ( nLen ){
- sal_uInt8 c;
- xStrm->Read( &c, sizeof(c) );
- *pOut << "<0x" << hex2 << (sal_uInt16)c << dec2 << "> ";
- nLen--;
- }
- *pOut << endl1;
-}
-
-static void DumpItSmall( SvStream& rStrm, short nLen )
-{
- if( nLen <= 0 )
- return;
-
- while ( nLen )
- {
- sal_uInt8 c;
-
- rStrm.Read( &c, sizeof(c) );
-
- if( c <= 9 )
- *pOut << (sal_uInt16)c;
- else
- *pOut << "0x" << hex2 << (sal_uInt16)c << dec2;
-
- nLen--;
-
- if( nLen )
- *pOut << ',';
- }
-}
-
-static short DumpSprm( sal_uInt8 nVersion, SvStream& rSt, short nSprmsLen )
-{
- long nSprmPos = rSt.Tell();
- sal_uInt8 nDelta;
-
- indent( *pOut, rSt );
-
- sal_uInt8 x[512];
- rSt.Read( x, 512 ); // Token und folgende lesen
-
- sal_uInt16 nId = WW8GetSprmId( nVersion, x, &nDelta );
-
- short nSprmL = WW8GetSprmSizeBrutto( nVersion, x, &nId );
- short nSprmNL = WW8GetSprmSizeNetto( nVersion, x, &nId );
-
- nSprmsLen -= nSprmL;
- if( nSprmsLen < 0 )
- *pOut << "!UEberhang um " << -nSprmsLen << " Bytes!" << endl1;
-
- // Ausgabe: Token in Dez
- if( 8 > nVersion )
- *pOut << (sal_uInt16)x[0];
- else
- *pOut << hex << nId << dec;
- *pOut << '/' << nSprmL; // Laenge incl. alles in Dez
- *pOut << '/' << nSprmNL; // Laenge excl Token in Dez
-
-
- const SprmDumpInfo& rSprm = WW8GetSprmDumpInfo( nId );
-
- *pOut << " = " << rSprm.pName << ' ';
-
- rSt.Seek( nSprmPos + 1 + nDelta + WW8SprmDataOfs( nId ) );// gehe zum eigentlichen
- // Inhalt
- if( rSprm.pOutFnc )
- rSprm.pOutFnc( rSt, nSprmNL ); // Rufe Ausgabefunktion
- else
- DumpItSmall( rSt, nSprmNL ); // oder Dumper
- *pOut << endl1;
-
- return nSprmsLen;
-}
-
-void DumpSprms( sal_uInt8 nVersion, SvStream& rSt, short nLen )
-{
- if( nLen <= 1 || rSt.IsEof() ){
- return;
- }
- begin( *pOut, rSt ) << "Sprms" << endl1;
- while ( nLen > 1 )
- {
- nLen = DumpSprm( nVersion, rSt, nLen );
- }
- end( *pOut, rSt ) << "Sprms" << endl1;
-}
-
-// DumpMemSprm() dumpt ein 2-Byte-Sprm, der im WW8_PCD eingebaut ist
-static void DumpMemSprm( sal_uInt8 nVersion, sal_Int16* pSprm )
-{
- sal_uInt8* p = (sal_uInt8*)pSprm;
- sal_uInt16 nId = WW8GetSprmId( nVersion, p, 0 );
-
- *pOut << (sal_uInt16)p[0]; // Ausgabe: Token in Dez
- *pOut << '/' << WW8GetSprmSizeBrutto( nVersion, p, &nId ); // Laenge incl. alles in Dez
- *pOut << '/' << WW8GetSprmSizeNetto( nVersion, p, &nId ); // Laenge excl Token in Dez
-
- *pOut << " = " << WW8GetSprmDumpInfo( nId ).pName;
-
- *pOut << " 0x" << hex2 << *(p + 1);
-}
-
-
-//-----------------------------------------
-// Hilfsroutinen: SEPX
-//-----------------------------------------
-void DumpSepx( sal_uInt8 nVersion, long nPos )
-{
- sal_uInt16 nLen;
- xStrm->Seek( nPos );
- begin( *pOut, *xStrm ) << "Sepx, Len: ";
- xStrm->Read( &nLen, 2 );
- *pOut << nLen << endl1;
-
- DumpSprms( nVersion, *xStrm, nLen );
-
- end( *pOut, *xStrm ) << "Sepx" << endl1;
-}
-
-
-//-----------------------------------------
-// Hilfsroutinen: FKP.CHPX, FKP.PAPX
-//-----------------------------------------
-static void DumpPhe( WW8_PHE_Base& rPhe )
-{
- if( rPhe.aBits1 == 0 && rPhe.nlMac == 0
- && SVBT16ToShort( rPhe.dxaCol ) == 0
- && SVBT16ToShort( rPhe.dyl ) == 0 )
- {
- *pOut << indent2 << " empty PHE" << endl1;
- }
- else
- {
- *pOut << begin2 << "PHE" << endl1;
- *pOut << indent2 << "fSpare: " << ( rPhe.aBits1 & 0x1 );
- *pOut << ", fUnk: " << (( rPhe.aBits1 >> 1 ) & 1 );
- *pOut << ", fDiffLines: " << (( rPhe.aBits1 >> 2 ) & 1 );
- *pOut << ", unused: " << (( rPhe.aBits1 >> 3 ) & 0x1F )
- << " (" << (short)(( rPhe.aBits1 >> 2 ) & 0x3F ) +
- (((short)rPhe.nlMac) << 8)
- << ")";
- *pOut << ", nLines: " << (short)rPhe.nlMac << ',' << endl1;
- *pOut << indent2 << "dxaCol: " << (short)SVBT16ToShort( rPhe.dxaCol );
- if( rPhe.aBits1 & 0x4 )
- {
- *pOut << ", total height: " << (sal_uInt16)SVBT16ToShort( rPhe.dyl );
- }
- else
- {
- *pOut << ", height per line: " << (short)SVBT16ToShort( rPhe.dyl );
- *pOut << ", total height: " << rPhe.nlMac * (short)SVBT16ToShort( rPhe.dyl );
- }
- *pOut << endl1;
- *pOut << end2 << "PHE" << endl1;
- }
-}
-
-//typedef enum{ CHP=0, PAP, SEP, PLC_END }ePlcT;
-static char* NameTab[PLCF_END+4]={ "chpx", "papx", "sepx", "head",
- "FootnoteRef", "EndnoteRef",
- "AnnotationRef" };
-
-void DumpFkp( sal_uInt8 nVersion, long nPos, short nItemSize, ePLCFT ePlc )
-{
- char nElem;
-
- xStrm->Seek( nPos+511 );
- xStrm->Read( &nElem, 1 );
-
-
- *pOut << 'D' << hex6 << nPos << dec2 << ' ' << indent1 << begin1 << "Fkp.";
- *pOut << NameTab[ePlc] << ", ";
- *pOut << (sal_uInt16)nElem << " Elements" << endl1;
-
- int i;
- WW8_FC aF[2];
- sal_uInt8 c;
- long nStartOfs = nPos + ( nElem + 1 ) * 4; // bei dieser Pos faengt Offset-Array an
- short nOfs;
- WW8_PHE_Base aPhe;
-
- for( i=0; i<nElem; i++ )
- {
- xStrm->Seek( nPos + i * 4 );
- indent( *pOut, *xStrm );
- xStrm->Read( aF, sizeof( aF ) ); // lese 2 FCs
-
- xStrm->Seek( nStartOfs + i * nItemSize );
- xStrm->Read( &c, 1 ); // lese Word Offset ( evtl. Teil von BX )
- if( ePlc == PAP )
- xStrm->Read( &aPhe, sizeof( aPhe ) );
-
- nOfs= c * 2; // -> Byte Offset
- xStrm->Seek( nPos + nOfs );
- xStrm->Read( &c, 1 );
-
- if( !c )
- xStrm->Read( &c, 1 );
-
- *pOut << "Fc: " << hex << aF[0] << ".." << aF[1];
- *pOut << " Cp: " << pSBase->WW8Fc2Cp( aF[0] )
- << ".." << pSBase->WW8Fc2Cp( aF[1] );
- *pOut << " Offset: " << nOfs << dec2;
- if ( nOfs )
- {
- switch ( ePlc )
- {
- case CHP:
- *pOut << ", Len: " << (short)c << endl1;
- DumpSprms( nVersion, *xStrm, (short)c );
- break;
-
- case PAP:
- short nLen = c * 2; // So weit bis zum naechsten !
-
- short nIStd;
-
- WW8ReadINT16( *xStrm, nIStd );
-
- *pOut << ", Len max: " << nLen << ", ID:" << nIStd << endl1;
- DumpSprms( nVersion, *xStrm, nLen - 2 );
- DumpPhe( aPhe );
- break;
- }
- }
- else
- {
- *pOut << dec2 << " No attribute" << endl1;
- }
-
- }
- end( *pOut, *xStrm ) << "Fkp." << NameTab[ePlc] << endl1;
-}
-
-//-----------------------------------------
-// WW8_DOP ( Document Properties )
-//-----------------------------------------
-
-//!!! WW8LoadDop gibt's jetzt auch in WW8scan.cxx
-void DumpDop( WW8Fib& rFib )
-{
- // nicht loeschen!
- xTableStream->Seek( rFib.fcDop ); // diese Aktion dient lediglich dazu, die
- // Positions-Ausgabe der folgenden Anweisung
- // mit dem alten Dumper uebereinstimmen zu lassen.
-
-// *pOut << begin( *pOut, *xTableStream ) << "Dop, Size " << rFib.lcbDop << ", DefaultSize 84" << endl1;
- begin( *pOut, *xTableStream ) << "Dop, Size " << rFib.lcbDop << ", DefaultSize 84" << endl1;
-
- WW8Dop* pD = new WW8Dop( *xTableStream, rFib.nFib, rFib.fcDop, rFib.lcbDop );
-
- *pOut << indent2 << "fFacingPages : " << pD->fFacingPages << endl1;
- *pOut << indent2 << "fWidowControl : " << pD->fWidowControl << endl1;
- *pOut << indent2 << "fPMHMainDoc : " << pD->fPMHMainDoc << endl1;
- *pOut << indent2 << "grfSuppression : " << pD->grfSuppression << endl1;
- *pOut << indent2 << "fpc : " << pD->fpc << endl1;
- *pOut << indent2 << "grpfIhdt : " << pD->grpfIhdt << endl1;
- *pOut << indent2 << "rncFtn : " << pD->rncFtn << endl1;
- *pOut << indent2 << "nFtn : " << pD->nFtn << endl1;
- *pOut << indent2 << "fOutlineDirtySave : " << pD->fOutlineDirtySave << endl1;
- *pOut << indent2 << "fOnlyMacPics : " << pD->fOnlyMacPics << endl1;
- *pOut << indent2 << "fOnlyWinPics : " << pD->fOnlyWinPics << endl1;
- *pOut << indent2 << "fLabelDoc : " << pD->fLabelDoc << endl1;
- *pOut << indent2 << "fHyphCapitals : " << pD->fHyphCapitals << endl1;
- *pOut << indent2 << "fAutoHyphen : " << pD->fAutoHyphen << endl1;
- *pOut << indent2 << "fFormNoFields : " << pD->fFormNoFields << endl1;
- *pOut << indent2 << "fLinkStyles : " << pD->fLinkStyles << endl1;
- *pOut << indent2 << "fRevMarking : " << pD->fRevMarking << endl1;
- *pOut << indent2 << "fBackup : " << pD->fBackup << endl1;
- *pOut << indent2 << "fExactCWords : " << pD->fExactCWords << endl1;
- *pOut << indent2 << "fPagHidden : " << pD->fPagHidden << endl1;
- *pOut << indent2 << "fPagResults : " << pD->fPagResults << endl1;
- *pOut << indent2 << "fLockAtn : " << pD->fLockAtn << endl1;
- *pOut << indent2 << "fMirrorMargins : " << pD->fMirrorMargins << endl1;
- *pOut << indent2 << "fReadOnlyRecommended : " << pD->fReadOnlyRecommended << endl1;
- *pOut << indent2 << "fDfltTrueType : " << pD->fDfltTrueType << endl1;
- *pOut << indent2 << "fPagSuppressTopSpacing : " << pD->fPagSuppressTopSpacing << endl1;
- *pOut << indent2 << "fProtEnabled : " << pD->fProtEnabled << endl1;
- *pOut << indent2 << "fDispFormFldSel : " << pD->fDispFormFldSel << endl1;
- *pOut << indent2 << "fRMView : " << pD->fRMView << endl1;
- *pOut << indent2 << "fRMPrint : " << pD->fRMPrint << endl1;
- *pOut << indent2 << "fWriteReservation : " << pD->fWriteReservation << endl1;
- *pOut << indent2 << "fLockRev : " << pD->fLockRev << endl1;
- *pOut << indent2 << "fEmbedFonts : " << pD->fEmbedFonts << endl1;
- *pOut << indent2 << "copts_fNoTabForInd : " << pD->copts_fNoTabForInd << endl1;
- *pOut << indent2 << "copts_fNoSpaceRaiseLower : " << pD->copts_fNoSpaceRaiseLower << endl1;
- *pOut << indent2 << "copts_fSupressSpbfAfterPgBrk : " << pD->copts_fSupressSpbfAfterPgBrk << endl1;
- *pOut << indent2 << "copts_fWrapTrailSpaces : " << pD->copts_fWrapTrailSpaces << endl1;
- *pOut << indent2 << "copts_fMapPrintTextColor : " << pD->copts_fMapPrintTextColor << endl1;
- *pOut << indent2 << "copts_fNoColumnBalance : " << pD->copts_fNoColumnBalance << endl1;
- *pOut << indent2 << "copts_fConvMailMergeEsc : " << pD->copts_fConvMailMergeEsc << endl1;
- *pOut << indent2 << "copts_fSupressTopSpacing : " << pD->copts_fSupressTopSpacing << endl1;
- *pOut << indent2 << "copts_fOrigWordTableRules : " << pD->copts_fOrigWordTableRules << endl1;
- *pOut << indent2 << "copts_fTransparentMetafiles : " << pD->copts_fTransparentMetafiles << endl1;
- *pOut << indent2 << "copts_fShowBreaksInFrames : " << pD->copts_fShowBreaksInFrames << endl1;
- *pOut << indent2 << "copts_fSwapBordersFacingPgs : " << pD->copts_fSwapBordersFacingPgs << endl1;
- *pOut << indent2 << "dxaTab : " << pD->dxaTab << endl1;
- *pOut << indent2 << "wSpare : " << pD->wSpare << endl1;
- *pOut << indent2 << "dxaHotZ : " << pD->dxaHotZ << endl1;
- *pOut << indent2 << "cConsecHypLim : " << pD->cConsecHypLim << endl1;
- *pOut << indent2 << "wSpare2 : " << pD->wSpare2 << endl1;
- *pOut << indent2 << "dttmCreated : " << pD->dttmCreated << endl1;
- *pOut << indent2 << "dttmRevised : " << pD->dttmRevised << endl1;
- *pOut << indent2 << "dttmLastPrint : " << pD->dttmLastPrint << endl1;
- *pOut << indent2 << "nRevision : " << pD->nRevision << endl1;
- *pOut << indent2 << "tmEdited : " << pD->tmEdited << endl1;
- *pOut << indent2 << "cWords : " << pD->cWords << endl1;
- *pOut << indent2 << "cCh : " << pD->cCh << endl1;
- *pOut << indent2 << "cPg : " << pD->cPg << endl1;
- *pOut << indent2 << "cParas : " << pD->cParas << endl1;
- *pOut << indent2 << "rncEdn : " << pD->rncEdn << endl1;
- *pOut << indent2 << "nEdn : " << pD->nEdn << endl1;
- *pOut << indent2 << "epc : " << pD->epc << endl1;
- *pOut << indent2 << "fPrintFormData : " << pD->fPrintFormData << endl1;
- *pOut << indent2 << "fSaveFormData : " << pD->fSaveFormData << endl1;
- *pOut << indent2 << "fShadeFormData : " << pD->fShadeFormData << endl1;
- *pOut << indent2 << "fWCFtnEdn : " << pD->fWCFtnEdn << endl1;
- *pOut << indent2 << "cLines : " << pD->cLines << endl1;
- *pOut << indent2 << "cWordsFtnEnd : " << pD->cWordsFtnEnd << endl1;
- *pOut << indent2 << "cChFtnEdn : " << pD->cChFtnEdn << endl1;
- *pOut << indent2 << "cPgFtnEdn : " << pD->cPgFtnEdn << endl1;
- *pOut << indent2 << "cParasFtnEdn : " << pD->cParasFtnEdn << endl1;
- *pOut << indent2 << "cLinesFtnEdn : " << pD->cLinesFtnEdn << endl1;
- *pOut << indent2 << "lKeyProtDoc : " << pD->lKeyProtDoc << endl1;
- *pOut << indent2 << "wvkSaved : " << pD->wvkSaved << endl1;
- *pOut << indent2 << "wScaleSaved : " << pD->wScaleSaved << endl1;
- *pOut << indent2 << "zkSaved : " << pD->zkSaved << endl1;
- *pOut << indent2 << "fNoTabForInd : " << pD->fNoTabForInd << endl1;
- *pOut << indent2 << "fNoSpaceRaiseLower : " << pD->fNoSpaceRaiseLower << endl1;
- *pOut << indent2 << "fSupressSpbfAfterPageBreak : " << pD->fSupressSpbfAfterPageBreak << endl1;
- *pOut << indent2 << "fWrapTrailSpaces : " << pD->fWrapTrailSpaces << endl1;
- *pOut << indent2 << "fMapPrintTextColor : " << pD->fMapPrintTextColor << endl1;
- *pOut << indent2 << "fNoColumnBalance : " << pD->fNoColumnBalance << endl1;
- *pOut << indent2 << "fConvMailMergeEsc : " << pD->fConvMailMergeEsc << endl1;
- *pOut << indent2 << "fSupressTopSpacing : " << pD->fSupressTopSpacing << endl1;
- *pOut << indent2 << "fOrigWordTableRules : " << pD->fOrigWordTableRules << endl1;
- *pOut << indent2 << "fTransparentMetafiles : " << pD->fTransparentMetafiles << endl1;
- *pOut << indent2 << "fShowBreaksInFrames : " << pD->fShowBreaksInFrames << endl1;
- *pOut << indent2 << "fSwapBordersFacingPgs : " << pD->fSwapBordersFacingPgs << endl1;
- *pOut << indent2 << "fSuppressTopSpacingMac5 : " << pD->fSuppressTopSpacingMac5 << endl1;
- *pOut << indent2 << "fTruncDxaExpand : " << pD->fTruncDxaExpand << endl1;
- *pOut << indent2 << "fPrintBodyBeforeHdr : " << pD->fPrintBodyBeforeHdr << endl1;
- *pOut << indent2 << "fNoLeading : " << pD->fNoLeading << endl1;
- *pOut << indent2 << "fMWSmallCaps : " << pD->fMWSmallCaps << endl1;
-
- *pOut << indent2 << "adt : " << pD->adt << endl1;
-
- *pOut << indent2 << "lvl : " << pD->lvl << endl1;
- *pOut << indent2 << "fHtmlDoc : " << pD->fHtmlDoc << endl1;
- *pOut << indent2 << "fSnapBorder : " << pD->fSnapBorder << endl1;
- *pOut << indent2 << "fIncludeHeader : " << pD->fIncludeHeader << endl1;
- *pOut << indent2 << "fIncludeFooter : " << pD->fIncludeFooter << endl1;
- *pOut << indent2 << "fForcePageSizePag : " << pD->fForcePageSizePag << endl1;
- *pOut << indent2 << "fMinFontSizePag : " << pD->fMinFontSizePag << endl1;
-
- *pOut << indent2 << "fHaveVersions : " << pD->fHaveVersions << endl1;
- *pOut << indent2 << "fAutoVersion : " << pD->fAutoVersion << endl1;
- *pOut << indent2 << "cChWS : " << pD->cChWS << endl1;
- *pOut << indent2 << "cChWSFtnEdn : " << pD->cChWSFtnEdn << endl1;
- *pOut << indent2 << "grfDocEvents : " << pD->grfDocEvents << endl1;
- *pOut << indent2 << "cDBC : " << pD->cDBC << endl1;
- *pOut << indent2 << "cDBCFtnEdn : " << pD->cDBCFtnEdn << endl1;
- *pOut << indent2 << "nfcFtnRef : " << pD->nfcFtnRef << endl1;
- *pOut << indent2 << "nfcEdnRef : " << pD->nfcEdnRef << endl1;
- *pOut << indent2 << "hpsZoonFontPag : " << pD->hpsZoonFontPag << endl1;
- *pOut << indent2 << "dywDispPag : " << pD->dywDispPag << endl1;
-
- end( *pOut, *xStrm ) << "Dop" << endl1 << endl1;
-
- DELETEZ( pD );
-}
-
-//-----------------------------------------
-// PLCF.PCD ( Piece Table )
-//-----------------------------------------
-
-#ifdef __WW8_NEEDS_PACK
-# pragma pack(2)
-#endif
-
-struct WW8_PCD1
-{
- sal_uInt8 aBits1;
- sal_uInt8 aBits2;
-// sal_Int16 fNoParaLast : 1; // when 1, means that piece contains no end of parag
-// sal_uInt8 fPaphNil : 1; // used internally by Word
-// sal_uInt8 fCopied : 1; // used internally by Word
- // * int :5
-// sal_uInt8 aBits2; // fn int:8, used internally by Word
- sal_Int32 fc; // file offset of beginning of piece. The size of th
- sal_Int16 prm; // PRM contains either a single sprm or else an inde
-};
-
-#ifdef __WW8_NEEDS_PACK
-# pragma pack()
-#endif
-
-static void DumpPLCFPcd( sal_uInt8 nVersion, long nPos, long nLen )
-{
- WW8PLCF aPlc( &xTableStream, nPos , nLen, 8 );
-
- *pOut << 'D' << hex6 << nPos << dec2 << ' ' << indent1 << begin1;
- *pOut << "Plcx.Pcd, Len: ";
- *pOut << nLen << ", " << aPlc.GetIMax() << " Elements" << endl1;
-
- int i;
- for( i=0; i<aPlc.GetIMax(); i++ )
- {
- long start, ende;
- void* pData;
- aPlc.Get( start, ende, pData );
- *pOut << indent2 << " Cp: " << hex6 << start << ".." << hex6 << ende;
-
- WW8_PCD1* p = (WW8_PCD1*) pData;
- *pOut << ", Bits: " << hex2 << (sal_uInt16)p->aBits1 << ' '
- << hex2 << (sal_uInt16)p->aBits2;
- *pOut << ", FcStart: ";
- if( 8 <= nVersion )
- {
- sal_Bool bUniCode;
- *pOut << hex6
- << WW8PLCFx_PCD::TransformPieceAddress( p->fc, bUniCode );
- if( bUniCode )
- *pOut << " (UniCode)";
- }
- else
- *pOut << hex6 << p->fc;
-
- *pOut << dec << ", prm ";
- if( p->prm & 0x1 ){
- *pOut << "No: " << ( p->prm >> 1 );
- }else if ( p-> prm == 0 ){
- *pOut << "-";
- }else{
- *pOut << "(Sprm): ";
- DumpMemSprm( nVersion, &(p->prm) );
- }
- *pOut << endl1;
-
- aPlc++;
- }
- end( *pOut, *xTableStream ) << "Plcx.Pcd" << endl1;
-}
-
-static void DumpPcd( sal_uInt8 nVersion, long nPos, long nLen )
-{
- long nLen1 = nLen;
- xTableStream->Seek( nPos );
-
- *pOut << 'D' << hex6 << nPos << dec2 << ' ' << indent1 << begin1;
- *pOut << "PieceTable, Len: " << nLen << endl1;
- if( sizeof( WW8_PCD1 ) != 8 )
- *pOut << "!!! Alignment-Problem !!! sizeof( WW8_PCD1 ) != 8 !!! " << endl1;
-
- long i = 0;
- while (1){
- sal_uInt8 c;
- sal_Int16 cb;
-
- xTableStream->Read( &c, 1 );
- nLen1 --;
- if( c == 2 )
- break;
- xTableStream->Read( &cb, 2 );
- nLen1 -= 2;
- indent( *pOut, *xTableStream ) << "grpprl No. " << i << ", Len: " << cb << endl1;
-
- long nPos = xTableStream->Tell();
- DumpSprms( nVersion, *xTableStream, cb ); // Dumpe Sprms
- xTableStream->Seek( nPos + cb ); // gehe hinter grpprl
- nLen1 -= cb;
- i++;
-// *pOut << " " << indent1 << "grpprl: " << cb << "Bytes ueberlesen";
-// *pOut << endl1;
- }
- sal_Int32 nLen2;
- xTableStream->Read( &nLen2, 4 );
- nLen1 -= 4;
- if( nLen1 != nLen2 )
- *pOut << "!!! nLen1 ( " << nLen1 << " ) != nLen2 ( " << nLen2 << " ) !"
- << endl1;
-
- DumpPLCFPcd( nVersion, xTableStream->Tell(), nLen2 );
-
- end( *pOut, *xTableStream ) << "PieceTable" << endl1 << endl1;
-}
-
-//-----------------------------------------
-// PLCF.CHPX, PLCF.PAPX, PLCF.SEPX
-//-----------------------------------------
-
-static void DumpPLCF( long nPos, long nLen, ePLCFT ePlc )
-{
- static int __READONLY_DATA WW8FkpSizeTabVer6[ PLCF_END ] = {
- 1, 7, 0 /*, 0, 0, 0*/ };
- static int __READONLY_DATA PlcSizeTabVer6[ PLCF_END+4 ] = {
- 2, 2, 12, 0, 2, 2, 20 };
-
- static int __READONLY_DATA WW8FkpSizeTabVer8[ PLCF_END ] = {
- 1, 13, 0 /*, 0, 0, 0*/ };
- static int __READONLY_DATA PlcSizeTabVer8[ PLCF_END+4 ] = {
- 4, 4, 12, 0, 2, 2, 30 };
-
- const int* pFkpSizeTab;
- const int* pPlcSizeTab;
-
- switch( pWwFib->nVersion )
- {
- case 6:
- case 7: pFkpSizeTab = WW8FkpSizeTabVer6;
- pPlcSizeTab = PlcSizeTabVer6;
- break;
- case 8: pFkpSizeTab = WW8FkpSizeTabVer8;
- pPlcSizeTab = PlcSizeTabVer8;
- break;
- default:// Programm-Fehler!
- /*
- ACHTUNG: im FILTER nicht "sal_False" sondern "!this()" schreiben,
- da sonst Warning unter OS/2
- */
- ASSERT( sal_False, "Es wurde vergessen, nVersion zu kodieren!" );
- return;
- }
-
-// SvStream* pSt = (SEP == ePlc) ? &xTableStream : &xStrm;
- SvStream* pSt = &xTableStream;
-
- WW8PLCF aPlc( pSt, nPos, nLen, pPlcSizeTab[ ePlc ] );
-
- *pOut << 'T' << hex6 << nPos << dec2 << ' ' << indent1 << begin1;
- *pOut << "Plcx." << NameTab[ePlc] << ", Len: ";
- *pOut << nLen << ", " << aPlc.GetIMax() << " Elements" << endl1;
-
- int i;
- for( i=0; i<aPlc.GetIMax(); i++ )
- {
- long start, ende;
- void* pData;
- aPlc.Get( start, ende, pData );
- *pOut << indent2 << "Plcx." << NameTab[ePlc];
- switch( ePlc ){
- case SEP: {
- *pOut << " Cp: " << hex << start << ".." << ende ;
- long nPo = *((long*)((char*)pData+2));
- if( nPo == 0xffffffffL )
- {
- *pOut << " Empty" << endl1;
- }
- else
- {
- *pOut << ", Sepx-Position: " << nPo << dec << endl1;
- DumpSepx( pWwFib->nVersion, nPo );
- }
- }
- break;
- case CHP:
- case PAP: {
- *pOut << " Fc: " << hex << start << ".." << ende ;
- long nPo;
- switch( pWwFib->nVersion )
- {
- case 6:
- case 7: nPo = *((sal_uInt16*)pData);
- break;
- case 8: nPo = *((sal_uInt32*)pData);
- break;
- default:// Programm-Fehler!
- /*
- ACHTUNG: im FILTER nicht "sal_False" sondern "!this()" schreiben,
- da sonst Warning unter OS/2
- */
- ASSERT( sal_False, "Es wurde vergessen, nVersion zu kodieren!" );
- return;
- }
-
- nPo <<= 9;
- *pOut << ", Offset: " << nPo << dec << endl1;
- DumpFkp( pWwFib->nVersion, nPo, pFkpSizeTab[ ePlc ], ePlc );
- }
- break;
-
- case PLCF_END+0:
- *pOut << " Cp: " << hex << start << ".." << ende << dec << endl1;
- break;
-
- case PLCF_END+1:
- case PLCF_END+2:
- {
- *pOut << " Cp: " << hex << start;
- sal_uInt16 nFlags= *((sal_uInt16*)pData);
- *pOut << ", Flags: 0x" << nFlags << dec << endl1;
- }
- break;
-
- case PLCF_END+3:
- {
- *pOut << " Cp: " << hex << start << ", Initial: \"";
- const char* p = (char*)pData;
- sal_uInt8 n = *p++;
- while( n-- )
- {
- if( 8 == pWwFib->nVersion )
- ++p;
- *pOut << *p++;
- }
-
- long nBkmkId;
- sal_uInt16 nId;
- if( 8 == pWwFib->nVersion )
- {
- nId = SVBT16ToShort( ((WW8_ATRD*)pData)->ibst );
- nBkmkId = SVBT32ToUInt32( ((WW8_ATRD*)pData)->ITagBkmk );
- }
- else
- {
- nId = SVBT16ToShort( ((WW67_ATRD*)pData )->ibst );
- nBkmkId = SVBT32ToUInt32( ((WW67_ATRD*)pData )->ITagBkmk );
- }
-
- *pOut << "\", AutorId: " << hex << nId
- << " BkmkId: " << nBkmkId << dec <<endl1;
- }
- break;
-
- }
- aPlc++;
- }
- end( *pOut, *xTableStream ) << "Plcx." << NameTab[ePlc] << endl1 << endl1;
-}
-
-//-----------------------------------------
-// Text ohne Attribute
-//-----------------------------------------
-
-static void DumpPlainText1( WW8_CP nStartCp, long nTextLen )
-{
- long l;
- sal_uInt8 c;
-
-
- xStrm->Seek( pSBase->WW8Cp2Fc( nStartCp ) );
-
- for (l=0; l<nTextLen; l++)
- {
- xStrm->Read( &c, sizeof(c) );
- if ( DumpChar( c ) )
- {
- *pOut << endl1;
- indent( *pOut, *xStrm );
- }
-// DumpChar( c );
- }
-}
-
-void DumpShortPlainText( WW8_CP nStartCp, long nTextLen, char* pName )
-{
- indent( *pOut, *xStrm ) << pName << " PlainText: Cp: "
- << hex << nStartCp
- << ".." << nStartCp + nTextLen << dec
- << " :\"";
- DumpPlainText1( nStartCp, nTextLen );
- *pOut << "\"" << endl1;
-}
-
-void DumpPlainText( WW8_CP nStartCp, long nTextLen, char* pName )
-{
- begin( *pOut, *xStrm ) << pName << " Text: Cp: " << hex << nStartCp
- << ".." << nStartCp + nTextLen << dec
- << endl1;
- indent( *pOut, *xStrm );
- DumpPlainText1( nStartCp, nTextLen );
- *pOut << endl1;
- end( *pOut, *xStrm ) << pName << " Text" << endl1;
-}
-
-//-----------------------------------------
-// Text mit Attributen
-//-----------------------------------------
-
-sal_Bool DumpChar( sal_uInt8 c )
-{
- if ( ( c >= 32 ) && ( c <= 127 ) ){
- *pOut << c;
- return sal_False;
- }else{
- switch (c){
- case 0xe4: // dt. Umlaute
- case 0xf6:
- case 0xfc:
- case 0xdf:
- case 0xc4:
- case 0xd6:
- case 0xdc: *pOut << c; return sal_False;
-
- case 0xd: *pOut << "<CR>";
- return sal_True;
- case 0x7:
- case 0xc: *pOut << "<0x" << hex2 << (sal_uInt16)c << dec2 << '>';
- return sal_True;
- default: *pOut << "<0x" << hex2 << (sal_uInt16)c << dec2 << '>';
- return sal_False;
- }
- }
-}
-
-//-----------------------------------------
-// Header / Footer
-//-----------------------------------------
-
-static void DumpPlcText( WW8_FC nPos, long nLen, long nOfs,
- char* pName, WW8ScannerBase* pBase,
- long nStruct = 0, FNDumpData pOutFnc = 0 )
-{
- if( !nLen ) return;
-
- WW8PLCF aPlc( &xTableStream, nPos , nLen, nStruct );
-
- *pOut << 'T' << hex6 << nPos << dec2 << ' ' << indent1 << begin1;
- *pOut << "Plc." << pName << " Text, Len: ";
- *pOut << nLen << ", " << aPlc.GetIMax() << " Elements" << endl1;
-
- int i;
- for( i=0; i < aPlc.GetIMax(); ++i )
- {
- WW8_CP start, ende;
- WW8_FC start2, ende2;
- void* pData;
- aPlc.Get( start, ende, pData );
- start2 = pSBase->WW8Cp2Fc(start + nOfs );
- ende2 = pSBase->WW8Cp2Fc(ende + nOfs );
-
- *pOut << " " << indent1 << "Plcx." << pName;
- *pOut << " Cp: " << hex << start << ".." << ende;
- *pOut << " entspricht Fc: " << start2 << ".." << ende2 << dec << endl1;
-
- DumpPlainText( nOfs + start, ende - start - 1, pName );
-
- if( pOutFnc )
- (*pOutFnc)( pData );
- aPlc++;
- }
- end( *pOut, *xTableStream ) << "Plcx." << pName << endl1 << endl1;
-}
-
-void DumpHeader( WW8ScannerBase* pBase )
-{
- DumpPlcText( pWwFib->fcPlcfhdd,
- pWwFib->lcbPlcfhdd,
- pWwFib->ccpText + pWwFib->ccpFtn,
- "Header/Footer", pBase );
-}
-
-static void DumpFootnotes( WW8ScannerBase* pBase )
-{
- if( !pWwFib->lcbPlcffndRef ){
- *pOut << "No Footnotes" << endl1 << endl1;
- return;
- }
-
- DumpPLCF( pWwFib->fcPlcffndRef,
- pWwFib->lcbPlcffndRef,
- ePLCFT(/*FNR*/PLCF_END + 1) );
- DumpPlcText( pWwFib->fcPlcffndTxt,
- pWwFib->lcbPlcffndTxt,
- pWwFib->ccpText,
- "FootNote" , pBase );
-}
-
-static void DumpEndnotes( WW8ScannerBase* pBase )
-{
- if( !pWwFib->lcbPlcfendRef ){
- *pOut << "No Endnotes" << endl1 << endl1;
- return;
- }
-
- DumpPLCF( pWwFib->fcPlcfendRef,
- pWwFib->lcbPlcfendRef,
- ePLCFT(/*ENR*/PLCF_END + 2) );
- DumpPlcText( pWwFib->fcPlcfendTxt,
- pWwFib->lcbPlcfendTxt,
- pWwFib->ccpText + pWwFib->ccpFtn
- + pWwFib->ccpHdr + pWwFib->ccpAtn,
- "EndNote", pBase );
-}
-
-static void DumpAnnotations( WW8ScannerBase* pBase )
-{
- if( !pWwFib->lcbPlcfandRef ){
- *pOut << "No Annotations" << endl1 << endl1;
- return;
- }
-
- DumpPLCF( pWwFib->fcPlcfandRef,
- pWwFib->lcbPlcfandRef,
- ePLCFT(/*ENR*/PLCF_END + 3) );
- DumpPlcText( pWwFib->fcPlcfandTxt,
- pWwFib->lcbPlcfandTxt,
- pWwFib->ccpText + pWwFib->ccpFtn
- + pWwFib->ccpHdr,
- "Annotation", pBase );
-}
-
-void DumpTxtStoryEntry( void* pData )
-{
- if( 8 == pWwFib->nVersion )
- {
- long* p = (long*)pData;
- begin( *pOut, *xStrm )
- << "TextboxStory" << hex << endl1;
-
- *pOut << " " << indent1 << "cTxbx/iNextReuse: 0x" << *p++;
- *pOut << " cReusable: 0x" << *p++;
- short* ps = (short*)p;
- *pOut << " fReusable: 0x" << *ps++ << endl1;
- p = (long*)ps;
- ++p; // reserved
- *pOut << " " << indent1 << "lid: 0x" << *p++;
- *pOut << " txidUndo: 0x" << *p++ << dec << endl1;
-
- end( *pOut, *xStrm ) << "TextboxStory" << endl1 << endl1;
- }
-}
-
-static void DumpTextBoxs( WW8ScannerBase* pBase )
-{
- if( pWwFib->lcbPlcftxbxTxt )
- {
- DumpPlcText( pWwFib->fcPlcftxbxTxt,
- pWwFib->lcbPlcftxbxTxt,
- pWwFib->ccpText + pWwFib->ccpFtn
- + pWwFib->ccpHdr + pWwFib->ccpAtn + pWwFib->ccpEdn,
- "TextBoxes", pBase,
- 8 == pWwFib->nVersion ? 22 : 0, &DumpTxtStoryEntry );
- }
- else
- *pOut << "No Textboxes" << endl1 << endl1;
-
- if( pWwFib->lcbPlcfHdrtxbxTxt )
- DumpPlcText( pWwFib->fcPlcfHdrtxbxTxt,
- pWwFib->lcbPlcfHdrtxbxTxt,
- pWwFib->ccpText + pWwFib->ccpFtn
- + pWwFib->ccpHdr + pWwFib->ccpAtn + pWwFib->ccpEdn
- + pWwFib->ccpTxbx,
- "HeaderTextBoxes", pBase,
- 8 == pWwFib->nVersion ? 22 : 0, &DumpTxtStoryEntry );
- else
- *pOut << "No HeaderTextboxes" << endl1 << endl1;
-
-}
-
-
-static void DumpDrawObjects( const char* pNm, long nStart, long nLen,
- long nOffset )
-{
- if( nStart && nLen )
- {
- WW8PLCFspecial aPLCF( &xTableStream, nStart, nLen,
- 8 == pWwFib->nVersion ? 26 : 6 );
- *pOut << 'T' << hex6 << nStart << dec2 << ' ' << indent1 << begin1
- << pNm << ", Len: " << nLen
- << ", " << aPLCF.GetIMax() << " Elements" << endl1;
-
- for( sal_uInt16 i = 0; i < aPLCF.GetIMax(); ++i )
- {
- long nCp = aPLCF.GetPos( i );
- if( nCp >= LONG_MAX )
- break;
-
- *pOut << indent2 << i << ".Cp: 0x" << hex << nCp + nOffset;
- long* pFSPA = (long*)aPLCF.GetData( i );
- if( 8 == pWwFib->nVersion )
- {
- *pOut << " ShapeId: 0x" << *pFSPA++;
- *pOut << " left: " << dec << *pFSPA++;
- *pOut << " top: " << *pFSPA++;
- *pOut << " right: " << *pFSPA++;
- *pOut << " bottom: " << *pFSPA++;
- sal_uInt16* pU = (sal_uInt16*)pFSPA;
- *pOut << " flags: 0x" << hex << *pU++;
- pFSPA = (long*)pU;
- *pOut << " xTxbx: " << dec << *pFSPA;
- }
- else
- {
- *pOut << " FC of DO: 0x" << *pFSPA++;
- *pOut << " ctcbx: " << dec << *(sal_uInt16*)pFSPA;
- }
-
- *pOut << endl1;
- }
- *pOut << end1;
- }
- else
- *pOut << "No ";
- *pOut << pNm << endl1 << endl1;
-}
-
-static void DumpTxtboxBrks( const char* pNm, long nStart, long nLen,
- long nOffset )
-{
- if( nStart && nLen )
- {
- WW8PLCFspecial aPLCF( &xTableStream, nStart, nLen, 6 );
- *pOut << 'T' << hex6 << nStart << dec2 << ' ' << indent1 << begin1
- << pNm << ", Len: " << nLen
- << ", " << aPLCF.GetIMax() << " Elements" << endl1;
-
- for( sal_uInt16 i = 0; i < aPLCF.GetIMax(); ++i )
- {
- long nCp = aPLCF.GetPos( i );
- if( nCp >= LONG_MAX )
- break;
-
- sal_uInt16* pBKD = (sal_uInt16*)aPLCF.GetData( i );
- *pOut << indent2 << i << ".Cp: 0x" << hex << nCp + nOffset
- << " itxbxs: 0x" << *pBKD++;
- *pOut << " dcpDepend: 0x" << *pBKD++;
- *pOut << " flags: 0x" << hex << *pBKD << dec << endl1;
- }
- *pOut << end2;
- }
- else
- *pOut << "No ";
- *pOut << pNm << endl1 << endl1;
-}
-
-static void DumpFdoa( WW8ScannerBase* pBase )
-{
- long nOffset = pWwFib->ccpText + pWwFib->ccpFtn
- + pWwFib->ccpHdr + pWwFib->ccpAtn + pWwFib->ccpEdn;
-
- if( 8 == pWwFib->nVersion )
- {
- DumpDrawObjects( "DrawObjects in Maintext",
- pWwFib->fcPlcfspaMom, pWwFib->lcbPlcfspaMom,
- /*nOffset*/0 );
- // PLCF fuer TextBox-Break-Deskriptoren im Maintext
- DumpTxtboxBrks( "TextBox-Break-Desk. im Maintext",
- pWwFib->fcPlcftxbxBkd, pWwFib->lcbPlcftxbxBkd,
- nOffset );
- }
- else
- DumpDrawObjects( "DrawObjects in Maintext",
- pWwFib->fcPlcfdoaMom, pWwFib->lcbPlcfdoaMom,
- /*nOffset*/0 );
-
- nOffset += pWwFib->ccpHdrTxbx;
-
- if( 8 == pWwFib->nVersion )
- {
- DumpDrawObjects( "DrawObjects in Head/Foot",
- pWwFib->fcPlcfspaHdr, pWwFib->lcbPlcfspaHdr,
- /*nOffset*/0 );
- // PLCF fuer TextBox-Break-Deskriptoren im Header-/Footer-Bereich
- DumpTxtboxBrks( "TextBox-Break-Desk. im Head/Foot",
- pWwFib->fcPlcfHdrtxbxBkd, pWwFib->lcbPlcfHdrtxbxBkd,
- nOffset );
- }
- else
- DumpDrawObjects( "DrawObjects in Head/Foot",
- pWwFib->fcPlcfdoaHdr, pWwFib->lcbPlcfdoaHdr,
- /*nOffset*/0 );
-}
-
-sal_Bool ReadEsherRec( SvStream& rStrm, sal_uInt8& rVer, sal_uInt16& rInst,
- sal_uInt16& rFbt, sal_uInt32& rLength )
-{
- sal_uInt16 aBits;
- if( !WW8ReadUINT16( rStrm, aBits ) ) return sal_False;
- rVer = aBits & 0x000F;
- rInst = (aBits & 0xFFF0) >> 4;
- //----------------------------------------------
- if( !WW8ReadUINT16( rStrm, rFbt ) ) return sal_False;
- //----------------------------------------------
- return WW8ReadUINT32( rStrm, rLength );
-}
-
-const char* _GetShapeTypeNm( sal_uInt16 nId )
-{
- const char* aNmArr[ 202 + 2 + 1 ] = {
-/* 0*/ "NotPrimitive","Rectangle","RoundRectangle","Ellipse","Diamond","IsocelesTriangle","RightTriangle","Parallelogram","Trapezoid","Hexagon",
-/* 10*/ "Octagon","Plus","Star","Arrow","ThickArrow","HomePlate","Cube","Balloon","Seal","Arc",
-/* 20*/ "Line","Plaque","Can","Donut","TextSimple","TextOctagon","TextHexagon","TextCurve","TextWave","TextRing",
-/* 30*/ "TextOnCurve","TextOnRing","StraightConnector1","BentConnector2","BentConnector3","BentConnector4","BentConnector5","CurvedConnector2","CurvedConnector3","CurvedConnector4",
-/* 40*/ "CurvedConnector5","Callout1","Callout2","Callout3","AccentCallout1","AccentCallout2","AccentCallout3","BorderCallout1","BorderCallout2","BorderCallout3",
-/* 50*/ "AccentBorderCallout1","AccentBorderCallout2","AccentBorderCallout3","Ribbon","Ribbon2","Chevron","Pentagon","NoSmoking","Seal8","Seal16",
-/* 60*/ "Seal32","WedgeRectCallout","WedgeRRectCallout","WedgeEllipseCallout","Wave","FoldedCorner","LeftArrow","DownArrow","UpArrow","LeftRightArrow",
-/* 70*/ "UpDownArrow","IrregularSeal1","IrregularSeal2","LightningBolt","Heart","PictureFrame","QuadArrow","LeftArrowCallout","RightArrowCallout","UpArrowCallout",
-/* 80*/ "DownArrowCallout","LeftRightArrowCallout","UpDownArrowCallout","QuadArrowCallout","Bevel","LeftBracket","RightBracket","LeftBrace","RightBrace","LeftUpArrow",
-/* 90*/ "BentUpArrow","BentArrow","Seal24","StripedRightArrow","NotchedRightArrow","BlockArc","SmileyFace","VerticalScroll","HorizontalScroll","CircularArrow",
-/* 100*/ "NotchedCircularArrow","UturnArrow","CurvedRightArrow","CurvedLeftArrow","CurvedUpArrow","CurvedDownArrow","CloudCallout","EllipseRibbon","EllipseRibbon2","FlowChartProcess",
-/* 110*/ "FlowChartDecision","FlowChartInputOutput","FlowChartPredefinedProcess","FlowChartInternalStorage","FlowChartDocument","FlowChartMultidocument","FlowChartTerminator","FlowChartPreparation","FlowChartManualInput","FlowChartManualOperation",
-/* 120*/ "FlowChartConnector","FlowChartPunchedCard","FlowChartPunchedTape","FlowChartSummingJunction","FlowChartOr","FlowChartCollate","FlowChartSort","FlowChartExtract","FlowChartMerge","FlowChartOfflineStorage",
-/* 130*/ "FlowChartOnlineStorage","FlowChartMagneticTape","FlowChartMagneticDisk","FlowChartMagneticDrum","FlowChartDisplay","FlowChartDelay","TextPlainText","TextStop","TextTriangle","TextTriangleInverted",
-/* 140*/ "TextChevron","TextChevronInverted","TextRingInside","TextRingOutside","TextArchUpCurve","TextArchDownCurve","TextCircleCurve","TextButtonCurve","TextArchUpPour","TextArchDownPour",
-/* 150*/ "TextCirclePour","TextButtonPour","TextCurveUp","TextCurveDown","TextCascadeUp","TextCascadeDown","TextWave1","TextWave2","TextWave3","TextWave4",
-/* 160*/ "TextInflate","TextDeflate","TextInflateBottom","TextDeflateBottom","TextInflateTop","TextDeflateTop","TextDeflateInflate","TextDeflateInflateDeflate","TextFadeRight","TextFadeLeft",
-/* 170*/ "TextFadeUp","TextFadeDown","TextSlantUp","TextSlantDown","TextCanUp","TextCanDown","FlowChartAlternateProcess","FlowChartOffpageConnector","Callout90","AccentCallout90",
-/* 180*/ "BorderCallout90","AccentBorderCallout90","LeftRightUpArrow","Sun","Moon","BracketPair","BracePair","Seal4","DoubleWave","ActionButtonBlank",
-/* 190*/ "ActionButtonHome","ActionButtonHelp","ActionButtonInformation","ActionButtonForwardNext","ActionButtonBackPrevious","ActionButtonEnd","ActionButtonBeginning","ActionButtonReturn","ActionButtonDocument","ActionButtonSound",
-/* 200*/ "ActionButtonMovie","HostControl","TextBox","Nil", "???"
- };
- if( 203 < nId )
- nId = 204;
- return aNmArr[ nId ];
-}
-
-void DumpEscherProp( sal_uInt16 nId, sal_Bool bBid, sal_Bool bComplex, sal_uInt32 nOp,
- sal_uInt32& rStreamOffset )
-{
- const char* pRecNm = 0;
- switch( nId )
- {
- case 4: pRecNm = "DFF_Prop_Rotation"; break;
-// Protection
- case 119: pRecNm = "DFF_Prop_LockRotation"; break;
- case 120: pRecNm = "DFF_Prop_LockAspectRatio"; break;
- case 121: pRecNm = "DFF_Prop_LockPosition"; break;
- case 122: pRecNm = "DFF_Prop_LockAgainstSelect"; break;
- case 123: pRecNm = "DFF_Prop_LockCropping"; break;
- case 124: pRecNm = "DFF_Prop_LockVertices"; break;
- case 125: pRecNm = "DFF_Prop_LockText"; break;
- case 126: pRecNm = "DFF_Prop_LockAdjustHandles"; break;
- case 127: pRecNm = "DFF_Prop_LockAgainstGrouping"; break;
-// Text
- case 128: pRecNm = "DFF_Prop_lTxid"; break;
- case 129: pRecNm = "DFF_Prop_dxTextLeft"; break;
- case 130: pRecNm = "DFF_Prop_dyTextTop"; break;
- case 131: pRecNm = "DFF_Prop_dxTextRight"; break;
- case 132: pRecNm = "DFF_Prop_dyTextBottom"; break;
- case 133: pRecNm = "DFF_Prop_WrapText"; break;
- case 134: pRecNm = "DFF_Prop_scaleText"; break;
- case 135: pRecNm = "DFF_Prop_anchorText"; break;
- case 136: pRecNm = "DFF_Prop_txflTextFlow"; break;
- case 137: pRecNm = "DFF_Prop_cdirFont"; break;
- case 138: pRecNm = "DFF_Prop_hspNext"; break;
- case 139: pRecNm = "DFF_Prop_txdir"; break;
- case 187: pRecNm = "DFF_Prop_SelectText"; break;
- case 188: pRecNm = "DFF_Prop_AutoTextMargin"; break;
- case 189: pRecNm = "DFF_Prop_RotateText"; break;
- case 190: pRecNm = "DFF_Prop_FitShapeToText"; break;
- case 191: pRecNm = "DFF_Prop_FitTextToShape"; break;
-// GeoText
- case 192: pRecNm = "DFF_Prop_gtextUNICODE"; break;
- case 193: pRecNm = "DFF_Prop_gtextRTF"; break;
- case 194: pRecNm = "DFF_Prop_gtextAlign"; break;
- case 195: pRecNm = "DFF_Prop_gtextSize"; break;
- case 196: pRecNm = "DFF_Prop_gtextSpacing"; break;
- case 197: pRecNm = "DFF_Prop_gtextFont"; break;
- case 240: pRecNm = "DFF_Prop_gtextFReverseRows"; break;
- case 241: pRecNm = "DFF_Prop_fGtext"; break;
- case 242: pRecNm = "DFF_Prop_gtextFVertical"; break;
- case 243: pRecNm = "DFF_Prop_gtextFKern"; break;
- case 244: pRecNm = "DFF_Prop_gtextFTight"; break;
- case 245: pRecNm = "DFF_Prop_gtextFStretch"; break;
- case 246: pRecNm = "DFF_Prop_gtextFShrinkFit"; break;
- case 247: pRecNm = "DFF_Prop_gtextFBestFit"; break;
- case 248: pRecNm = "DFF_Prop_gtextFNormalize"; break;
- case 249: pRecNm = "DFF_Prop_gtextFDxMeasure"; break;
- case 250: pRecNm = "DFF_Prop_gtextFBold"; break;
- case 251: pRecNm = "DFF_Prop_gtextFItalic"; break;
- case 252: pRecNm = "DFF_Prop_gtextFUnderline"; break;
- case 253: pRecNm = "DFF_Prop_gtextFShadow"; break;
- case 254: pRecNm = "DFF_Prop_gtextFSmallcaps"; break;
- case 255: pRecNm = "DFF_Prop_gtextFStrikethrough"; break;
-// Blip
- case 256: pRecNm = "DFF_Prop_cropFromTop"; break;
- case 257: pRecNm = "DFF_Prop_cropFromBottom"; break;
- case 258: pRecNm = "DFF_Prop_cropFromLeft"; break;
- case 259: pRecNm = "DFF_Prop_cropFromRight"; break;
- case 260: pRecNm = "DFF_Prop_pib"; break;
- case 261: pRecNm = "DFF_Prop_pibName"; break;
- case 262: pRecNm = "DFF_Prop_pibFlags"; break;
- case 263: pRecNm = "DFF_Prop_pictureTransparent"; break;
- case 264: pRecNm = "DFF_Prop_pictureContrast"; break;
- case 265: pRecNm = "DFF_Prop_pictureBrightness"; break;
- case 266: pRecNm = "DFF_Prop_pictureGamma"; break;
- case 267: pRecNm = "DFF_Prop_pictureId"; break;
- case 268: pRecNm = "DFF_Prop_pictureDblCrMod"; break;
- case 269: pRecNm = "DFF_Prop_pictureFillCrMod"; break;
- case 270: pRecNm = "DFF_Prop_pictureLineCrMod"; break;
- case 271: pRecNm = "DFF_Prop_pibPrint"; break;
- case 272: pRecNm = "DFF_Prop_pibPrintName"; break;
- case 273: pRecNm = "DFF_Prop_pibPrintFlags"; break;
- case 316: pRecNm = "DFF_Prop_fNoHitTestPicture"; break;
- case 317: pRecNm = "DFF_Prop_pictureGray"; break;
- case 318: pRecNm = "DFF_Prop_pictureBiLevel"; break;
- case 319: pRecNm = "DFF_Prop_pictureActive"; break;
-// Geometry
- case 320: pRecNm = "DFF_Prop_geoLeft"; break;
- case 321: pRecNm = "DFF_Prop_geoTop"; break;
- case 322: pRecNm = "DFF_Prop_geoRight"; break;
- case 323: pRecNm = "DFF_Prop_geoBottom"; break;
- case 324: pRecNm = "DFF_Prop_shapePath"; break;
- case 325: pRecNm = "DFF_Prop_pVertices"; break;
- case 326: pRecNm = "DFF_Prop_pSegmentInfo"; break;
- case 327: pRecNm = "DFF_Prop_adjustValue"; break;
- case 328: pRecNm = "DFF_Prop_adjust2Value"; break;
- case 329: pRecNm = "DFF_Prop_adjust3Value"; break;
- case 330: pRecNm = "DFF_Prop_adjust4Value"; break;
- case 331: pRecNm = "DFF_Prop_adjust5Value"; break;
- case 332: pRecNm = "DFF_Prop_adjust6Value"; break;
- case 333: pRecNm = "DFF_Prop_adjust7Value"; break;
- case 334: pRecNm = "DFF_Prop_adjust8Value"; break;
- case 335: pRecNm = "DFF_Prop_adjust9Value"; break;
- case 336: pRecNm = "DFF_Prop_adjust10Value"; break;
- case 378: pRecNm = "DFF_Prop_fShadowOK"; break;
- case 379: pRecNm = "DFF_Prop_f3DOK"; break;
- case 380: pRecNm = "DFF_Prop_fLineOK"; break;
- case 381: pRecNm = "DFF_Prop_fGtextOK"; break;
- case 382: pRecNm = "DFF_Prop_fFillShadeShapeOK"; break;
- case 383: pRecNm = "DFF_Prop_fFillOK"; break;
-// FillStyle
- case 384: pRecNm = "DFF_Prop_fillType"; break;
- case 385: pRecNm = "DFF_Prop_fillColor"; break;
- case 386: pRecNm = "DFF_Prop_fillOpacity"; break;
- case 387: pRecNm = "DFF_Prop_fillBackColor"; break;
- case 388: pRecNm = "DFF_Prop_fillBackOpacity"; break;
- case 389: pRecNm = "DFF_Prop_fillCrMod"; break;
- case 390: pRecNm = "DFF_Prop_fillBlip"; break;
- case 391: pRecNm = "DFF_Prop_fillBlipName"; break;
- case 392: pRecNm = "DFF_Prop_fillBlipFlags"; break;
- case 393: pRecNm = "DFF_Prop_fillWidth"; break;
- case 394: pRecNm = "DFF_Prop_fillHeight"; break;
- case 395: pRecNm = "DFF_Prop_fillAngle"; break;
- case 396: pRecNm = "DFF_Prop_fillFocus"; break;
- case 397: pRecNm = "DFF_Prop_fillToLeft"; break;
- case 398: pRecNm = "DFF_Prop_fillToTop"; break;
- case 399: pRecNm = "DFF_Prop_fillToRight"; break;
- case 400: pRecNm = "DFF_Prop_fillToBottom"; break;
- case 401: pRecNm = "DFF_Prop_fillRectLeft"; break;
- case 402: pRecNm = "DFF_Prop_fillRectTop"; break;
- case 403: pRecNm = "DFF_Prop_fillRectRight"; break;
- case 404: pRecNm = "DFF_Prop_fillRectBottom"; break;
- case 405: pRecNm = "DFF_Prop_fillDztype"; break;
- case 406: pRecNm = "DFF_Prop_fillShadePreset"; break;
- case 407: pRecNm = "DFF_Prop_fillShadeColors"; break;
- case 408: pRecNm = "DFF_Prop_fillOriginX"; break;
- case 409: pRecNm = "DFF_Prop_fillOriginY"; break;
- case 410: pRecNm = "DFF_Prop_fillShapeOriginX"; break;
- case 411: pRecNm = "DFF_Prop_fillShapeOriginY"; break;
- case 412: pRecNm = "DFF_Prop_fillShadeType"; break;
- case 443: pRecNm = "DFF_Prop_fFilled"; break;
- case 444: pRecNm = "DFF_Prop_fHitTestFill"; break;
- case 445: pRecNm = "DFF_Prop_fillShape"; break;
- case 446: pRecNm = "DFF_Prop_fillUseRect"; break;
- case 447: pRecNm = "DFF_Prop_fNoFillHitTest"; break;
-// LineStyle
- case 448: pRecNm = "DFF_Prop_lineColor"; break;
- case 449: pRecNm = "DFF_Prop_lineOpacity"; break;
- case 450: pRecNm = "DFF_Prop_lineBackColor"; break;
- case 451: pRecNm = "DFF_Prop_lineCrMod"; break;
- case 452: pRecNm = "DFF_Prop_lineType"; break;
- case 453: pRecNm = "DFF_Prop_lineFillBlip"; break;
- case 454: pRecNm = "DFF_Prop_lineFillBlipName"; break;
- case 455: pRecNm = "DFF_Prop_lineFillBlipFlags"; break;
- case 456: pRecNm = "DFF_Prop_lineFillWidth"; break;
- case 457: pRecNm = "DFF_Prop_lineFillHeight"; break;
- case 458: pRecNm = "DFF_Prop_lineFillDztype"; break;
- case 459: pRecNm = "DFF_Prop_lineWidth"; break;
- case 460: pRecNm = "DFF_Prop_lineMiterLimit"; break;
- case 461: pRecNm = "DFF_Prop_lineStyle"; break;
- case 462: pRecNm = "DFF_Prop_lineDashing"; break;
- case 463: pRecNm = "DFF_Prop_lineDashStyle"; break;
- case 464: pRecNm = "DFF_Prop_lineStartArrowhead"; break;
- case 465: pRecNm = "DFF_Prop_lineEndArrowhead"; break;
- case 466: pRecNm = "DFF_Prop_lineStartArrowWidth"; break;
- case 467: pRecNm = "DFF_Prop_lineStartArrowLength"; break;
- case 468: pRecNm = "DFF_Prop_lineEndArrowWidth"; break;
- case 469: pRecNm = "DFF_Prop_lineEndArrowLength"; break;
- case 470: pRecNm = "DFF_Prop_lineJoinStyle"; break;
- case 471: pRecNm = "DFF_Prop_lineEndCapStyle"; break;
- case 507: pRecNm = "DFF_Prop_fArrowheadsOK"; break;
- case 508: pRecNm = "DFF_Prop_fLine"; break;
- case 509: pRecNm = "DFF_Prop_fHitTestLine"; break;
- case 510: pRecNm = "DFF_Prop_lineFillShape"; break;
- case 511: pRecNm = "DFF_Prop_fNoLineDrawDash"; break;
-// ShadowStyle
- case 512: pRecNm = "DFF_Prop_shadowType"; break;
- case 513: pRecNm = "DFF_Prop_shadowColor"; break;
- case 514: pRecNm = "DFF_Prop_shadowHighlight"; break;
- case 515: pRecNm = "DFF_Prop_shadowCrMod"; break;
- case 516: pRecNm = "DFF_Prop_shadowOpacity"; break;
- case 517: pRecNm = "DFF_Prop_shadowOffsetX"; break;
- case 518: pRecNm = "DFF_Prop_shadowOffsetY"; break;
- case 519: pRecNm = "DFF_Prop_shadowSecondOffsetX"; break;
- case 520: pRecNm = "DFF_Prop_shadowSecondOffsetY"; break;
- case 521: pRecNm = "DFF_Prop_shadowScaleXToX"; break;
- case 522: pRecNm = "DFF_Prop_shadowScaleYToX"; break;
- case 523: pRecNm = "DFF_Prop_shadowScaleXToY"; break;
- case 524: pRecNm = "DFF_Prop_shadowScaleYToY"; break;
- case 525: pRecNm = "DFF_Prop_shadowPerspectiveX"; break;
- case 526: pRecNm = "DFF_Prop_shadowPerspectiveY"; break;
- case 527: pRecNm = "DFF_Prop_shadowWeight"; break;
- case 528: pRecNm = "DFF_Prop_shadowOriginX"; break;
- case 529: pRecNm = "DFF_Prop_shadowOriginY"; break;
- case 574: pRecNm = "DFF_Prop_fShadow"; break;
- case 575: pRecNm = "DFF_Prop_fshadowObscured"; break;
-// PerspectiveStyle
- case 576: pRecNm = "DFF_Prop_perspectiveType"; break;
- case 577: pRecNm = "DFF_Prop_perspectiveOffsetX"; break;
- case 578: pRecNm = "DFF_Prop_perspectiveOffsetY"; break;
- case 579: pRecNm = "DFF_Prop_perspectiveScaleXToX"; break;
- case 580: pRecNm = "DFF_Prop_perspectiveScaleYToX"; break;
- case 581: pRecNm = "DFF_Prop_perspectiveScaleXToY"; break;
- case 582: pRecNm = "DFF_Prop_perspectiveScaleYToY"; break;
- case 583: pRecNm = "DFF_Prop_perspectivePerspectiveX"; break;
- case 584: pRecNm = "DFF_Prop_perspectivePerspectiveY"; break;
- case 585: pRecNm = "DFF_Prop_perspectiveWeight"; break;
- case 586: pRecNm = "DFF_Prop_perspectiveOriginX"; break;
- case 587: pRecNm = "DFF_Prop_perspectiveOriginY"; break;
- case 639: pRecNm = "DFF_Prop_fPerspective"; break;
-// 3D Object
- case 640: pRecNm = "DFF_Prop_c3DSpecularAmt"; break;
- case 641: pRecNm = "DFF_Prop_c3DDiffuseAmt"; break;
- case 642: pRecNm = "DFF_Prop_c3DShininess"; break;
- case 643: pRecNm = "DFF_Prop_c3DEdgeThickness"; break;
- case 644: pRecNm = "DFF_Prop_c3DExtrudeForward"; break;
- case 645: pRecNm = "DFF_Prop_c3DExtrudeBackward"; break;
- case 646: pRecNm = "DFF_Prop_c3DExtrudePlane"; break;
- case 647: pRecNm = "DFF_Prop_c3DExtrusionColor"; break;
- case 648: pRecNm = "DFF_Prop_c3DCrMod"; break;
- case 700: pRecNm = "DFF_Prop_f3D"; break;
- case 701: pRecNm = "DFF_Prop_fc3DMetallic"; break;
- case 702: pRecNm = "DFF_Prop_fc3DUseExtrusionColor"; break;
- case 703: pRecNm = "DFF_Prop_fc3DLightFace"; break;
-// 3D Style
- case 704: pRecNm = "DFF_Prop_c3DYRotationAngle"; break;
- case 705: pRecNm = "DFF_Prop_c3DXRotationAngle"; break;
- case 706: pRecNm = "DFF_Prop_c3DRotationAxisX"; break;
- case 707: pRecNm = "DFF_Prop_c3DRotationAxisY"; break;
- case 708: pRecNm = "DFF_Prop_c3DRotationAxisZ"; break;
- case 709: pRecNm = "DFF_Prop_c3DRotationAngle"; break;
- case 710: pRecNm = "DFF_Prop_c3DRotationCenterX"; break;
- case 711: pRecNm = "DFF_Prop_c3DRotationCenterY"; break;
- case 712: pRecNm = "DFF_Prop_c3DRotationCenterZ"; break;
- case 713: pRecNm = "DFF_Prop_c3DRenderMode"; break;
- case 714: pRecNm = "DFF_Prop_c3DTolerance"; break;
- case 715: pRecNm = "DFF_Prop_c3DXViewpoint"; break;
- case 716: pRecNm = "DFF_Prop_c3DYViewpoint"; break;
- case 717: pRecNm = "DFF_Prop_c3DZViewpoint"; break;
- case 718: pRecNm = "DFF_Prop_c3DOriginX"; break;
- case 719: pRecNm = "DFF_Prop_c3DOriginY"; break;
- case 720: pRecNm = "DFF_Prop_c3DSkewAngle"; break;
- case 721: pRecNm = "DFF_Prop_c3DSkewAmount"; break;
- case 722: pRecNm = "DFF_Prop_c3DAmbientIntensity"; break;
- case 723: pRecNm = "DFF_Prop_c3DKeyX"; break;
- case 724: pRecNm = "DFF_Prop_c3DKeyY"; break;
- case 725: pRecNm = "DFF_Prop_c3DKeyZ"; break;
- case 726: pRecNm = "DFF_Prop_c3DKeyIntensity"; break;
- case 727: pRecNm = "DFF_Prop_c3DFillX"; break;
- case 728: pRecNm = "DFF_Prop_c3DFillY"; break;
- case 729: pRecNm = "DFF_Prop_c3DFillZ"; break;
- case 730: pRecNm = "DFF_Prop_c3DFillIntensity"; break;
- case 763: pRecNm = "DFF_Prop_fc3DConstrainRotation"; break;
- case 764: pRecNm = "DFF_Prop_fc3DRotationCenterAuto"; break;
- case 765: pRecNm = "DFF_Prop_fc3DParallel"; break;
- case 766: pRecNm = "DFF_Prop_fc3DKeyHarsh"; break;
- case 767: pRecNm = "DFF_Prop_fc3DFillHarsh"; break;
-// Shape
- case 769: pRecNm = "DFF_Prop_hspMaster"; break;
- case 771: pRecNm = "DFF_Prop_cxstyle"; break;
- case 772: pRecNm = "DFF_Prop_bWMode"; break;
- case 773: pRecNm = "DFF_Prop_bWModePureBW"; break;
- case 774: pRecNm = "DFF_Prop_bWModeBW"; break;
- case 826: pRecNm = "DFF_Prop_fOleIcon"; break;
- case 827: pRecNm = "DFF_Prop_fPreferRelativeResize"; break;
- case 828: pRecNm = "DFF_Prop_fLockShapeType"; break;
- case 830: pRecNm = "DFF_Prop_fDeleteAttachedObject"; break;
- case 831: pRecNm = "DFF_Prop_fBackground"; break;
-
-// Callout
- case 832: pRecNm = "DFF_Prop_spcot"; break;
- case 833: pRecNm = "DFF_Prop_dxyCalloutGap"; break;
- case 834: pRecNm = "DFF_Prop_spcoa"; break;
- case 835: pRecNm = "DFF_Prop_spcod"; break;
- case 836: pRecNm = "DFF_Prop_dxyCalloutDropSpecified"; break;
- case 837: pRecNm = "DFF_Prop_dxyCalloutLengthSpecified"; break;
- case 889: pRecNm = "DFF_Prop_fCallout"; break;
- case 890: pRecNm = "DFF_Prop_fCalloutAccentBar"; break;
- case 891: pRecNm = "DFF_Prop_fCalloutTextBorder"; break;
- case 892: pRecNm = "DFF_Prop_fCalloutMinusX"; break;
- case 893: pRecNm = "DFF_Prop_fCalloutMinusY"; break;
- case 894: pRecNm = "DFF_Prop_fCalloutDropAuto"; break;
- case 895: pRecNm = "DFF_Prop_fCalloutLengthSpecified"; break;
-
-// GroupShape
- case 896: pRecNm = "DFF_Prop_wzName"; break;
- case 897: pRecNm = "DFF_Prop_wzDescription"; break;
- case 898: pRecNm = "DFF_Prop_pihlShape"; break;
- case 899: pRecNm = "DFF_Prop_pWrapPolygonVertices"; break;
- case 900: pRecNm = "DFF_Prop_dxWrapDistLeft"; break;
- case 901: pRecNm = "DFF_Prop_dyWrapDistTop"; break;
- case 902: pRecNm = "DFF_Prop_dxWrapDistRight"; break;
- case 903: pRecNm = "DFF_Prop_dyWrapDistBottom"; break;
- case 904: pRecNm = "DFF_Prop_lidRegroup"; break;
- case 953: pRecNm = "DFF_Prop_fEditedWrap"; break;
- case 954: pRecNm = "DFF_Prop_fBehindDocument"; break;
- case 955: pRecNm = "DFF_Prop_fOnDblClickNotify"; break;
- case 956: pRecNm = "DFF_Prop_fIsButton"; break;
- case 957: pRecNm = "DFF_Prop_fOneD"; break;
- case 958: pRecNm = "DFF_Prop_fHidden"; break;
- case 959: pRecNm = "DFF_Prop_fPrint"; break;
- }
-
- *pOut << " " << indent1 << ' ';
- if( pRecNm )
- *pOut << pRecNm;
- else
- *pOut << "Prop" ;
-
- *pOut << " Id: " << dec << nId << " (=0x" << hex << nId << ')';
- if( bBid )
- *pOut << " Bid: 0x" << (sal_uInt16)bBid;
-
- if( bComplex )
- {
- *pOut << " Cmpl: 0x" << (sal_uInt16)bComplex;
- // ....
- rStreamOffset += nOp;
- }
-// else
- *pOut << " op: 0x" << nOp;
-
- *pOut << dec << endl1;
-}
-
-void DumpEscherRec( sal_uLong nPos, sal_uInt8 nVer, sal_uInt16 nInst,
- sal_uInt16 nFbt, sal_uInt32 nLength )
-{
- const char* pRecNm = 0;
- switch( nFbt )
- {
- case 0xF000: pRecNm = "DFF_msofbtDggContainer"; break;
- case 0xF006: pRecNm = "DFF_msofbtDgg"; break;
- case 0xF016: pRecNm = "DFF_msofbtCLSID"; break;
- case 0xF00B: pRecNm = "DFF_msofbtOPT"; break;
- case 0xF11A: pRecNm = "DFF_msofbtColorMRU"; break;
- case 0xF11E: pRecNm = "DFF_msofbtSplitMenuColors"; break;
- case 0xF001: pRecNm = "DFF_msofbtBstoreContainer"; break;
- case 0xF007: pRecNm = "DFF_msofbtBSE"; break;
- case 0xF018: pRecNm = "DFF_msofbtBlipFirst"; break;
- case 0xF117: pRecNm = "DFF_msofbtBlipLast"; break;
- case 0xF002: pRecNm = "DFF_msofbtDgContainer"; break;
- case 0xF008: pRecNm = "DFF_msofbtDg"; break;
- case 0xF118: pRecNm = "DFF_msofbtRegroupItems"; break;
- case 0xF120: pRecNm = "DFF_msofbtColorScheme"; break;
- case 0xF003: pRecNm = "DFF_msofbtSpgrContainer"; break;
- case 0xF004: pRecNm = "DFF_msofbtSpContainer"; break;
- case 0xF009: pRecNm = "DFF_msofbtSpgr"; break;
- case 0xF00A: pRecNm = "DFF_msofbtSp"; break;
- case 0xF00C: pRecNm = "DFF_msofbtTextbox"; break;
- case 0xF00D: pRecNm = "DFF_msofbtClientTextbox"; break;
- case 0xF00E: pRecNm = "DFF_msofbtAnchor"; break;
- case 0xF00F: pRecNm = "DFF_msofbtChildAnchor"; break;
- case 0xF010: pRecNm = "DFF_msofbtClientAnchor"; break;
- case 0xF011: pRecNm = "DFF_msofbtClientData"; break;
- case 0xF11F: pRecNm = "DFF_msofbtOleObject"; break;
- case 0xF11D: pRecNm = "DFF_msofbtDeletedPspl"; break;
- case 0xF005: pRecNm = "DFF_msofbtSolverContainer"; break;
- case 0xF012: pRecNm = "DFF_msofbtConnectorRule"; break;
- case 0xF013: pRecNm = "DFF_msofbtAlignRule"; break;
- case 0xF014: pRecNm = "DFF_msofbtArcRule"; break;
- case 0xF015: pRecNm = "DFF_msofbtClientRule"; break;
- case 0xF017: pRecNm = "DFF_msofbtCalloutRule"; break;
- case 0xF122: pRecNm = "DFF_msofbtUDefProp"; break;
- }
-
- *pOut << hex6 << nPos << indent1;
- if( pRecNm )
- *pOut << pRecNm;
- else
- *pOut << "Record:";
- *pOut << " Id: 0x" << hex << nFbt << " Instance: 0x" << nInst
- << " Version: 0x" << (sal_uInt16)nVer << " Laenge: 0x" << nLength
- << dec << endl1;
-
- switch( nFbt )
- {
- case 0xf00b: // DFF_msofbtOPT
- {
- sal_uInt16 nId; sal_uInt32 nOp, nStreamOffset = nInst * 6;
- sal_Bool bBid, bComplex;
- for( sal_uInt16 n = 0; n < nInst; ++n )
- {
- if( !WW8ReadUINT16( *xTableStream, nId ) ||
- !WW8ReadUINT32( *xTableStream, nOp ))
- break;
- bBid = ( nId >> 14 ) & 1;
- bComplex = ( nId >> 15 ) & 1;
- nId &= 0x3fff;
-
- ::DumpEscherProp( nId, bBid, bComplex, nOp, nStreamOffset );
- }
- }
- break;
-
- case 0xF00d: // DFF_msofbtClientTextbox
- case 0xF010: // DFF_msofbtClientAnchor
- case 0xF011: // DFF_msofbtClientData
- {
- sal_uInt32 nData;
- if( 4 == nLength && WW8ReadUINT32( *xTableStream, nData ))
- *pOut << " " << indent1 << " Data: "
- << hex << nData << dec << endl1;
- }
- break;
-
- case 0xf00a: // DFF_msofbtSp
- {
- sal_uInt32 nId, nData;
- if( WW8ReadUINT32( *xTableStream, nId ) &&
- WW8ReadUINT32( *xTableStream, nData ))
- {
- *pOut << " " << indent1 << " \""
- << _GetShapeTypeNm( nInst )
- << "\" Id: 0x" << hex << nId
- << " Flags: 0x" << nData << dec << endl1;
- }
- }
- break;
-
- case 0xf009: // DFF_msofbtSpgr
- case 0xf00f: // DFF_msofbtChildAnchor
- {
- sal_uInt32 nL, nT, nR, nB;
- if( WW8ReadUINT32( *xTableStream, nL ) &&
- WW8ReadUINT32( *xTableStream, nT ) &&
- WW8ReadUINT32( *xTableStream, nR ) &&
- WW8ReadUINT32( *xTableStream, nB ) )
- {
- *pOut << " " << indent1 << " Rect: (L/T/R/B): " << dec
- << nL << '/' << nT << '/' << nR << '/' << nB << endl;
- }
- }
- break;
-
- case 0xf006: //ESCHER_Dgg
- {
- sal_uInt32 spidMax, // The current maximum shape ID
- cidcl, // The number of ID clusters (FIDCLs)
- cspSaved, // The total number of shapes saved
- // (including deleted shapes, if undo
- // information was saved)
- cdgSaved; // The total number of drawings saved
-
- if( WW8ReadUINT32( *xTableStream, spidMax ) &&
- WW8ReadUINT32( *xTableStream, cidcl ) &&
- WW8ReadUINT32( *xTableStream, cspSaved ) &&
- WW8ReadUINT32( *xTableStream, cdgSaved ))
- {
- *pOut << " " << indent1 << " " << hex
- << " spidMax: 0x" << spidMax
- << " cidcl: 0x" << cidcl
- << " cspSaved: 0x" << cspSaved
- << " cdgSaved: 0x" << cdgSaved
- << dec << endl1;
-
-
- sal_uInt32 dgid, // DG owning the SPIDs in this cluster
- cspidCur; // number of SPIDs used so far
-
- for( sal_uInt32 n = 1; n < cidcl; ++n )
- {
- if( !WW8ReadUINT32( *xTableStream, dgid ) ||
- !WW8ReadUINT32( *xTableStream, cspidCur ))
- break;
-
- *pOut << " " << indent1 << " " << hex
- << " dgid: 0x" << dgid
- << " cspidCur: 0x" << cspidCur
- << dec << endl1;
- }
- }
- }
- break;
-
- case 0xF122:
- {
- if( 3 < nLength )
- {
- *pOut << " " << indent1 << " Data:" << hex;
- sal_uInt8 nParam;
- for( sal_uInt32 n = 0; n < nLength; ++n )
- {
- if( !WW8ReadBYTE( *xTableStream, nParam ) )
- break;
-
- sal_uInt16 nHexParam = nParam;
- *pOut << " 0x" << nHexParam;
- }
- *pOut << dec << endl1;
- }
- }
- break;
-
- case 0xF016: //ESCHER_CLSID
- case 0xF11A: //ESCHER_ColorMRU
- case 0xF11E: //ESCHER_SplitMenuColors
-// case 0xF001: //ESCHER_BstoreContainer
- case 0xF007: //ESCHER_BSE
- case 0xF018: //ESCHER_BlipFirst
- case 0xF117: //ESCHER_BlipLast
- case 0xF118: //ESCHER_RegroupItems
- case 0xF120: //ESCHER_ColorScheme
- case 0xF00C: //ESCHER_Textbox
- case 0xF00E: //ESCHER_Anchor
- case 0xF11F: //ESCHER_OleObject
- case 0xF11D: //ESCHER_DeletedPspl
- case 0xF005: //ESCHER_SolverContainer
- case 0xF012: //ESCHER_ConnectorRule
- case 0xF013: //ESCHER_AlignRule
- case 0xF014: //ESCHER_ArcRule
- case 0xF015: //ESCHER_ClientRule
- case 0xF017: //ESCHER_CalloutRule
- case 0xF119: //ESCHER_Selection
- case 0xf008: //ESCHER_Dg
- {
- int nCnt = 128;
- while( nLength )
- {
- if( 128 == nCnt || 16 == ++nCnt )
- {
- if( 128 != nCnt )
- *pOut << endl1;
- *pOut << " " << indent1 << " Data: ";
- nCnt = 0;
- }
-
- static char __READONLY_DATA sHex[17] = { "0123456789abcdef" };
- sal_uInt8 c;
- *xTableStream >> c;
- *pOut << sHex[ ( c & 0xf0 ) >> 4 ] << sHex[ c & 0x0f ] << ' ';
- --nLength;
- }
- *pOut << dec << endl1;
- }
- break;
- }
-
-
-}
-
-
-void DumpEscherRecs( sal_uLong nPos, sal_uInt32 nLength )
-{
- begin( *pOut, *xTableStream ) << endl1;
-
- sal_uInt16 nOldFbt = 0;
- sal_uLong nReadLen = 0;
- while( nReadLen < nLength )
- {
- sal_uInt8 nVer;
- sal_uInt16 nInst, nFbt;
- sal_uInt32 nRecLen;
-
- if( !::ReadEsherRec( *xTableStream, nVer, nInst, nFbt, nRecLen ))
- break;
-
- if( (0xf000 > nFbt) )//|| (0xf122 < nFbt) )
- {
- xTableStream->Seek( nPos + nReadLen );
- unsigned char c;
- *xTableStream >> c;
-
- ++nReadLen;
- if( ( !::ReadEsherRec( *xTableStream, nVer, nInst, nFbt, nRecLen ) )
- || ( 0xf000 > nFbt )
- //|| ( 0xf122 < nFbt )
- )
- break;
-
- *pOut << hex6 << nPos + nReadLen - 1 << indent1
- << "DummyChar: 0x" << hex << (int)c << dec << endl1;
- }
-
- ::DumpEscherRec( nPos + nReadLen, nVer, nInst,
- nFbt, nRecLen );
-
- nReadLen += 2 * sizeof( sal_uInt32 );
- switch( nFbt )
- {
- case 0xF000:
- case 0xF001: //ESCHER_BstoreContainer
- case 0xF002:
- case 0xF003:
- case 0xF004:
- DumpEscherRecs( nPos + nReadLen, nRecLen );
- break;
- }
-
- nReadLen += nRecLen;
- xTableStream->Seek( nPos + nReadLen );
- nOldFbt = nFbt;
- }
- end( *pOut, *xTableStream ) << endl1;
-}
-
-
-void DumpDrawing()
-{
- if( pWwFib->lcbDggInfo )
- {
- sal_uLong nOldPos = xTableStream->Tell(), nReadLen = 0;
- xTableStream->Seek( pWwFib->fcDggInfo );
-
- *pOut << endl << hex6 << pWwFib->fcDggInfo << dec2 << ' ' << indent1
- << begin1 << "Escher (DggInfo): Len: " << pWwFib->lcbDggInfo
- << endl1;
-
- ::DumpEscherRecs( pWwFib->fcDggInfo, (sal_uLong)pWwFib->lcbDggInfo );
-
- end( *pOut, *xTableStream ) << endl1 << endl1;
- xTableStream->Seek( nOldPos );
- }
-}
-
-
-//-----------------------------------------
-// Hilfroutinen fuer Styles
-//-----------------------------------------
-
-static short DumpStyleUPX( sal_uInt8 nVersion, short nLen, sal_Bool bPAP )
-{
- short cbUPX;
- sal_Bool bEmpty;
-
-
- if( nLen <= 0 ){
- indent( *pOut, *xTableStream );
- *pOut << "very empty UPX." << ((bPAP) ? "papx " : "chpx ");
- *pOut << "Len:" << nLen << endl1;
- return nLen;
- }
-
- nLen -= WW8SkipOdd( &xTableStream );
- indent( *pOut, *xTableStream );
-
- xTableStream->Read( &cbUPX, 2 );
- nLen-= 2;
-
- if ( cbUPX > nLen )
- {
- *pOut << "!cbUPX auf nLen verkleinert! ";
- cbUPX = nLen;
- }
-
- bEmpty = ( cbUPX <= 0 ) || ( bPAP && ( cbUPX <= 2 ) );
-
- if ( bEmpty )
- *pOut << "empty ";
- else
- *pOut << begin1;
-
- *pOut << "UPX." << ((bPAP) ? "papx " : "chpx ");
- *pOut << "Len:" << nLen << " cbUPX:" << cbUPX << ' ';
-
- if( bPAP )
- {
- sal_uInt16 id;
-
- xTableStream->Read( &id, 2 );
- cbUPX-= 2;
- nLen-= 2;
- *pOut << "ID:" << id;
- }
-
- *pOut << endl1;
-
- sal_uLong nPos = xTableStream->Tell(); // falls etwas falsch interpretiert
- // wird, gehts danach wieder richtig
- DumpSprms( nVersion, *xTableStream, cbUPX );
-
- if ( xTableStream->Tell() != nPos + cbUPX ){
- *pOut << "!Um " << xTableStream->Tell() - nPos + cbUPX
- << " Bytes falsch positioniert!" << endl1;
- xTableStream->Seek( nPos+cbUPX );
- }
-
- nLen -= cbUPX;
-
- if ( !bEmpty )
- end( *pOut, *xTableStream ) << "UPX." << ((bPAP) ? "papx " : "chpx ") << endl1;
-
- return nLen;
-}
-
-static void DumpStyleGrupx( sal_uInt8 nVersion, short nLen, sal_Bool bPara )
-{
- if( nLen <= 0 )
- return;
- nLen -= WW8SkipOdd( &xTableStream );
-
- begin( *pOut, *xTableStream ) << "Grupx, Len:" << nLen << endl1;
-
- if( bPara ) nLen = DumpStyleUPX( nVersion, nLen, sal_True ); // Grupx.Papx
- DumpStyleUPX( nVersion, nLen, sal_False ); // Grupx.Chpx
-
- end( *pOut, *xTableStream ) << "Grupx" << endl1;
-}
-
-static void PrintStyleId( sal_uInt16 nId )
-{
- switch ( nId ){
- case 0xffe: *pOut << "User "; break;
- case 0xfff: *pOut << "Nil "; break;
- default: *pOut << nId << ' '; break;
- }
-}
-
-//-----------------------------------------
-// Styles
-//-----------------------------------------
-
-void DStyle::Dump1Style( sal_uInt16 nNr )
-{
- short nSkip, cbStd;
- String aStr;
- char c;
- indent( *pOut, *xTableStream );
-
- WW8_STD* pStd = Read1Style( nSkip, &aStr, &cbStd ); // lese Style
-
- if ( aStr.Len() ) // echter Style
- {
- *pOut << begin1;
- switch ( pStd->sgc ){
- case 1: c = 'P'; break;
- case 2: c = 'C'; break;
- default: c = '?'; break;
- }
- *pOut << c << "-Style Nr:" << nNr << ' ';
- *pOut << "ID:"; PrintStyleId( pStd->sti );
- *pOut << "BasedOn:"; PrintStyleId( pStd->istdBase );
- ByteString sName( aStr, RTL_TEXTENCODING_MS_1252 );
- *pOut << "Next:" << pStd->istdNext << " Name:\"" << sName.GetBuffer() << "\"";
- *pOut << endl1 << " ";
- *pOut << "cbStd:" << cbStd << ' ';
- *pOut << "No of Upx & Upe:" << pStd->cupx << ' ';
- *pOut << "bchUpe:" << pStd->bchUpe << ' ';
- *pOut << "nSkip:" << nSkip << endl1;
- }else{ // leerer Slot
- *pOut << "empty Slot Nr:" << nNr << endl1;
- }
-
- long nPos = xTableStream->Tell(); // falls etwas falsch interpretiert
- // wird, gehts danach wieder richtig
-
- if( pStd && ( pStd->sgc == 1 || pStd->sgc == 2 ) )
- DumpStyleGrupx( nVersion, nSkip, pStd->sgc == 1 );
-
- if ( aStr.Len() ) // echter Style
- end( *pOut, *xTableStream ) << c << "-Style" << endl1;
-
- xTableStream->Seek( nPos+nSkip );
-
- DELETEZ( pStd );
-}
-
-void DStyle::Dump()
-{
- *pOut << hex6 << nStyleStart << ' ' << dec2 << indent1;
-
- *pOut << begin1 << cstd << " Styles, ";
- *pOut << "Base:" << cbSTDBaseInFile;
- *pOut << ", Written:" << (fStdStylenamesWritten) ? 'T' : 'F';
- *pOut << ", MaxSti:" << stiMaxWhenSaved;
- *pOut << ", MaxFix:" << istdMaxFixedWhenSaved;
- *pOut << ", BuildIn:" << nVerBuiltInNamesWhenSaved;
- *pOut << ", StdFnt:" << ftcStandardChpStsh << endl1;
-
- sal_uInt16 i;
- for( i=0; i<cstd; i++ )
- Dump1Style( i );
-
- end( *pOut, *xTableStream ) << "Styles" << endl1 << endl1;
-}
-
-//-----------------------------------------
-// Main
-//-----------------------------------------
-
-//char cName [266];
-//char cOutName [266];
-
-int PrepareConvert( String& rName, String& rOutName, String& rMess )
-{
- pxStor = new SvStorageRef( new SvStorage( rName, STREAM_STD_READ ) );
- xStrm = (*pxStor)->OpenStream( String::CreateFromAscii( "WordDocument" ),
- STREAM_STD_READ );
-
- if ( !xStrm.Is() /* || xStrm->GetError() */ ){
- rMess.AppendAscii( "Kann StorageStream \"WordDocument\" in " );
- rMess += rName;
- rMess.AppendAscii( " nicht zum Lesen oeffnen" );
- DELETEZ( pxStor );
- return 1;
- }
-
- sal_uLong nL;
- if ( xStrm->Read( &nL, sizeof( nL ) ) == 0 ){
- rMess.AppendAscii( "Kann aus StorageStream \"WordDocument\" in ");
- rMess += rName;
- rMess.AppendAscii( " nicht Lesen" );
- return 1;
- }
- xStrm->Seek( 0 );
-
- ByteString sOutName( rOutName, RTL_TEXTENCODING_MS_1252 );
- pOut = new fstream( sOutName.GetBuffer(), ios::out );
- if ( !pOut )
- {
- rMess.AppendAscii( "Kann Ausgabedatei " );
- rMess += rOutName;
- rMess.AppendAscii( " nicht zum Schreiben oeffnen" );
- return 1;
- }
-
- rMess.AppendAscii( "Ausgabe von " );
- rMess += rName;
- rMess.AppendAscii( " in Datei " );
- rMess += rOutName;
- rMess.AppendAscii( "......" );
-
- if ( xStrm->Read( &nL, sizeof( nL ) ) == 0 ){
- return 1;
- }
- xStrm->Seek( 0 );
-
- return 0;
-}
-
-int DoConvert( const String& rName, sal_uInt8 nVersion )
-{
- sal_uLong nL;
- if ( xStrm->Read( &nL, sizeof( nL ) ) == 0 ){
- return 1;
- }
- xStrm->Seek( 0 );
-
- pWwFib = new DFib( *xStrm, nVersion );
-
- if ( pWwFib->nFibError )
- return 1;
-
- // Nachdem wir nun den FIB eingelesen haben, wissen wir ja,
- // welcher Table-Stream gueltig ist.
- // Diesen oeffnen wir nun.
-
- switch( pWwFib->nVersion ) // 6 steht fuer "6 ODER 7", 7 steht fuer "NUR 7"
- {
- case 6:
- case 7:
- xTableStream = &xStrm;
- xDataStream = &xStrm;
- break;
- case 8:
- xTableStream = (*pxStor)->OpenStream( String::CreateFromAscii(
- ( 1 == pWwFib->fWhichTblStm ) ? "1Table" : "0Table" ),
- STREAM_STD_READ );
- xDataStream = (*pxStor)->OpenStream( String::CreateFromAscii(
- "Data" ), STREAM_STD_READ | STREAM_NOCREATE );
- if( !xDataStream.Is() || SVSTREAM_OK != xDataStream->GetError() )
- xDataStream = &xStrm;
- break;
- default:// Programm-Fehler!
- /*
- ACHTUNG: im FILTER nicht "sal_False" sondern "!this()" schreiben,
- da sonst Warning unter OS/2
- */
- ASSERT( sal_False, "Es wurde vergessen, nVersion zu kodieren!" );
- return 1;
- }
-
-
- // dann erstmal den Dateinamen schreiben:
- {
- ByteString sName( rName, RTL_TEXTENCODING_MS_1252 );
- *pOut << "Datei: " << sName.GetBuffer() << endl;
- }
- pSBase = new WW8ScannerBase( &xStrm, &xTableStream, &xDataStream, pWwFib );
-
- // erstmal die Lowlevel-Funktionen
-
- ((DFib*)pWwFib)->Dump(); // FIB
- DumpDop( *pWwFib ); // WW8_DOP
-
- if( ( 8 > pWwFib->nVersion && pWwFib->fComplex ) ||
- pWwFib->lcbClx )
- DumpPcd( pWwFib->nVersion, pWwFib->fcClx, pWwFib->lcbClx );
-
- DumpBookLow();
-
- DumpBookHigh();
-
-
- DumpPLCF( pWwFib->fcPlcfsed, pWwFib->lcbPlcfsed, SEP ); // SEPX
-
- DumpPLCF( pWwFib->fcPlcfbteChpx, pWwFib->lcbPlcfbteChpx, CHP ); // CHPX
-
- DumpPLCF( pWwFib->fcPlcfbtePapx, pWwFib->lcbPlcfbtePapx, PAP ); // PAPX
-
- {
- DStyle aStyle( *xTableStream, *pWwFib ); // Styles
- aStyle.Dump();
- }
-
- DumpFonts(); // WW8_FFN
-
- // ... und jetzt die High-Level-Funktionen
-
- WW8_CP nStartCp = 0;
-
- DumpPlainText( nStartCp, pWwFib->ccpText, "Main" );
- *pOut << endl1;
- DumpField1( pWwFib->fcPlcffldMom, pWwFib->lcbPlcffldMom,
- "MainText Fields" );
-
- DumpHeader( pSBase ); // Header / Footer
- DumpField1( pWwFib->fcPlcffldHdr, pWwFib->lcbPlcffldHdr,
- "Header/Footer Fields" );
-
- DumpFootnotes( pSBase );
- DumpField1( pWwFib->fcPlcffldFtn, pWwFib->lcbPlcffldFtn,
- "Footnote Fields" );
-
- DumpEndnotes( pSBase );
- DumpField1( pWwFib->fcPlcffldEdn, pWwFib->lcbPlcffldEdn,
- "Endnote Fields" );
-
- DumpAnnotations( pSBase );
-
- DumpTextBoxs( pSBase );
-
- DumpField1( pWwFib->fcPlcffldTxbx, pWwFib->lcbPlcffldTxbx,
- "Textbox Fields" );
- DumpField1( pWwFib->fcPlcffldHdrTxbx, pWwFib->lcbPlcffldHdrTxbx,
- "Header/Footer Textbox Fields" );
-
- if( 8 == pWwFib->nVersion )
- DumpNumList();
-
- DumpFdoa( pSBase );
-
- if( pWwFib->lcbPlcfspaHdr || pWwFib->lcbPlcfspaMom )
- DumpDrawing();
-
- DELETEZ( pSBase );
- DELETEZ( pWwFib );
- return 0;
-}
-
-void DeInit()
-{
-// DELETEZ( aWwStor );
- xStrm.Clear();
- DELETEZ( pxStor );
- DELETEZ( pOut );
-}
-
-
diff --git a/sw/source/filter/ww8/dump/msvbasic.cxx b/sw/source/filter/ww8/dump/msvbasic.cxx
deleted file mode 100644
index f102235ed152..000000000000
--- a/sw/source/filter/ww8/dump/msvbasic.cxx
+++ /dev/null
@@ -1,536 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-
-
-#include <string.h> // memset(), ...
-#ifndef UNX
-#include <io.h> // access()
-#endif
-#include <msvbasic.hxx>
-
-/* class VBA_Impl:
- * The VBA class provides a set of methods to handle Visual Basic For
- * Applications streams, the constructor is given the root ole2 stream
- * of the document, Open reads the VBA project file and figures out
- * the number of VBA streams, and the offset of the data within them.
- * Decompress decompresses a particular numbered stream, NoStreams returns
- * this number, and StreamName can give you the streams name. Decompress
- * will call Output when it has a 4096 byte collection of data to output,
- * and also with the final remainder of data if there is still some left
- * at the end of compression. Output is virtual to allow custom handling
- * of each chunk of decompressed data. So inherit from this to do something
- * useful with the data.
- *
- * cmc
- * */
-
-sal_uInt8 VBA_Impl::ReadPString(SvStorageStreamRef &xVBAProject)
-{
- sal_uInt16 idlen;
- sal_uInt8 type=0;
- *xVBAProject >> idlen;
- sal_uInt8 out;
- int i=0;
- if (idlen < 6)
- {
- type=0;
- xVBAProject->SeekRel(-2);
- return(type);
- }
-
- for(i=0;i<idlen/2;i++)
- {
- *xVBAProject >> out;
- xVBAProject->SeekRel(1);
- if (i==2)
- {
- type=out;
- if ((type != 'G') && (type != 'C'))
- type=0;
- if (type == 0)
- {
- xVBAProject->SeekRel(-8);
- break;
- }
- }
- }
-
-
- return(type);
-}
-
-void VBA_Impl::ConfirmFixedOctect(SvStorageStreamRef &xVBAProject)
-{
- static const sal_uInt8 stest[8] =
- {
- 0x06, 0x02, 0x01, 0x00, 0x08, 0x02, 0x00, 0x00
- };
-
- sal_uInt8 test[8];
- xVBAProject->Read(test,8);
- if (memcmp(stest,test,8) != 0)
- DBG_WARNING("Found a different octect, please report");
-}
-
-void VBA_Impl::Confirm12Zeros(SvStorageStreamRef &xVBAProject)
-{
- static const sal_uInt8 stest[12]={0};
- sal_uInt8 test[12];
- xVBAProject->Read(test,12);
- if (memcmp(stest,test,12) != 0)
- DBG_WARNING("Found a Non Zero block, please report");
-}
-
-void VBA_Impl::ConfirmHalfWayMarker(SvStorageStreamRef &xVBAProject)
-{
- static const sal_uInt8 stest[12]={0,0,0,0,0,0,0,0,0,0,1,0};
- sal_uInt8 test[12];
- xVBAProject->Read(test,12);
- if (memcmp(stest,test,12) != 0)
- DBG_WARNING("Found a different halfway marker, please report");
-}
-
-void VBA_Impl::ConfirmFixedMiddle(SvStorageStreamRef &xVBAProject)
-{
- static const sal_uInt8 stest[20] =
- {
- 0x00, 0x00, 0xe1, 0x2e, 0x45, 0x0d, 0x8f, 0xe0,
- 0x1a, 0x10, 0x85, 0x2e, 0x02, 0x60, 0x8c, 0x4d,
- 0x0b, 0xb4, 0x00, 0x00
- };
-
- sal_uInt8 test[20];
- xVBAProject->Read(test,20);
- if (memcmp(stest,test,20) != 0)
- {
- DBG_WARNING("Found a different middle marker, please report");
- xVBAProject->SeekRel(-20);
- }
-}
-
-void VBA_Impl::ConfirmFixedMiddle2(SvStorageStreamRef &xVBAProject)
-{
- static const sal_uInt8 stest[20] =
- {
- 0x00, 0x00, 0x2e, 0xc9, 0x27, 0x8e, 0x64, 0x12,
- 0x1c, 0x10, 0x8a, 0x2f, 0x04, 0x02, 0x24, 0x00,
- 0x9c, 0x02, 0x00, 0x00
- };
-
- sal_uInt8 test[20];
- xVBAProject->Read(test,20);
- if (memcmp(stest,test,20) != 0)
- {
- DBG_WARNING("Found a different middle2 marker, please report");
- xVBAProject->SeekRel(-20);
- }
-}
-
-
-void VBA_Impl::Output( int nLen, const sal_uInt8 *pData)
-{
- sVBAString += String( (const sal_Char *)pData, nLen );
-/*
-//For debugging purposes
- for(int i=0;i<len;i++)
- *pOut << data[i];
-*/
-}
-
-
-int VBA_Impl::ReadVBAProject(const SvStorageRef &rxVBAStorage)
- {
- SvStorageStreamRef xVBAProject;
- xVBAProject = rxVBAStorage->OpenStream(
- String::CreateFromAscii( "_VBA_PROJECT" ),
- STREAM_STD_READ | STREAM_NOCREATE );
-
- if( !xVBAProject.Is() || SVSTREAM_OK != xVBAProject->GetError() )
- {
- DBG_WARNING("Not able to find vba project, cannot find macros");
- return(0);
- }
- xVBAProject->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
-
- //*pOut << hex;
- sal_uInt8 header[30] =
- {
- 0xcc, 0x61, 0x5e, 0x00, 0x00, 0x01, 0x00, 0xff,
- 0x07, 0x04, 0x00, 0x00, 0x09, 0x04, 0x00, 0x00,
- 0xe4, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00
- };
- sal_uInt8 headerin[30];
-
- xVBAProject->Read(headerin,30);
- if (memcmp(header,headerin,30) != 0)
- DBG_WARNING("Warning VBA header is different, please report");
- sal_uInt16 value;
- *xVBAProject >> value;
- //*pOut << "Trigger value 1 is " << value << endl;
- sal_uInt16 svalue;
- *xVBAProject >> svalue;
- if (svalue != 0x02)
- DBG_WARNING("Warning VBA number is different, please report");
-
- int count=0;
- sal_uInt8 testc=0;
-
- //*pOut << "Other strings after the middle are..." << endl;
- //There appears to be almost any number of strings acceptable
- //most begin with */G , and sometimes with
- //*/C. Those with G always have a trailer of 12 bytes, those
- //with C come in pairs, the first with no trailer, and the
- //second with one of 12 bytes. The following code attemts
- //to read these strings and ends when it reaches a sequence of
- //bytes which fails a test to be a valid string. So this
- //while loop here is the particular piece of code which is
- //very suspect and likely to be the cause of any crashes and
- //problems.
- while ((testc = ReadPString(xVBAProject)) != 0)
- {
- //*pOut << endl;
- //*pOut << "testcharacter is " << testc << endl;
- switch (testc)
- {
- case 'C':
- count++;
- if (count == 2)
- {
- Confirm12Zeros(xVBAProject);
- count=0;
- }
- break;
- default:
- case 'G':
- Confirm12Zeros(xVBAProject);
- break;
- }
- }
-
- //appears to be a fixed 20 byte sequence here, and then the strings
- //continue
- ConfirmFixedMiddle(xVBAProject);
-
- count=0;
- testc=0;
-
- while ((testc = ReadPString(xVBAProject)) != 0)
- {
- //*pOut << endl;
- //*pOut << "testcharacter is " << testc << endl;
- switch (testc)
- {
- case 'C':
- count++;
- if (count == 2)
- {
- Confirm12Zeros(xVBAProject);
- count=0;
- }
- break;
- default:
- case 'G':
- Confirm12Zeros(xVBAProject);
- break;
- }
- }
-
- //there *may* be another different 20byte fixed string
- ConfirmFixedMiddle2(xVBAProject);
-
- //*pOut << "testc is " << testc << endl;
- //*pOut << "position is " << xVBAProject->Tell() << endl;
-
- sal_uInt16 nModules;
- *xVBAProject >> nModules;
-
- //begin section, this section isn't really 100% correct
- //*pOut << nModules << hex << " vba modules" << endl;
- xVBAProject->SeekRel(2*nModules);
- xVBAProject->SeekRel(4);
- //*pOut << "position is " << xVBAProject->Tell() << endl;
- ConfirmFixedOctect(xVBAProject);
-
- sal_uInt16 junksize;
- while(junksize != 0xFFFF)
- {
- xVBAProject->Read(&junksize,2); // usually 18 02, sometimes 1e 02
- //but sometimes its a run of numbers until 0xffff, gagh!!!
- //*pOut << "position is " << xVBAProject->Tell() << "len is "
- // << junksize << endl;
- }
-
- sal_uInt16 ftest;
- *xVBAProject >> ftest;
- if (ftest != 0xFFFF)
- xVBAProject->SeekRel(ftest);
- *xVBAProject >> ftest;
- if (ftest != 0xFFFF)
- xVBAProject->SeekRel(ftest);
-
- xVBAProject->SeekRel(100);
- //*pOut << "position is " << xVBAProject->Tell() << endl;
- //end section
-
-
- *xVBAProject >> nOffsets;
- pOffsets = new VBAOffset_Impl[nOffsets];
- int i;
- for (i=0;i<nOffsets;i++)
- {
- sal_uInt8 discard;
- sal_uInt16 len;
- *xVBAProject >> len;
- int j;
- for (j=0;j<len/2;j++)
- {
- *xVBAProject >> discard;
- pOffsets[i].sName += discard;
- *xVBAProject >> discard;
- }
- *xVBAProject >> len;
- xVBAProject->SeekRel(len);
-
- //begin section, another problem area
- *xVBAProject >> len;
- if (len == 0xFFFF)
- {
- xVBAProject->SeekRel(2);
- *xVBAProject >> len;
- xVBAProject->SeekRel(len);
- }
- else
- xVBAProject->SeekRel(len+2);
- //
- /* I have a theory that maybe you read a 16bit len, and
- * if it has 0x02 for the second byte then it is a special
- * token of its own that affects nothing else, otherwise
- * it is a len of the following data. C. I must test this
- * theory later.
- */
- //end section
-
- xVBAProject->SeekRel(8);
- sal_uInt8 no_of_octects;
- *xVBAProject >> no_of_octects;
- for(j=0;j<no_of_octects;j++)
- xVBAProject->SeekRel(8);
- xVBAProject->SeekRel(6);
-
- *xVBAProject >> pOffsets[i].nOffset;
- //*pOut << pOffsets[i].pName.GetStr() << " at 0x" << hex << pOffsets[i].nOffset << endl;
- xVBAProject->SeekRel(2);
- }
-
- //*pOut << endl;
- return(nOffsets);
- }
-
-sal_Bool VBA_Impl::Open( const String &rToplevel,const String &rSublevel )
-{
- /* beginning test for vba stuff */
- sal_Bool bRet = sal_False;
- SvStorageRef xMacros= xStor->OpenStorage(rToplevel);
- if( !xMacros.Is() || SVSTREAM_OK != xMacros->GetError() )
- {
- DBG_WARNING("No Macros Storage");
- }
- else
- {
- xVBA = xMacros->OpenStorage(rSublevel);
- if( !xVBA.Is() || SVSTREAM_OK != xVBA->GetError() )
- {
- DBG_WARNING("No Visual Basic in Storage");
- }
- else
- {
- if (ReadVBAProject(xVBA))
- bRet = sal_True;
- }
- }
- /* end test for vba stuff */
- return bRet;
-}
-
-const String &VBA_Impl::Decompress( sal_uInt16 nIndex, int *pOverflow)
-{
- SvStorageStreamRef xVBAStream;
- sVBAString.Erase();
-
- DBG_ASSERT( nIndex < nOffsets, "Index out of range" );
- xVBAStream = xVBA->OpenStream( pOffsets[nIndex].sName,
- STREAM_STD_READ | STREAM_NOCREATE );
- if (pOverflow)
- *pOverflow=0;
- if( !xVBAStream.Is() || SVSTREAM_OK !=
- xVBAStream->GetError() )
- {
- DBG_WARNING("Not able to open vb module ");
-// DBG_WARNING((pOffsets[nIndex].sName).GetStr());
- }
- else
- {
- xVBAStream->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- DecompressVBA(nIndex,xVBAStream);
- /*
- * if len was too big for a single string set that variable ?
- * if ((len > XX) && (pOverflow))
- *pOverflow=1;
- */
- if (bCommented)
- {
- String sTempStringa(String::CreateFromAscii( "\x0D\x0A"));
- String sTempStringb(String::CreateFromAscii( "\x0D\x0ARem "));
- sVBAString.SearchAndReplaceAll(sTempStringa,sTempStringb);
- sVBAString.InsertAscii("Rem ",0);
- }
- }
- return sVBAString;
-}
-
-
-int VBA_Impl::DecompressVBA( int nIndex, SvStorageStreamRef &xVBAStream )
-{
- sal_uInt8 leadbyte;
- unsigned int pos = 0;
-
- //*pOut << "jumping to " << hex << offsets[nIndex].offset << endl;
- xVBAStream->Seek(pOffsets[nIndex].nOffset+3);
-
- int len;
- sal_uInt16 token;
- int distance, shift, clean=1;
-
- while(xVBAStream->Read(&leadbyte,1))
- {
- //*pOut << "reading 8 data unit block beginning with " << leadbyte << int(leadbyte) << " at pos " << xVBAStream->Tell() << " real pos " << pos << endl;
- for(int position=0x01;position < 0x100;position=position<<1)
- {
- //we see if the leadbyte has flagged this location as a dataunit
- //which is actually a token which must be looked up in the history
- if (leadbyte & position)
- {
- *xVBAStream >> token;
-
- if (clean == 0)
- clean=1;
-
- //For some reason the division of the token into the length
- //field of the data to be inserted, and the distance back into
- //the history differs depending on how full the history is
- int pos2 = pos%WINDOWLEN;
- if (pos2 <= 0x10)
- shift = 12;
- else if (pos2 <= 0x20)
- shift = 11;
- else if (pos2 <= 0x40)
- shift = 10;
- else if (pos2 <= 0x80)
- shift = 9;
- else if (pos2 <= 0x100)
- shift = 8;
- else if (pos2 <= 0x200)
- shift = 7;
- else if (pos2 <= 0x400)
- shift = 6;
- else if (pos2 <= 0x800)
- shift = 5;
- else
- shift = 4;
-
- int i;
- len=0;
- for(i=0;i<shift;i++)
- len |= token & (1<<i);
-
- //*pOut << endl << "match lookup token " << int(token) << "len " << int(len) << endl;
-
- len += 3;
- //*pOut << endl << "len is " << len << "shift is " << shift << endl;
-
- distance = token >> shift;
- //*pOut << "distance token shift is " << distance << " " << int(token) << " " << shift << "pos is " << pos << " " << xVBAStream->Tell() << endl;
-
- //read the len of data from the history, wrapping around the
- //WINDOWLEN boundary if necessary
- //data read from the history is also copied into the recent
- //part of the history as well.
- for (i = 0; i < len; i++)
- {
- unsigned char c;
- //*pOut << endl << (pos%WINDOWLEN)-distance-1 << " " << pos << " " << distance << endl;
- c = aHistory[(pos-distance-1)%WINDOWLEN];
- aHistory[pos%WINDOWLEN] = c;
- pos++;
- //*pOut << "real pos is " << pos << endl;
- //
- //temp removed
- //*pOut << c ;
- }
- }
- else
- {
- // special boundary case code, not guarantueed to be correct
- // seems to work though, there is something wrong with the
- // compression scheme (or maybe a feature) where when
- // the data ends on a WINDOWLEN boundary and the excess
- // bytes in the 8 dataunit list are discarded, and not
- // interpreted as tokens or normal data.
- if ((pos != 0) && ((pos%WINDOWLEN) == 0) && (clean))
- {
- //*pOut << "at boundary position is " << position << " " << xVBAStream->Tell() << " pos is " << pos << endl;
- //if (position != 0x01)
- //*pOut << "must restart by eating remainder single byte data units" << endl;
- xVBAStream->SeekRel(2);
- clean=0;
- Output(WINDOWLEN,aHistory);
- break;
- }
- //This is the normal case for when the data unit is not a
- //token to be looked up, but instead some normal data which
- //can be output, and placed in the history.
- if (xVBAStream->Read(&aHistory[pos%WINDOWLEN],1))
- {
- pos++;
- //temp removed
- //*pOut << aHistory[pos++%WINDOWLEN];
- }
- if (clean == 0)
- clean=1;
- //*pOut << "pos is " << pos << " " << xVBAStream->Tell() << endl;
- }
- }
- }
- if (pos%WINDOWLEN)
- Output(pos%WINDOWLEN,aHistory);
- return(pos);
-}
-
diff --git a/sw/source/filter/ww8/dump/msvbasic.hxx b/sw/source/filter/ww8/dump/msvbasic.hxx
deleted file mode 100644
index 9b5128a70e7c..000000000000
--- a/sw/source/filter/ww8/dump/msvbasic.hxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _MSVBASIC_HXX
-#define _MSVBASIC_HXX
-
-#ifdef _SOLAR_H
-#include <tools/solar.h>
-#endif
-#include <tools/debug.hxx>
-#include <sot/storage.hxx>
-
-
-/* class VBA:
- * The VBA class provides a set of methods to handle Visual Basic For
- * Applications streams, the constructor is given the root ole2 stream
- * of the document, Open reads the VBA project file and figures out
- * the number of VBA streams, and the offset of the data within them.
- * Decompress decompresses a particular numbered stream, NoStreams returns
- * this number, and StreamName can give you the streams name. Decompress
- * will return a string with the decompressed data. The optional extra
- * argument will be set if not NULL to 1 in the case of a string overflow,
- * if I can figure out how to do that.
- *
- * Otherwise it is possible to inherit from VBA and implement a Output
- * member which gets called with each 4096 output sized block.
- *
- * cmc
- * */
-
-#define WINDOWLEN 4096
-
-class VBA_Impl
-{
-public:
- VBA_Impl( SvStorage &rIn, sal_Bool bCmmntd = sal_True )
- : xStor(&rIn), pOffsets(0), nOffsets(0), bCommented(bCmmntd)
- {}
- ~VBA_Impl() {if (nOffsets) delete [] pOffsets;}
- //0 for failure, 1 for success
- sal_Bool Open( const String &rToplevel, const String &rSublevel);
- const String & Decompress( sal_uInt16 nIndex, int *pOverflow=0);
- sal_uInt16 GetNoStreams() const { return nOffsets; }
- const String &GetStreamName( sal_uInt16 nIndex ) const
- {
- DBG_ASSERT( nIndex < nOffsets, "Index out of range" );
- return pOffsets[ nIndex ].sName;
- }
- virtual void Output(int len,const sal_uInt8 *data);
-private:
- struct VBAOffset_Impl
- {
- String sName;
- sal_uInt32 nOffset;
- };
-
- SvStorageRef xVBA;
- String sVBAString;
- SvStorageRef xStor;
- VBAOffset_Impl *pOffsets;
- sal_uInt16 nOffsets;
- sal_uInt8 aHistory[ WINDOWLEN ];
- sal_Bool bCommented;
-
- //0 for failure, anything else for success
- int ReadVBAProject(const SvStorageRef &rxVBAStorage);
- int DecompressVBA(int index, SvStorageStreamRef &rxVBAStream);
- void Confirm12Zeros(SvStorageStreamRef &xVBAProject);
- void ConfirmHalfWayMarker(SvStorageStreamRef &xVBAProject);
- void ConfirmFixedMiddle(SvStorageStreamRef &xVBAProject);
- void ConfirmFixedMiddle2(SvStorageStreamRef &xVBAProject);
- void ConfirmFixedOctect(SvStorageStreamRef &xVBAProject);
- sal_uInt8 ReadPString(SvStorageStreamRef &xVBAProject);
-};
-
-
-
-
-#endif
diff --git a/sw/source/filter/ww8/dump/ww8darr.cxx b/sw/source/filter/ww8/dump/ww8darr.cxx
deleted file mode 100644
index cf142e703bc3..000000000000
--- a/sw/source/filter/ww8/dump/ww8darr.cxx
+++ /dev/null
@@ -1,546 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-
-#include <stdlib.h>
-
-#include "ww8dout.hxx" // OutShort()
-#include "ww8darr.hxx"
-
-
-
-
-//-----------------------------------------
-
-
-
-SprmDumpInfo aSprmDumpTab[] = {
- 0, (FnOut)0, "NOP(0)",
- 2, OutShort, "sprmPIstd", // pap.istd (style code)
- 3, (FnOut)0, "sprmPIstdPermute", // pap.istd permutation
- 4, OutByte, "sprmPIncLv1", // pap.istddifference
- 5, OutByte, "sprmPJc", // pap.jc (justification)
- 6, OutBool, "sprmPFSideBySide", // pap.fSideBySide
- 7, OutBool, "sprmPFKeep", // pap.fKeep
- 8, OutBool, "sprmPFKeepFollow ", // pap.fKeepFollow
- 9, OutBool, "sprmPPageBreakBefore", // pap.fPageBreakBefore
-
- 10, (FnOut)0, "sprmPBrcl", // pap.brcl
- 11, (FnOut)0, "sprmPBrcp ", // pap.brcp
- 12, (FnOut)0, "sprmPAnld", // pap.anld (ANLD structure)
- 13, OutByte, "sprmPNLvlAnm", // pap.nLvlAnm nn
- 14, OutBool, "sprmPFNoLineNumb", //ap.fNoLnn
-
- //??
- 15, OutTab, "?sprmPChgTabsPapx", // pap.itbdMac, ...
-
-
- 16, OutShort, "sprmPDxaRight", // pap.dxaRight
- 17, OutShort, "sprmPDxaLeft", // pap.dxaLeft
- 18, OutWord, "sprmPNest", // pap.dxaLeft
- 19, OutShort, "sprmPDxaLeft1", // pap.dxaLeft1
-
- 20, OutShorts, "sprmPDyaLine", // pap.lspd an LSPD
- 21, OutWord, "sprmPDyaBefore", // pap.dyaBefore
- 22, OutWord, "sprmPDyaAfter", // pap.dyaAfter
-
-
- //??
- 23, (FnOut)0, "?sprmPChgTabs", // pap.itbdMac, pap.rgdxaTab, ...
-
-
- 24, OutBool, "sprmPFInTable", // pap.fInTable
- 25, OutBool, "sprmPTtp", // pap.fTtp
- 26, OutWord, "sprmPDxaAbs", // pap.dxaAbs
- 27, OutWord, "sprmPDyaAbs", // pap.dyaAbs
- 28, OutWord, "sprmPDxaWidth", // pap.dxaWidth
- 29, (FnOut)0, "sprmPPc", // pap.pcHorz, pap.pcVert
-
- 30, (FnOut)0, "sprmPBrcTop10", // pap.brcTop BRC10
- 31, (FnOut)0, "sprmPBrcLeft10", // pap.brcLeft BRC10
- 32, (FnOut)0, "sprmPBrcBottom10", // pap.brcBottom BRC10
- 33, (FnOut)0, "sprmPBrcRight10", // pap.brcRight BRC10
- 34, (FnOut)0, "sprmPBrcBetween10", // pap.brcBetween BRC10
- 35, (FnOut)0, "sprmPBrcBar10", // pap.brcBar BRC10
- 36, OutWord, "sprmPFromText10", // pap.dxaFromText dxa
- 37, (FnOut)0, "sprmPWr", // pap.wr wr
- 38, OutWordHex, "sprmPBrcTop", // pap.brcTop BRC
- 39, OutWordHex, "sprmPBrcLeft", // pap.brcLeft BRC
-
- 40, OutWordHex, "sprmPBrcBottom", // pap.brcBottom BRC
- 41, OutWordHex, "sprmPBrcRight", // pap.brcRight BRC
- 42, (FnOut)0, "sprmPBrcBetween", // pap.brcBetween BRC
- 43, (FnOut)0, "sprmPBrcBar",//pap.brcBar BRC word
- 44, OutBool, "sprmPFNoAutoHyph",//pap.fNoAutoHyph
- 45, OutWord, "sprmPWHeightAbs",//pap.wHeightAbs w
- 46, (FnOut)0, "sprmPDcs",//pap.dcs DCS
- 47, OutWordHex, "sprmPShd",//pap.shd SHD
- 48, OutWord, "sprmPDyaFromText",//pap.dyaFromText dya
- 49, OutWord, "sprmPDxaFromText",//pap.dxaFromText dxa
-
- 50, OutBool, "sprmPFLocked", // pap.fLocked 0 or 1 byte
- 51, OutBool, "sprmPFWidowControl", // pap.fWidowControl 0 or 1 byte
-
-
- //??
- 52, (FnOut)0, "?sprmPRuler 52", //???
-
-
- 65, OutBool, "sprmCFStrikeRM", // chp.fRMarkDel 1 or 0 bit
- 66, OutBool, "sprmCFRMark", // chp.fRMark 1 or 0 bit
- 67, OutBool, "sprmCFFldVanish", // chp.fFldVanish 1 or 0 bit
- 68, OutTab68, "sprmCPicLocation", // chp.fcPic and chp.fSpec
- 69, OutShort, "sprmCIbstRMark", // chp.ibstRMark index into sttbRMark
-
- 70, (FnOut)0, "sprmCDttmRMark", // chp.dttm DTTM long
- 71, OutBool, "sprmCFData", // chp.fData 1 or 0 bit
- 72, OutShort, "sprmCRMReason", // chp.idslRMReason an index to a table
- 73, (FnOut)0, "sprmCChse", // chp.fChsDiff and chp.chse see below 3 bytes
- 74, (FnOut)0, "sprmCSymbol", // chp.fSpec, chp.chSym and chp.ftcSym
- 75, OutBool, "sprmCFOle2", // chp.fOle2 1 or 0 bit
-
- 80, OutShort, "sprmCIstd", // chp.istd istd, see stylesheet definition short
- 81, (FnOut)0, "sprmCIstdPermute", // chp.istd permutation vector (see below)
- 82, (FnOut)0, "sprmCDefault", // whole CHP (see below) none variable length
- 83, (FnOut)0, "sprmCPlain", // whole CHP (see below) none 0
- 84, (FnOut)0, "??84",
- 85, OutBool4, "sprmCFBold", // chp.fBold 0,1, 128, or 129 (see below) byte
- 86, OutBool4, "sprmCFItalic", // chp.fItalic 0,1, 128, or 129 (see below) byte
- 87, OutBool4, "sprmCFStrike", // chp.fStrike 0,1, 128, or 129 (see below) byte
- 88, OutBool4, "sprmCFOutline", // chp.fOutline 0,1, 128, or 129 (see below) byte
- 89, OutBool4, "sprmCFShadow", // chp.fShadow 0,1, 128, or 129 (see below) byte
-
- 90, OutBool4, "sprmCFSmallCaps", // chp.fSmallCaps 0,1, 128, or 129 (see below) byte
- 91, OutBool4, "sprmCFCaps", // chp.fCaps 0,1, 128, or 129 (see below) byte
- 92, OutBool4, "sprmCFVanish", // chp.fVanish 0,1, 128, or 129 (see below) byte
- 93, OutWord, "sprmCFtc", // chp.ftc ftc word
- 94, OutByte, "sprmCKul", // chp.kul kul byte
- 95, (FnOut)0, "sprmCSizePos", // chp.hps, chp.hpsPos (see below) 3 bytes
- 96, OutWord, "sprmCDxaSpace", // chp.dxaSpace dxa word
- 97, OutWord, "sprmCLid", // chp.lid LID word
- 98, OutByte, "sprmCIco", // chp.ico ico byte
- 99, OutWord, "sprmCHps", // chp.hps hps word!
-
- 100, OutByte, "sprmCHpsInc", // chp.hps (see below) byte
- 101, OutWord, "sprmCHpsPos", // chp.hpsPos hps byte
- 102, OutByte, "sprmCHpsPosAdj", // chp.hpsPos hps (see below) byte
-
-
- //??
- 103, (FnOut)0, "?sprmCMajority", // chp.fBold, chp.fItalic, chp.fSmallCaps, ...
-
-
- 104, OutByte, "sprmCIss", // chp.iss iss byte
- 105, (FnOut)0, "sprmCHpsNew50", // chp.hps hps variable width, length always recorded as 2
- 106, (FnOut)0, "sprmCHpsInc1", // chp.hps complex (see below) variable width, length always recorded as 2
- 107, OutShort, "sprmCHpsKern", // chp.hpsKern hps short
- 108, (FnOut)0, "sprmCMajority50", // chp.fBold, chp.fItalic, chp.fSmallCaps, chp.fVanish, ...
- 109, OutShort, "sprmCHpsMul", // chp.hps percentage to grow hps short
-
- 110, OutShort, "sprmCCondHyhen", // chp.ysri ysri short
- 117, OutBool, "sprmCFSpec", // chp.fSpec 1 or 0 bit
- 118, OutBool, "sprmCFObj", // chp.fObj 1 or 0 bit
- 119, (FnOut)0, "sprmPicBrcl", // pic.brcl brcl (see PIC structure definition) byte
-
- 120, (FnOut)0, "sprmPicScale", // pic.mx, pic.my, pic.dxaCropleft,
- 121, (FnOut)0, "sprmPicBrcTop", // pic.brcTop BRC word
- 122, (FnOut)0, "sprmPicBrcLeft", // pic.brcLeft BRC word
- 123, (FnOut)0, "sprmPicBrcBottom", // pic.brcBottom BRC word
- 124, (FnOut)0, "sprmPicBrcRight", // pic.brcRight BRC word
- 131, OutByte, "sprmSScnsPgn", // sep.cnsPgn cns byte
- 132, (FnOut)0, "sprmSiHeadingPgn", // sep.iHeadingPgn heading number level byte
- 133, (FnOut)0, "sprmSOlstAnm", // sep.olstAnm OLST variable length
- 136, (FnOut)0, "sprmSDxaColWidth", // sep.rgdxaColWidthSpacing complex (see below) 3 bytes
- 137, (FnOut)0, "sprmSDxaColSpacing", // sep.rgdxaColWidthSpacing complex (see below) 3 bytes
- 138, OutBool, "sprmSFEvenlySpaced", // sep.fEvenlySpaced 1 or 0 byte
- 139, OutBool, "sprmSFProtected", // sep.fUnlocked 1 or 0 byte
-
- 140, OutWord, "sprmSDmBinFirst", // sep.dmBinFirst word
- 141, OutWord, "sprmSDmBinOther", // sep.dmBinOther word
- 142, OutByte, "sprmSBkc", // sep.bkc bkc byte
- 143, OutBool, "sprmSFTitlePage", // sep.fTitlePage 0 or 1 byte
- 144, OutWord, "sprmSCcolumns", // sep.ccolM1 # of cols - 1 word
- 145, OutWord, "sprmSDxaColumns", // sep.dxaColumns dxa word
- 146, (FnOut)0, "sprmSFAutoPgn", // sep.fAutoPgn obsolete byte
- 147, OutByte, "sprmSNfcPgn", // sep.nfcPgn nfc byte
- 148, OutShort, "sprmSDyaPgn", // sep.dyaPgn dya short
- 149, OutShort, "sprmSDxaPgn", // sep.dxaPgn dya short
-
- 150, OutBool, "sprmSFPgnRestart", // sep.fPgnRestart 0 or 1 byte
- 151, OutBool, "sprmSFEndnote", // sep.fEndnote 0 or 1 byte
- 152, OutByte, "sprmSLnc", // sep.lnc lnc byte
- 153, (FnOut)0, "sprmSGprfIhdt", // sep.grpfIhdt grpfihdt (see Headers and Footers topic) byte
- 154, OutWord, "sprmSNLnnMod", // sep.nLnnMod non-neg int. word
- 155, OutWord, "sprmSDxaLnn", // sep.dxaLnn dxa word
- 156, OutWord, "sprmSDyaHdrTop", // sep.dyaHdrTop dya word
- 157, OutWord, "sprmSDyaHdrBottom", // sep.dyaHdrBottom dya word
- 158, OutBool, "sprmSLBetween", // sep.fLBetween 0 or 1 byte
- 159, OutByte, "sprmSVjc", // sep.vjc vjc byte
-
- 160, OutWord, "sprmSLnnMin", // sep.lnnMin lnn word
- 161, OutWord, "sprmSPgnStart", // sep.pgnStart pgn word
- 162, OutByte, "sprmSBOrientation", // sep.dmOrientPage dm byte
-
-
- //??
- 163, OutWord, "?SprmSBCustomize 163", //???
-
-
- 164, OutWord, "sprmSXaPage", // sep.xaPage xa word
- 165, OutWord, "sprmSYaPage", // sep.yaPage ya word
- 166, OutWord, "sprmSDxaLeft", // sep.dxaLeft dxa word
- 167, OutWord, "sprmSDxaRight", // sep.dxaRight dxa word
- 168, OutWord, "sprmSDyaTop", // sep.dyaTop dya word
- 169, OutWord, "sprmSDyaBottom", // sep.dyaBottom dya word
-
- 170, OutWord, "sprmSDzaGutter", // sep.dzaGutter dza word
- 171, OutWord, "sprmSDMPaperReq", // sep.dmPaperReq dm word
- 182, OutWord, "sprmTJc", // tap.jc jc word (low order byte is significant)
- 183, OutWord, "sprmTDxaLeft", // tap.rgdxaCenter (see below) dxa word
- 184, OutWord, "sprmTDxaGapHalf", // tap.dxaGapHalf, tap.rgdxaCenter (see below) dxa word
- 185, OutBool, "sprmTFCantSplit", // tap.fCantSplit 1 or 0 byte
- 186, OutBool, "sprmTTableHeader", // tap.fTableHeader 1 or 0 byte
- 187, OutWordsHex, "sprmTTableBorders", // tap.rgbrcTable complex(see below) 12 bytes
- 188, (FnOut)0, "sprmTDefTable10", // tap.rgdxaCenter, tap.rgtc complex (see below) variable length
- 189, OutShort, "sprmTDyaRowHeight", // tap.dyaRowHeight dya word
-
-
- //??
- 190, OutTab190, "sprmTDefTable", // tap.rgtc complex (see below)
-
-
- //??
- 191, OutTab191, "sprmTDefTableShd", // tap.rgshd complex (see below)
-
-
- 192, OutTab192, "sprmTTlp", // tap.tlp TLP 4 bytes
- 193, (FnOut)0, "sprmTSetBrc", // tap.rgtc[].rgbrc complex (see below) 5 bytes
- 194, (FnOut)0, "sprmTInsert", // tap.rgdxaCenter,tap.rgtc complex (see below) 4 bytes
- 195, (FnOut)0, "sprmTDelete", // tap.rgdxaCenter, tap.rgtc complex (see below) word
- 196, (FnOut)0, "sprmTDxaCol", // tap.rgdxaCenter complex (see below) 4 bytes
- 197, (FnOut)0, "sprmTMerge", // tap.fFirstMerged, tap.fMerged complex (see below) word
- 198, (FnOut)0, "sprmTSplit", // tap.fFirstMerged, tap.fMerged complex (see below) word
- 199, (FnOut)0, "sprmTSetBrc10", // tap.rgtc[].rgbrc complex (see below) 5 bytes
-
- 200, (FnOut)0, "sprmTSetShd", // tap.rgshd complex (see below) 4 bytes
-
-
-
- // ab hier Selbstdefinierte Ids
-
- 256, (FnOut)0, "FootNote",
- 257, (FnOut)0, "EndNote",
- 258, (FnOut)0, "??258 selbstdef.",
- 259, (FnOut)0, "??259 selbstdef.",
- 260, (FnOut)0, "Field",
-
-//- neue ab Ver8 ------------------------------------------------------------
-
- 0x4600, OutShort,"sprmPIstd", // pap.istd;istd (style code);short;
- 0xC601, (FnOut)0,"sprmPIstdPermute", // pap.istd;permutation vector (see below);variable length;
- 0x2602, OutByte, "sprmPIncLvl", // pap.istd, pap.lvl;difference between istd of base PAP and istd of PAP to be produced (see below);byte;
- 0x2403, OutByte, "sprmPJc", // pap.jc;jc (justification);byte;
- 0x2404, OutByte, "sprmPFSideBySide", // pap.fSideBySide;0 or 1;byte;
- 0x2405, OutByte, "sprmPFKeep", // pap.fKeep;0 or 1;byte;
- 0x2406, OutByte, "sprmPFKeepFollow", // pap.fKeepFollow;0 or 1;byte;
- 0x2407, OutByte, "sprmPFPageBreakBefore", // pap.fPageBreakBefore;0 or 1;byte;
- 0x2408, OutByte, "sprmPBrcl", // pap.brcl;brcl;byte;
- 0x2409, OutByte, "sprmPBrcp", // pap.brcp;brcp;byte;
- 0x260A, OutByte, "sprmPIlvl", // pap.ilvl;ilvl;byte;
- 0x460B, OutShort, "sprmPIlfo", // pap.ilfo;ilfo (list index) ;short;
- 0x240C, OutByte, "sprmPFNoLineNumb", // pap.fNoLnn;0 or 1;byte;
- 0xC60D, OutTab, "sprmPChgTabsPapx", // pap.itbdMac, pap.rgdxaTab, pap.rgtbd;complex - see below;variable length
- 0x840E, OutWord, "sprmPDxaRight", // pap.dxaRight;dxa;word;
- 0x840F, OutWord, "sprmPDxaLeft", // pap.dxaLeft;dxa;word;
- 0x4610, OutWord, "sprmPNest", // pap.dxaLeft;dxa-see below;word;
- 0x8411, OutWord, "sprmPDxaLeft1", // pap.dxaLeft1;dxa;word;
- 0x6412,OutLongHex,"sprmPDyaLine", // pap.lspd;an LSPD, a long word structure consisting of a short of dyaLine followed by a short of fMultLinespace - see below;long;
- 0xA413, OutWord, "sprmPDyaBefore", // pap.dyaBefore;dya;word;
- 0xA414, OutWord, "sprmPDyaAfter", // pap.dyaAfter;dya;word;
- 0xC615, (FnOut)0,"sprmPChgTabs", // pap.itbdMac, pap.rgdxaTab, pap.rgtbd;complex - see below;variable length;
- 0x2416, OutByte, "sprmPFInTable", // pap.fInTable;0 or 1;byte;
- 0x2417, OutByte, "sprmPFTtp", // pap.fTtp;0 or 1;byte;
- 0x8418, OutWord, "sprmPDxaAbs", // pap.dxaAbs;dxa;word;
- 0x8419, OutWord, "sprmPDyaAbs", // pap.dyaAbs;dya;word;
- 0x841A, OutWord, "sprmPDxaWidth", // pap.dxaWidth;dxa;word;
- 0x261B, OutByte, "sprmPPc", // pap.pcHorz, pap.pcVert;complex - see below;byte;
- 0x461C, OutWord, "sprmPBrcTop10", // pap.brcTop;BRC10;word;
- 0x461D, OutWord, "sprmPBrcLeft10", // pap.brcLeft;BRC10;word;
- 0x461E, OutWord, "sprmPBrcBottom10", // pap.brcBottom;BRC10;word;
- 0x461F, OutWord, "sprmPBrcRight10", // pap.brcRight;BRC10;word;
- 0x4620, OutWord, "sprmPBrcBetween10", // pap.brcBetween;BRC10;word;
- 0x4621, OutWord, "sprmPBrcBar10", // pap.brcBar;BRC10;word;
- 0x4622, OutWord, "sprmPDxaFromText10", // pap.dxaFromText;dxa;word;
- 0x2423, OutByte, "sprmPWr", // pap.wr;wr (see description of PAP for definition;byte;
- 0x6424,OutLongHex,"sprmPBrcTop", // pap.brcTop;BRC;long;
- 0x6425,OutLongHex,"sprmPBrcLeft", // pap.brcLeft;BRC;long;
- 0x6426,OutLongHex,"sprmPBrcBottom", // pap.brcBottom;BRC;long;
- 0x6427,OutLongHex,"sprmPBrcRight", // pap.brcRight;BRC;long;
- 0x6428,OutLongHex,"sprmPBrcBetween", // pap.brcBetween;BRC;long;
- 0x6629,OutLongHex,"sprmPBrcBar", // pap.brcBar;BRC;long;
- 0x242A, OutByte, "sprmPFNoAutoHyph", // pap.fNoAutoHyph;0 or 1;byte;
- 0x442B, OutWord, "sprmPWHeightAbs", // pap.wHeightAbs;w;word;
- 0x442C, OutShort,"sprmPDcs", // pap.dcs;DCS;short;
- 0x442D, OutWord, "sprmPShd", // pap.shd;SHD;word;
- 0x842E, OutWord, "sprmPDyaFromText", // pap.dyaFromText;dya;word;
- 0x842F, OutWord, "sprmPDxaFromText", // pap.dxaFromText;dxa;word;
- 0x2430, OutByte, "sprmPFLocked", // pap.fLocked;0 or 1;byte;
- 0x2431, OutByte, "sprmPFWidowControl", // pap.fWidowControl;0 or 1;byte;
- 0xC632, (FnOut)0,"sprmPRuler", // ;;variable length;
- 0x2433, OutByte, "sprmPFKinsoku", // pap.fKinsoku;0 or 1;byte;
- 0x2434, OutByte, "sprmPFWordWrap", // pap.fWordWrap;0 or 1;byte;
- 0x2435, OutByte, "sprmPFOverflowPunct", // pap.fOverflowPunct;0 or 1;byte;
- 0x2436, OutByte, "sprmPFTopLinePunct", // pap.fTopLinePunct;0 or 1;byte;
- 0x2437, OutByte, "sprmPFAutoSpaceDE", // pap.fAutoSpaceDE;0 or 1;byte;
- 0x2438, OutByte, "sprmPFAutoSpaceDN", // pap.fAutoSpaceDN;0 or 1;byte;
- 0x4439, OutWord, "sprmPWAlignFont", // pap.wAlignFont;iFa (see description of PAP for definition);word;
- 0x443A, OutWord, "sprmPFrameTextFlow", // pap.fVertical pap.fBackward pap.fRotateFont;complex (see description of PAP for definition);word;
- 0x243B, OutByte, "sprmPISnapBaseLine", // obsolete: not applicable in Word97 and later versions;;byte;
- 0xC63E, (FnOut)0,"sprmPAnld", // pap.anld;;variable length;
- 0xC63F, (FnOut)0,"sprmPPropRMark", // pap.fPropRMark;complex (see below);variable length;
- 0x2640, OutByte, "sprmPOutLvl", // pap.lvl;has no effect if pap.istd is < 1 or is > 9;byte;
- 0x2441, OutByte, "sprmPFBiDi", // ;;byte;
- 0x2443, OutBool, "sprmPFNumRMIns", // pap.fNumRMIns;1 or 0;bit;
- 0x2444, OutByte, "sprmPCrLf", // ;;byte;
- 0xC645, (FnOut)0,"sprmPNumRM", // pap.numrm;;variable length;
- 0x6645,OutHugeHex,"sprmPHugePapx", // see below;fc in the data stream to locate the huge grpprl (see below);long;
- 0x6646,OutHugeHex,"sprmPHugePapx", // see below;fc in the data stream to locate the huge grpprl (see below);long;
- 0x2447, OutByte, "sprmPFUsePgsuSettings", // pap.fUsePgsuSettings;1 or 0;byte;
- 0x2448, OutByte, "sprmPFAdjustRight", // pap.fAdjustRight;1 or 0;byte;
- 0x0800, OutBool, "sprmCFRMarkDel", // chp.fRMarkDel;1 or 0;bit;
- 0x0801, OutBool, "sprmCFRMark", // chp.fRMark;1 or 0;bit;
- 0x0802, OutBool, "sprmCFFldVanish", // chp.fFldVanish;1 or 0;bit;
- 0x6A03, OutTab68,"sprmCPicLocation", // chp.fcPic and chp.fSpec;see below;variable length, length recorded is always 4;
- 0x4804, OutShort,"sprmCIbstRMark", // chp.ibstRMark;index into sttbRMark;short;
- 0x6805,OutLongHex,"sprmCDttmRMark", // chp.dttmRMark;DTTM;long;
- 0x0806, OutBool, "sprmCFData", // chp.fData;1 or 0;bit;
- 0x4807, OutShort, "sprmCIdslRMark", // chp.idslRMReason;an index to a table of strings defined in Word 6.0 executables;short;
- 0xEA08, (FnOut)0,"sprmCChs", // chp.fChsDiff and chp.chse;see below;3 bytes;
- 0x6A09, (FnOut)0,"sprmCSymbol", // chp.fSpec, chp.xchSym and chp.ftcSym;see below;variable length, length recorded is always 4;
- 0x080A, OutBool, "sprmCFOle2", // chp.fOle2;1 or 0;bit;
-//0x480B, obsolete,"sprmCIdCharType", // obsolete: not applicable in Word97 and later versions;;;
- 0x2A0C, OutByte, "sprmCHighlight", // chp.fHighlight, chp.icoHighlight;ico (fHighlight is set to 1 iff ico is not 0);byte;
- 0x680E,OutLongHex,"sprmCObjLocation", // chp.fcObj;FC;long;
-//0x2A10, ? ? ? , "sprmCFFtcAsciSymb", // ;;;
- 0x4A30, OutShort, "sprmCIstd", // chp.istd;istd, see stylesheet definition;short;
- 0xCA31, (FnOut)0,"sprmCIstdPermute", // chp.istd;permutation vector (see below);variable length;
- 0x2A32, (FnOut)0,"sprmCDefault", // whole CHP (see below);none;variable length;
- 0x2A33, (FnOut)0,"sprmCPlain", // whole CHP (see below);none; Laenge: 0;
- 0x2A34, OutByte, "sprmCKcd", // ;;;
- 0x0835, OutByte, "sprmCFBold", // chp.fBold;0,1, 128, or 129 (see below);byte;
- 0x0836, OutByte, "sprmCFItalic", // chp.fItalic;0,1, 128, or 129 (see below);byte;
- 0x0837, OutByte, "sprmCFStrike", // chp.fStrike;0,1, 128, or 129 (see below);byte;
- 0x0838, OutByte, "sprmCFOutline", // chp.fOutline;0,1, 128, or 129 (see below);byte;
- 0x0839, OutByte, "sprmCFShadow", // chp.fShadow;0,1, 128, or 129 (see below);byte;
- 0x083A, OutByte, "sprmCFSmallCaps", // chp.fSmallCaps;0,1, 128, or 129 (see below);byte;
- 0x083B, OutByte, "sprmCFCaps", // chp.fCaps;0,1, 128, or 129 (see below);byte;
- 0x083C, OutByte, "sprmCFVanish", // chp.fVanish;0,1, 128, or 129 (see below);byte;
- 0x4A3D, OutWord, "sprmCFtcDefault", // ;ftc, only used internally, never stored in file;word;
- 0x2A3E, OutByte, "sprmCKul", // chp.kul;kul;byte;
- 0xEA3F, (FnOut)0,"sprmCSizePos", // chp.hps, chp.hpsPos;(see below);3 bytes;
- 0x8840, OutWord, "sprmCDxaSpace", // chp.dxaSpace;dxa;word;
- 0x4A41, OutWord, "sprmCLid", // ;only used internally never stored;word;
- 0x2A42, OutByte, "sprmCIco", // chp.ico;ico;byte;
- 0x4A43, OutWord, "sprmCHps", // chp.hps;hps;word;
- 0x2A44, OutByte, "sprmCHpsInc", // chp.hps;(see below);byte;
- 0x4845, OutByte, "sprmCHpsPos", // chp.hpsPos;hps;byte;
- 0x2A46, OutByte, "sprmCHpsPosAdj", // chp.hpsPos;hps (see below);byte;
- 0xCA47, (FnOut)0,"sprmCMajority", // chp.fBold, chp.fItalic, chp.fSmallCaps, chp.fVanish, chp.fStrike, chp.fCaps, chp.rgftc, chp.hps, chp.hpsPos, chp.kul, chp.dxaSpace, chp.ico, chp.rglid;complex (see below);variable length, length byte plus size of following grpprl;
- 0x2A48, OutByte, "sprmCIss", // chp.iss;iss;byte;
- 0xCA49, (FnOut)0,"sprmCHpsNew50", // chp.hps;hps;variable width, length always recorded as 2;
- 0xCA4A, (FnOut)0,"sprmCHpsInc1", // chp.hps;complex (see below);variable width, length always recorded as 2;
- 0x484B, OutShort,"sprmCHpsKern", // chp.hpsKern;hps;short;
- 0xCA4C, (FnOut)0,"sprmCMajority50", // chp.fBold, chp.fItalic, chp.fSmallCaps, chp.fVanish, chp.fStrike, chp.fCaps, chp.ftc, chp.hps, chp.hpsPos, chp.kul, chp.dxaSpace, chp.ico,;complex (see below);variable length;
- 0x4A4D, OutShort,"sprmCHpsMul", // chp.hps;percentage to grow hps;short;
- 0x484E, OutShort,"sprmCYsri", // chp.ysri;ysri;short;
- 0x4A4F, OutShort,"sprmCRgFtc0", // chp.rgftc[0];ftc for ASCII text (see below);short;
- 0x4A50, OutShort,"sprmCRgFtc1", // chp.rgftc[1];ftc for Far East text (see below);short;
- 0x4A51, OutShort,"sprmCRgFtc2", // chp.rgftc[2];ftc for non-Far East text (see below);short;
-//0x4852, ? ? ? , "sprmCCharScale", // ;;;
- 0x2A53, OutByte, "sprmCFDStrike", // chp.fDStrike;;byte;
- 0x0854, OutBool, "sprmCFImprint", // chp.fImprint;1 or 0;bit;
- 0x0855, OutBool, "sprmCFSpec", // chp.fSpec ;1 or 0;bit;
- 0x0856, OutBool, "sprmCFObj", // chp.fObj;1 or 0;bit;
- 0xCA57, (FnOut)0,"sprmCPropRMark", // chp.fPropRMark, chp.ibstPropRMark, chp.dttmPropRMark;Complex (see below);variable length always recorded as 7 bytes;
- 0x0858, OutBool, "sprmCFEmboss", // chp.fEmboss;1 or 0;bit;
- 0x2859, OutByte, "sprmCSfxText", // chp.sfxtText;text animation;byte;
-//0x085A, ? ? ? , "sprmCFBiDi", // ;;;
-//0x085B, ? ? ? , "sprmCFDiacColor", // ;;;
-//0x085C, ? ? ? , "sprmCFBoldBi", // ;;;
-//0x085D, ? ? ? , "sprmCFItalicBi", // ;;;
- 0x4A5E, OutWord, "sprmCFtcBi", // ;;;
- 0x485F, OutWord, "sprmCLidBi", // ;;;
-//0x4A60, ? ? ? , "sprmCIcoBi", // ;;;
- 0x4A61, OutWord, "sprmCHpsBi", // ;;;
- 0xCA62, (FnOut)0,"sprmCDispFldRMark", // chp.fDispFldRMark, chp.ibstDispFldRMark, chp.dttmDispFldRMark ;Complex (see below);variable length always recorded as 39 bytes;
- 0x4863, OutShort,"sprmCIbstRMarkDel", // chp.ibstRMarkDel;index into sttbRMark;short;
- 0x6864,OutLongHex,"sprmCDttmRMarkDel", // chp.dttmRMarkDel;DTTM;long;
- 0x6865,OutLongHex,"sprmCBrc", // chp.brc;BRC;long;
- 0x4866, OutShort,"sprmCShd", // chp.shd;SHD;short;
- 0x4867, OutShort,"sprmCIdslRMarkDel", // chp.idslRMReasonDel;an index to a table of strings defined in Word 6.0 executables;short;
- 0x0868, OutBool, "sprmCFUsePgsuSettings", // chp.fUsePgsuSettings;1 or 0;bit;
- 0x486B, OutWord, "sprmCCpg", // ;;word;
- 0x486D, OutWord, "sprmCRgLid0", // chp.rglid[0];LID: for non-Far East text;word;
- 0x486E, OutWord, "sprmCRgLid1", // chp.rglid[1];LID: for Far East text;word;
- 0x286F, OutByte, "sprmCIdctHint", // chp.idctHint;IDCT: (see below);byte;
- 0x2E00, OutByte, "sprmPicBrcl", // pic.brcl;brcl (see PIC structure definition);byte;
- 0xCE01, (FnOut)0,"sprmPicScale", // pic.mx, pic.my, pic.dxaCropleft, pic.dyaCropTop pic.dxaCropRight, pic.dyaCropBottom;Complex (see below);length byte plus 12 bytes;
- 0x6C02,OutLongHex,"sprmPicBrcTop", // pic.brcTop;BRC;long;
- 0x6C03,OutLongHex,"sprmPicBrcLeft", // pic.brcLeft;BRC;long;
- 0x6C04,OutLongHex,"sprmPicBrcBottom", // pic.brcBottom;BRC;long;
- 0x6C05,OutLongHex,"sprmPicBrcRight", // pic.brcRight;BRC;long;
- 0x3000, OutByte, "sprmScnsPgn", // sep.cnsPgn;cns;byte;
- 0x3001, OutByte, "sprmSiHeadingPgn", // sep.iHeadingPgn;heading number level;byte;
- 0xD202, (FnOut)0,"sprmSOlstAnm", // sep.olstAnm;OLST;variable length;
- 0xF203, (FnOut)0,"sprmSDxaColWidth", // sep.rgdxaColWidthSpacing;complex (see below);3 bytes;
- 0xF204, (FnOut)0,"sprmSDxaColSpacing", // sep.rgdxaColWidthSpacing;complex (see below);3 bytes;
- 0x3005, OutByte, "sprmSFEvenlySpaced", // sep.fEvenlySpaced;1 or 0;byte;
- 0x3006, OutByte, "sprmSFProtected", // sep.fUnlocked;1 or 0;byte;
- 0x5007, OutWord, "sprmSDmBinFirst", // sep.dmBinFirst;;word;
- 0x5008, OutWord, "sprmSDmBinOther", // sep.dmBinOther;;word;
- 0x3009, OutByte, "sprmSBkc", // sep.bkc;bkc;byte;
- 0x300A, OutByte, "sprmSFTitlePage", // sep.fTitlePage;0 or 1;byte;
- 0x500B, OutWord, "sprmSCcolumns", // sep.ccolM1;# of cols - 1;word;
- 0x900C, OutWord, "sprmSDxaColumns", // sep.dxaColumns;dxa;word;
- 0x300D, OutByte, "sprmSFAutoPgn", // sep.fAutoPgn;obsolete;byte;
- 0x300E, OutByte, "sprmSNfcPgn", // sep.nfcPgn;nfc;byte;
- 0xB00F, OutShort,"sprmSDyaPgn", // sep.dyaPgn;dya;short;
- 0xB010, OutShort,"sprmSDxaPgn", // sep.dxaPgn;dya;short;
- 0x3011, OutByte, "sprmSFPgnRestart", // sep.fPgnRestart;0 or 1;byte;
- 0x3012, OutByte, "sprmSFEndnote", // sep.fEndnote;0 or 1;byte;
- 0x3013, OutByte, "sprmSLnc", // sep.lnc;lnc;byte;
- 0x3014, OutByte, "sprmSGprfIhdt", // sep.grpfIhdt;grpfihdt (see Headers and Footers topic);byte;
- 0x5015, OutWord, "sprmSNLnnMod", // sep.nLnnMod;non-neg int.;word;
- 0x9016, OutWord, "sprmSDxaLnn", // sep.dxaLnn;dxa;word;
- 0xB017, OutWord, "sprmSDyaHdrTop", // sep.dyaHdrTop;dya;word;
- 0xB018, OutWord, "sprmSDyaHdrBottom", // sep.dyaHdrBottom;dya;word;
- 0x3019, OutByte, "sprmSLBetween", // sep.fLBetween;0 or 1;byte;
- 0x301A, OutByte, "sprmSVjc", // sep.vjc;vjc;byte;
- 0x501B, OutWord, "sprmSLnnMin", // sep.lnnMin;lnn;word;
- 0x501C, OutWord, "sprmSPgnStart", // sep.pgnStart;pgn;word;
- 0x301D, OutByte, "sprmSBOrientation", // sep.dmOrientPage;dm;byte;
-//0x301E, ? ? ? , "sprmSBCustomize", // ;;;
- 0xB01F, OutWord, "sprmSXaPage", // sep.xaPage;xa;word;
- 0xB020, OutWord, "sprmSYaPage", // sep.yaPage;ya;word;
- 0xB021, OutWord, "sprmSDxaLeft", // sep.dxaLeft;dxa;word;
- 0xB022, OutWord, "sprmSDxaRight", // sep.dxaRight;dxa;word;
- 0x9023, OutWord, "sprmSDyaTop", // sep.dyaTop;dya;word;
- 0x9024, OutWord, "sprmSDyaBottom", // sep.dyaBottom;dya;word;
- 0xB025, OutWord, "sprmSDzaGutter", // sep.dzaGutter;dza;word;
- 0x5026, OutWord, "sprmSDmPaperReq", // sep.dmPaperReq;dm;word;
- 0xD227, (FnOut)0,"sprmSPropRMark", // sep.fPropRMark, sep.ibstPropRMark, sep.dttmPropRMark ;complex (see below);variable length always recorded as 7 bytes;
-//0x3228, ? ? ? , "sprmSFBiDi", // ;;;
-//0x3229, ? ? ? , "sprmSFFacingCol", // ;;;
-//0x322A, ? ? ? , "sprmSFRTLGutter", // ;;;
- 0x702B,OutLongHex,"sprmSBrcTop", // sep.brcTop;BRC;long;
- 0x702C,OutLongHex,"sprmSBrcLeft", // sep.brcLeft;BRC;long;
- 0x702D,OutLongHex,"sprmSBrcBottom", // sep.brcBottom;BRC;long;
- 0x702E,OutLongHex,"sprmSBrcRight", // sep.brcRight;BRC;long;
- 0x522F, OutWord, "sprmSPgbProp", // sep.pgbProp;;word;
- 0x7030,OutLongHex,"sprmSDxtCharSpace", // sep.dxtCharSpace;dxt;long;
- 0x9031,OutLongHex,"sprmSDyaLinePitch", // sep.dyaLinePitch;dya;long;
-//0x5032, ? ? ? , "sprmSClm", // ;;;
- 0x5033, OutShort,"sprmSTextFlow", // sep.wTextFlow;complex (see below);short;
- 0x5400, OutWord, "sprmTJc", // tap.jc;jc;word (low order byte is significant);
- 0x9601, OutWord, "sprmTDxaLeft", // tap.rgdxaCenter (see below);dxa;word;
- 0x9602, OutWord, "sprmTDxaGapHalf", // tap.dxaGapHalf, tap.rgdxaCenter (see below);dxa;word;
- 0x3403, OutByte, "sprmTFCantSplit", // tap.fCantSplit;1 or 0;byte;
- 0x3404, OutByte, "sprmTTableHeader", // tap.fTableHeader;1 or 0;byte;
- 0xD605, (FnOut)0,"sprmTTableBorders", // tap.rgbrcTable;complex(see below);24 bytes;
- 0xD606, (FnOut)0,"sprmTDefTable10", // tap.rgdxaCenter, tap.rgtc;complex (see below);variable length;
- 0x9407, OutShort, "sprmTDyaRowHeight", // tap.dyaRowHeight;dya;word;
- 0xD608, OutTabD608,"sprmTDefTable", // tap.rgtc;complex (see below);;
- 0xD609, OutTabD609,"sprmTDefTableShd", // tap.rgshd;complex (see below);;
- 0x740A, (FnOut)0,"sprmTTlp", // tap.tlp;TLP;4 bytes;
-//0x560B, ? ? ? , "sprmTFBiDi", // ;;;
-//0x740C, ? ? ? , "sprmTHTMLProps", // ;;;
- 0xD620, (FnOut)0,"sprmTSetBrc", // tap.rgtc[].rgbrc;complex (see below);5 bytes;
- 0x7621, (FnOut)0,"sprmTInsert", // tap.rgdxaCenter, tap.rgtc;complex (see below);4 bytes;
- 0x5622, OutWord, "sprmTDelete", // tap.rgdxaCenter, tap.rgtc;complex (see below);word;
- 0x7623, (FnOut)0,"sprmTDxaCol", // tap.rgdxaCenter;complex (see below);4 bytes;
- 0x5624, OutWord, "sprmTMerge", // tap.fFirstMerged, tap.fMerged;complex (see below);word;
- 0x5625, OutWord, "sprmTSplit", // tap.fFirstMerged, tap.fMerged;complex (see below);word;
- 0xD626, (FnOut)0,"sprmTSetBrc10", // tap.rgtc[].rgbrc;complex (see below);5 bytes;
- 0x7627, (FnOut)0,"sprmTSetShd", // tap.rgshd;complex (see below);4 bytes;
- 0x7628, (FnOut)0,"sprmTSetShdOdd", // tap.rgshd;complex (see below);4 bytes;
- 0x7629, OutWord, "sprmTTextFlow", // tap.rgtc[].fVerticaltap.rgtc[].fBackwardtap.rgtc[].fRotateFont;0 or 10 or 10 or 1;word;
-//0xD62A, ? ? ? , "sprmTDiagLine", // ;;;
- 0xD62B, (FnOut)0,"sprmTVertMerge", // tap.rgtc[].vertMerge;complex (see below);variable length always recorded as 2 bytes;
- 0xD62C, (FnOut)0,"sprmTVertAlign", // tap.rgtc[].vertAlign;complex (see below);variable length always recorded as 3 byte;
-
- 0x4873, OutWord, "sprm?? CJK ??", // CJK-Unknown
- 0x4874, OutWord, "sprm?? CJK ??", // CJK-Unknown
-
-};
-
-
-static int
-#if defined( WNT )
- __cdecl
-#endif
-#if defined( ICC )
- _Optlink
-#endif
- CompSprmDumpId( const void *pFirst, const void *pSecond)
-{
- return( ((SprmDumpInfo*)pFirst )->nId - ((SprmDumpInfo*)pSecond)->nId );
-}
-
-
-SprmDumpInfo& WW8GetSprmDumpInfo( sal_uInt16 nId )
-{
- // ggfs. Tab sortieren
- static sal_Bool bInit = sal_False;
- if( !bInit )
- {
- qsort( (void*)aSprmDumpTab,
- sizeof( aSprmDumpTab ) / sizeof (aSprmDumpTab[ 0 ]),
- sizeof( aSprmDumpTab[ 0 ] ),
- CompSprmDumpId );
- bInit = sal_True;
- }
- // Sprm heraussuchen
- void* pFound;
- SprmDumpInfo aSrch;
- aSrch.nId = nId;
- if( 0 == ( pFound = bsearch( (char *) &aSrch,
- (void*) aSprmDumpTab,
- sizeof( aSprmDumpTab ) / sizeof (aSprmDumpTab[ 0 ]),
- sizeof( aSprmDumpTab[ 0 ] ),
- CompSprmDumpId )))
- {
- // im Fehlerfall auf Nulltes Element verweisen
- pFound = (void*)aSprmDumpTab;
- }
- return *(SprmDumpInfo*) pFound;
-}
-
-
-
-
diff --git a/sw/source/filter/ww8/dump/ww8darr.hxx b/sw/source/filter/ww8/dump/ww8darr.hxx
deleted file mode 100644
index ee63df9cf99c..000000000000
--- a/sw/source/filter/ww8/dump/ww8darr.hxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _WW8DARR_HXX
-#define _WW8DARR_HXX
-
-typedef void (*FnOut)( SvStream& rSt, short );
-
-struct SprmDumpInfo
-{
- sal_uInt16 nId;
- FnOut pOutFnc;
- char* pName;
-};
-
-SprmDumpInfo& WW8GetSprmDumpInfo( sal_uInt16 nId );
-
-
-#endif
diff --git a/sw/source/filter/ww8/dump/ww8dout.cxx b/sw/source/filter/ww8/dump/ww8dout.cxx
deleted file mode 100644
index 5b4c2aa0f50a..000000000000
--- a/sw/source/filter/ww8/dump/ww8dout.cxx
+++ /dev/null
@@ -1,419 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-
-#include <stdio.h> // getchar
-
-//#include "defs.hxx"
-#include <tools/solar.h> // sal_uInt8
-//#include "wwscan.hxx" // aWwStor
-#include "ww8dout.hxx"
-#include <tools/stream.hxx>
-
-#include <sot/storage.hxx>
-
-extern SvStorageStreamRef xStrm;
-extern SvStorageStreamRef xTableStream;
-extern SvStorageStreamRef xDataStream; // ist bei Ver6-7 mit xStrm identisch,
-void DumpSprms( sal_uInt8 nVersion, SvStream& rSt, short nLen );
-
-ostream* pOut = 0;
-
-#define DumpVer8
-
-//-----------------------------------------
-// Streams
-//-----------------------------------------
-
-
-static int level = 0;
-static long lastpos = -1;
-
-ostream& __cdecl endl1( ostream& s ){
-//ostream& endl1( ostream& s ) {
- s << endl;
- return s;
-}
-
-ostream& __cdecl hex2( ostream& s ) {
- s.width( 2 ); s.fill( (const char)250 );
- s << hex;
- return s;
-}
-
-ostream& __cdecl hex4( ostream& s ) {
- s.width( 4 ); s.fill( (const char)250 );
- s << hex ;
- return s;
-}
-
-ostream& __cdecl hex6( ostream& s ) {
- s.width( 6 ); s.fill( (const char)250 );
- s << hex ;
- return s;
-}
-
-ostream& __cdecl hex8( ostream& s ) {
- s.width( 8 ); s.fill( (const char)250 );
- s << hex ;
- return s;
-}
-
-ostream& __cdecl dec2( ostream& s ) {
- s << dec;
- s.width( 0 ); s.fill( 0 );
- return s;
-}
-
-ostream& __cdecl filepos( ostream& s, SvStream& rSt ) {
- long pos = rSt.Tell();
-
- if ( pos != lastpos ){
-#ifndef DumpVer8
- if( &rSt == &xStrm )
- s << "D";
- else
- s << "T";
-#endif
- s.width( 6 );
- s.fill( (const char)250 );
- s << hex << pos << dec << ' ';
- s.width( 0 ); s.fill( 0 );
- lastpos = pos;
- }else{
-#ifndef DumpVer8
- s << " ";
-#else
- s << " ";
-#endif
- }
- return s;
-}
-
-ostream& __cdecl indent( ostream& s, SvStream& rSt ) {
- filepos( s, rSt );
- for( int i = 0; i < level; i++ ) s << " ";
- return s;
-}
-
-ostream& __cdecl indent1( ostream& s ) {
- for( int i = 0; i < level; i++ ) s << " ";
- return s;
-}
-
-ostream& __cdecl indent2( ostream& s ) {
-#ifndef DumpVer8
- s << " " << indent1;
-#else
- s << " " << indent1;
-#endif
- return s;
-}
-
-ostream& __cdecl begin( ostream& s, SvStream& rSt ) { indent( s, rSt ) << "BEGIN "; level++; return s; }
-
-// begin1 ohne indent
-ostream& __cdecl begin1( ostream& s ) { s << "BEGIN "; level++; return s; }
-
-// begin2 ohne Nummer
-ostream& __cdecl begin2( ostream& s ) { s << indent2 << "BEGIN "; level++; return s; }
-
-ostream& __cdecl end( ostream& s, SvStream& rSt ) { level--; return indent( s, rSt ) << "END "; }
-
-// end1 ohne filepos
-ostream& __cdecl end1( ostream& s ) { level--; return s << indent1 << "END "; }
-
-// end2 ohne Nummer
-ostream& __cdecl end2( ostream& s ) { level--; return s << indent2 << "END "; }
-
-//-----------------------------------------
-// Ausgabe-Funktionen
-//-----------------------------------------
-
-void OutBool( SvStream& rSt, short )
-{
- sal_uInt8 nPara;
-
- rSt.Read( &nPara, sizeof( nPara ) );
- switch( nPara ){
- case 0: *pOut << "F"; break;
- case 1: *pOut << "T"; break;
- default: *pOut << "ERROR:" << (sal_uInt16)nPara; break;
- }
-}
-
-void OutBool4( SvStream& rSt, short )
-{
- sal_uInt8 nPara;
-
- rSt.Read( &nPara, sizeof( nPara ) );
- switch( nPara ){
- case 0: *pOut << "F"; break;
- case 1: *pOut << "T"; break;
- case 128: *pOut << "==Style"; break;
- case 129: *pOut << "!=Style"; break;
- default: *pOut << "ERROR:" << (sal_uInt16)nPara; break;
- }
-}
-
-void OutByte( SvStream& rSt, short )
-{
- sal_uInt8 nPara;
-
- rSt.Read( &nPara, sizeof( nPara ) );
- *pOut << (sal_uInt16)nPara;
-}
-
-void OutShort( SvStream& rSt, short )
-{
- short nPara;
-
- rSt.Read( &nPara, sizeof( nPara ) );
- *pOut << nPara;
-}
-
-void OutShorts( SvStream& rSt, short nLen )
-{
- sal_Int16 nPara;
-
- for( short i = 0; i < nLen / 2; i++ ){
- rSt.Read( &nPara, sizeof( nPara ) );
- *pOut << nPara << ' ';
- }
-}
-
-void OutWord( SvStream& rSt, short )
-{
- sal_uInt16 nPara;
-
- rSt.Read( &nPara, sizeof( nPara ) );
- *pOut << nPara;
-}
-
-void OutWords( SvStream& rSt, short nLen )
-{
- sal_uInt16 nPara;
-
- for( short i = 0; i < nLen / 2; i++ ){
- rSt.Read( &nPara, sizeof( nPara ) );
- *pOut << nPara;
- }
-}
-
-void OutWordHex( SvStream& rSt, short )
-{
- sal_uInt16 nPara;
-
- rSt.Read( &nPara, sizeof( nPara ) );
- *pOut << "0x" << hex4 << nPara << dec;
-}
-
-void OutWordsHex( SvStream& rSt, short nLen )
-{
- sal_uInt16 nPara;
- nLen /= sizeof( nPara );
- for( short i = 0; i < nLen; i++ ){
- rSt.Read( &nPara, sizeof( nPara ) );
- *pOut << "0x" << hex4 << nPara << dec;
- if( i < nLen - 1 )
- *pOut << ' ';
- }
-}
-
-void OutLongsHex( SvStream& rSt, short nLen )
-{
- long nPara;
- nLen /= sizeof( nPara );
- for( short i = 0; i < nLen; i++ )
- {
- rSt.Read( &nPara, sizeof( nPara ) );
- *pOut << "0x" << hex8 << nPara << dec;
- if( i < nLen - 1 )
- *pOut << ' ';
- }
-}
-
-void OutLongHex( SvStream& rSt, short )
-{
- sal_uLong nPara;
-
- rSt.Read( &nPara, sizeof( nPara ) );
- *pOut << "0x" << hex8 << nPara << dec;
-}
-
-void OutTab68( SvStream& rSt, short )
-{
- sal_uLong nPara;
-
- rSt.Read( &nPara, sizeof( nPara ) );
- if( nPara == 0 )
- *pOut << "None";
- else
- *pOut << "0x" << hex8 << nPara << dec;
-}
-
-
-void OutTab( SvStream& rSt, short )
-{
- sal_uInt8 nDel, nIns, nType;
- short nPos, i;
-
- rSt.Read( &nDel, sizeof( nDel ) );
- *pOut << "Del " << (sal_uInt16)nDel;
- if ( nDel ) *pOut << ": ";
- else *pOut << ", ";
-
- for( i=1; i<=nDel; i++){
- rSt.Read( &nPos, sizeof( nPos ) );
- *pOut << nPos;
- if( i<nDel ) *pOut << ',';
- else *pOut << ' ';
- }
- rSt.Read( &nIns, sizeof( nIns ) );
- *pOut << "Ins " << (sal_uInt16)nIns;
- if ( nIns ) *pOut << ": ";
-
- for( i=1; i<=nIns; i++){
- rSt.Read( &nPos, sizeof( nPos ) );
- *pOut << nPos;
- if( i<nIns ) *pOut << ',';
- else *pOut << ' ';
- }
- if ( nIns ) *pOut << "Typ: ";
-
- for( i=1; i<=nIns; i++){
- rSt.Read( &nType, sizeof( nType ) );
- *pOut << (sal_uInt16)nType;
- if( i<nIns ) *pOut << ',';
- else *pOut << ' ';
- }
-
-// nSiz = 1 + 2 * nDel + 1 + nIns * 3; // genaue Laenge,
-// stimmt auch bei Laenge > 256
-// bei diesem Tab-Befehl anscheinend nicht noetig
-}
-
-void OutTab190( SvStream& rSt, short nLen )
-{
- sal_uInt8 nCols;
- rSt.Read( &nCols, sizeof( nCols ) );
- *pOut << (sal_uInt16)nCols << " Cols: ";
-
- short nPos, i;
- for( i = 0; i <= nCols; i++ ){
- rSt.Read( &nPos, sizeof( nPos ) );
- *pOut << nPos;
- if( i < nCols )
- *pOut << ", ";
- }
- *pOut << dec << "; ";
- for( i = 0; i < nCols; i++ ){
- *pOut << "Col " << i << " TC: ";
- OutWordsHex( rSt, 10 );
- if( i < nCols - 1 )
- *pOut << "; ";
- }
-}
-
-void OutTab191( SvStream& rSt, short nLen )
-{
- sal_uInt8 nCols;
- rSt.Read( &nCols, sizeof( nCols ) );
- *pOut << (sal_uInt16)nCols << " Cols, SHDs: ";
- OutWordsHex( rSt, ( nCols + 1 ) * 2 );
-}
-
-void OutTab192( SvStream& rSt, short )
-{
- OutWord( rSt, 0 );
- OutWordHex( rSt, 0 );
-}
-
-void OutHugeHex( SvStream& rSt, short nLen )
-{
- long nPos;
- rSt.Read( &nPos, sizeof( nPos ) );
-
- long nCurr = xDataStream->Tell();
- xDataStream->Seek( nPos );
-
- xDataStream->Read( &nLen, sizeof( nLen ) );
-
-// *pOut << ", Len max: " << nLen << ", ID:" << nIStd << endl1;
- *pOut << endl1;
- DumpSprms( 8, *xDataStream, nLen );
-
- xDataStream->Seek( nCurr );
-}
-
-void OutTabD608( SvStream& rSt, short nLen )
-{
- sal_uInt8 nHi, nCols;
- rSt.Read( &nHi, sizeof( nHi ) );
-// nLen += ((short)nHi) << 8;
-
- rSt.Read( &nCols, sizeof( nCols ) );
- *pOut << " Cols: " << (short)nCols << ' ' << endl1 << indent2;
-
- short nPos, i;
- for( i = 0; i <= nCols; ++i )
- {
- rSt.Read( &nPos, sizeof( nPos ) );
- *pOut << nPos;
- if( i < nCols )
- *pOut << ", ";
- }
- nLen -= ( nCols + 1 ) * 2;
- nLen /= 20;
-
- for( i = 0; i < nLen; ++i )
- {
- *pOut << endl1 << indent2 << "Col " << i << " TC: ";
- OutLongsHex( rSt, 20 );
- if( i < nLen - 1 )
- *pOut << "; ";
- }
-}
-
-void OutTabD609( SvStream& rSt, short nLen )
-{
- *pOut << " Brush(FBS): ";
- for( short i = 0; i < nLen / 2; ++i )
- {
- sal_uInt16 nVal;
- rSt.Read( &nVal, sizeof( nVal ) );
- *pOut << (nVal & 0x1f);
- *pOut << "|" << ((nVal >> 5) & 0x1f);
- *pOut << "|" << ((nVal >> 10) & 0x3f);
- if( i < nLen )
- *pOut << ", ";
- }
-}
-
-
diff --git a/sw/source/filter/ww8/dump/ww8dout.hxx b/sw/source/filter/ww8/dump/ww8dout.hxx
deleted file mode 100644
index ac301c0e62bf..000000000000
--- a/sw/source/filter/ww8/dump/ww8dout.hxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _WW8DOUT_HXX
-#define _WW8DOUT_HXX
-
-#ifndef INC_FSTREAM
- #include <fstream.h> // ostream
-#endif
-#ifndef SOLAR_H
- #include <tools/solar.h> // sal_uInt8
-#endif
-
-class SvStream;
-
-void OutByte( SvStream& rSt, short nLen );
-void OutBool( SvStream& rSt, short nLen );
-void OutShort( SvStream& rSt, short );
-void OutShorts( SvStream& rSt, short nLen );
-void OutWord( SvStream& rSt, short );
-void OutWords( SvStream& rSt, short nLen );
-void OutWordHex( SvStream& rSt, short );
-void OutWordsHex( SvStream& rSt, short );
-void OutLongHex( SvStream& rSt, short );
-void OutLongsHex( SvStream& rSt, short nLen );
-void OutTab( SvStream& rSt, short nLen );
-void OutTab68( SvStream& rSt, short nLen );
-void OutTab190( SvStream& rSt, short nLen );
-void OutTab191( SvStream& rSt, short nLen );
-void OutTab192( SvStream& rSt, short nLen );
-void OutBool4( SvStream& rSt, short nLen );
-void OutHugeHex( SvStream& rSt, short nLen );
-void OutTabD608( SvStream& rSt, short nLen );
-void OutTabD609( SvStream& rSt, short nLen );
-
-
-// unter WNTMSCI4 muss das __cdecl sein, damit nicht nur der Fkt-Pointer
-// ausgegeben wird....
-
-ostream& __cdecl filepos( ostream& s, SvStream& rSt );
-
-ostream& __cdecl endl1( ostream& s );
-ostream& __cdecl indent( ostream& s, SvStream& rSt );
-ostream& __cdecl indent1( ostream& s );
-ostream& __cdecl indent2( ostream& s );
-ostream& __cdecl hex2( ostream& s );
-ostream& __cdecl hex4( ostream& s );
-ostream& __cdecl hex6( ostream& s );
-ostream& __cdecl hex8( ostream& s );
-ostream& __cdecl dec2( ostream& s );
-
-ostream& __cdecl begin( ostream& s, SvStream& rSt );
-ostream& __cdecl begin1( ostream& s );
-ostream& __cdecl begin2( ostream& s );
-ostream& __cdecl end( ostream& s, SvStream& rSt );
-ostream& __cdecl end1( ostream& s );
-ostream& __cdecl end2( ostream& s );
-
-extern ostream* pOut;
-
-
-#endif
diff --git a/sw/source/filter/ww8/dump/ww8scan.cxx b/sw/source/filter/ww8/dump/ww8scan.cxx
deleted file mode 100644
index b099ea590022..000000000000
--- a/sw/source/filter/ww8/dump/ww8scan.cxx
+++ /dev/null
@@ -1,6667 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-
-
-#include <algorithm>
-#include <functional>
-
-#include <string.h> // memset()
-#include <osl/endian.h>
-#include <rtl/tencinfo.h>
-
-#ifdef DUMP
-
-#define ERR_SWG_READ_ERROR 1234
-#define ASSERT( a, b )
-
-#else // dump
-#include <swerror.h> // ERR_WW6_...
-#include <errhdl.hxx> // ASSERT()
-#include <swtypes.hxx> // DELETEZ
-
-#endif // dump
-#include <tools/debug.hxx>
-#include "ww8scan.hxx"
-
-#define ASSERT_RET_ON_FAIL( aCon, aError, aRet ) \
- ASSERT(aCon, aError); \
- if (!(aCon)) \
- return aRet;
-
-//-begin
-namespace SL
-{
-# define IMPLCONSTSTRINGARRAY(X) const char a##X[] = "" #X ""
- IMPLCONSTSTRINGARRAY(ObjectPool);
- IMPLCONSTSTRINGARRAY(1Table);
- IMPLCONSTSTRINGARRAY(0Table);
- IMPLCONSTSTRINGARRAY(Data);
- IMPLCONSTSTRINGARRAY(CheckBox);
- IMPLCONSTSTRINGARRAY(TextBox);
- IMPLCONSTSTRINGARRAY(TextField);
- IMPLCONSTSTRINGARRAY(MSMacroCmds);
-}
-
-template<class C> bool wwString<C>::TestBeltAndBraces(const SvStream& rStrm)
-{
- bool bRet = false;
- sal_uInt32 nOldPos = rStrm.Tell();
- SvStream &rMutableStrm = const_cast<SvStream &>(rStrm);
- sal_uInt32 nLen = rMutableStrm.Seek(STREAM_SEEK_TO_END);
- rMutableStrm.Seek(nOldPos);
- C nBelt;
- rMutableStrm >> nBelt;
- nBelt *= sizeof(C);
- if (nOldPos + sizeof(C) + nBelt + sizeof(C) <= nLen &&
- !rStrm.GetError() && !rStrm.IsEof())
- {
- rMutableStrm.SeekRel(nBelt);
- if (!rStrm.GetError())
- {
- C cBraces;
- rMutableStrm >> cBraces;
- if (!rMutableStrm.GetError() && cBraces == 0)
- bRet = true;
- }
- }
- rMutableStrm.Seek(nOldPos);
- return bRet;
-}
-
-template<class C> class wwSortedArray
-{
-private:
- //The array e.g. of sprms.
- C *mpWwSprmTab;
- size_t mnNoElems;
-public:
- wwSortedArray(C *pWwSprmTab, size_t nNoElems)
- : mpWwSprmTab(pWwSprmTab), mnNoElems(nNoElems)
- {
- ASSERT(mnNoElems && pWwSprmTab, "WW8: empty Array: Don't do that");
- std::sort(mpWwSprmTab, mpWwSprmTab + mnNoElems);
-#ifdef DEBUG
- bool bBroken=false;
- rtl::OUString sError;
- const C *pIter = mpWwSprmTab;
- const C *pBeforeEnd = mpWwSprmTab + mnNoElems - 1;
- while (pIter < pBeforeEnd)
- {
- if (*pIter == *(pIter+1))
- {
- if (!bBroken)
- {
- sError = rtl::OUString::createFromAscii(
- "WW8: Duplicate in list, almost certainly don't want that!\n"
- "(You will not see this message again unless you restart)\n"
- "Extra entries are...\n");
- bBroken=true;
- }
-
- size_t nSize = sizeof(C);
- const sal_uInt8 *pHack =
- reinterpret_cast<const sal_uInt8 *>(&(*pIter));
- for (size_t i=0; i < nSize; ++i)
- {
- sError += rtl::OUString::valueOf(
- static_cast<sal_Int32>(pHack[i]), 16);
- sError += rtl::OUString::valueOf(sal_Unicode(' '));
- }
- sError += rtl::OUString::valueOf(sal_Unicode('\n'));
- while (*pIter == *(pIter+1) && pIter < pBeforeEnd)
- ++pIter;
- }
- else
- ++pIter;
- }
- if (bBroken)
- DbgError(rtl::OUStringToOString(sError, RTL_TEXTENCODING_ASCII_US));
-#endif
- }
-
- //Find an entry, return its address if found and 0 if not
- const C *search(C aSrch) const;
-};
-
-template<class C> const C *wwSortedArray<C>::search(C aSrch) const
-{
- std::pair<C *, C *> aPair =
- std::equal_range(mpWwSprmTab, mpWwSprmTab + mnNoElems, aSrch);
- if (aPair.first != aPair.second)
- return aPair.first;
- else
- return 0;
-}
-
-bool operator==(const SprmInfo &rFirst, const SprmInfo &rSecond)
-{
- return (rFirst.nId == rSecond.nId);
-}
-
-bool operator<(const SprmInfo &rFirst, const SprmInfo &rSecond)
-{
- return (rFirst.nId < rSecond.nId);
-}
-
-const wwSprmSearcher *wwSprmParser::GetWW6SprmSearcher()
-{
- //double lock me
- // WW7- Sprms
- static SprmInfo aSprms[] =
- {
- { 0, 0, L_FIX}, // "Default-sprm", wird uebersprungen
- { 2, 2, L_FIX}, // "sprmPIstd", pap.istd (style code)
- { 3, 3, L_VAR}, // "sprmPIstdPermute pap.istd permutation
- { 4, 1, L_FIX}, // "sprmPIncLv1" pap.istddifference
- { 5, 1, L_FIX}, // "sprmPJc" pap.jc (justification)
- { 6, 1, L_FIX}, // "sprmPFSideBySide" pap.fSideBySide
- { 7, 1, L_FIX}, // "sprmPFKeep" pap.fKeep
- { 8, 1, L_FIX}, // "sprmPFKeepFollow " pap.fKeepFollow
- { 9, 1, L_FIX}, // "sprmPPageBreakBefore" pap.fPageBreakBefore
- { 10, 1, L_FIX}, // "sprmPBrcl" pap.brcl
- { 11, 1, L_FIX}, // "sprmPBrcp" pap.brcp
- { 12, 0, L_VAR}, // "sprmPAnld" pap.anld (ANLD structure)
- { 13, 1, L_FIX}, // "sprmPNLvlAnm" pap.nLvlAnm nn
- { 14, 1, L_FIX}, // "sprmPFNoLineNumb" pap.fNoLnn
- { 15, 0, L_VAR}, // "?sprmPChgTabsPapx" pap.itbdMac, ...
- { 16, 2, L_FIX}, // "sprmPDxaRight" pap.dxaRight
- { 17, 2, L_FIX}, // "sprmPDxaLeft" pap.dxaLeft
- { 18, 2, L_FIX}, // "sprmPNest" pap.dxaLeft
- { 19, 2, L_FIX}, // "sprmPDxaLeft1" pap.dxaLeft1
- { 20, 4, L_FIX}, // "sprmPDyaLine" pap.lspd an LSPD
- { 21, 2, L_FIX}, // "sprmPDyaBefore" pap.dyaBefore
- { 22, 2, L_FIX}, // "sprmPDyaAfter" pap.dyaAfter
- { 23, 0, L_VAR}, // "?sprmPChgTabs" pap.itbdMac, pap.rgdxaTab, ...
- { 24, 1, L_FIX}, // "sprmPFInTable" pap.fInTable
- { 25, 1, L_FIX}, // "sprmPTtp" pap.fTtp
- { 26, 2, L_FIX}, // "sprmPDxaAbs" pap.dxaAbs
- { 27, 2, L_FIX}, // "sprmPDyaAbs" pap.dyaAbs
- { 28, 2, L_FIX}, // "sprmPDxaWidth" pap.dxaWidth
- { 29, 1, L_FIX}, // "sprmPPc" pap.pcHorz, pap.pcVert
- { 30, 2, L_FIX}, // "sprmPBrcTop10" pap.brcTop BRC10
- { 31, 2, L_FIX}, // "sprmPBrcLeft10" pap.brcLeft BRC10
- { 32, 2, L_FIX}, // "sprmPBrcBottom10" pap.brcBottom BRC10
- { 33, 2, L_FIX}, // "sprmPBrcRight10" pap.brcRight BRC10
- { 34, 2, L_FIX}, // "sprmPBrcBetween10" pap.brcBetween BRC10
- { 35, 2, L_FIX}, // "sprmPBrcBar10" pap.brcBar BRC10
- { 36, 2, L_FIX}, // "sprmPFromText10" pap.dxaFromText dxa
- { 37, 1, L_FIX}, // "sprmPWr" pap.wr wr
- { 38, 2, L_FIX}, // "sprmPBrcTop" pap.brcTop BRC
- { 39, 2, L_FIX}, // "sprmPBrcLeft" pap.brcLeft BRC
- { 40, 2, L_FIX}, // "sprmPBrcBottom" pap.brcBottom BRC
- { 41, 2, L_FIX}, // "sprmPBrcRight" pap.brcRight BRC
- { 42, 2, L_FIX}, // "sprmPBrcBetween" pap.brcBetween BRC
- { 43, 2, L_FIX}, // "sprmPBrcBar" pap.brcBar BRC word
- { 44, 1, L_FIX}, // "sprmPFNoAutoHyph" pap.fNoAutoHyph
- { 45, 2, L_FIX}, // "sprmPWHeightAbs" pap.wHeightAbs w
- { 46, 2, L_FIX}, // "sprmPDcs" pap.dcs DCS
- { 47, 2, L_FIX}, // "sprmPShd" pap.shd SHD
- { 48, 2, L_FIX}, // "sprmPDyaFromText" pap.dyaFromText dya
- { 49, 2, L_FIX}, // "sprmPDxaFromText" pap.dxaFromText dxa
- { 50, 1, L_FIX}, // "sprmPFLocked" pap.fLocked 0 or 1 byte
- { 51, 1, L_FIX}, // "sprmPFWidowControl" pap.fWidowControl 0 or 1 byte
- { 52, 0, L_FIX}, // "?sprmPRuler 52"
- { 64, 0, L_VAR}, // rtl property ?
- { 65, 1, L_FIX}, // "sprmCFStrikeRM" chp.fRMarkDel 1 or 0 bit
- { 66, 1, L_FIX}, // "sprmCFRMark" chp.fRMark 1 or 0 bit
- { 67, 1, L_FIX}, // "sprmCFFldVanish" chp.fFldVanish 1 or 0 bit
- { 68, 0, L_VAR}, // "sprmCPicLocation" chp.fcPic and chp.fSpec
- { 69, 2, L_FIX}, // "sprmCIbstRMark" chp.ibstRMark index into sttbRMark
- { 70, 4, L_FIX}, // "sprmCDttmRMark" chp.dttm DTTM long
- { 71, 1, L_FIX}, // "sprmCFData" chp.fData 1 or 0 bit
- { 72, 2, L_FIX}, // "sprmCRMReason" chp.idslRMReason an index to a table
- { 73, 3, L_FIX}, // "sprmCChse" chp.fChsDiff and chp.chse
- { 74, 0, L_VAR}, // "sprmCSymbol" chp.fSpec, chp.chSym and chp.ftcSym
- { 75, 1, L_FIX}, // "sprmCFOle2" chp.fOle2 1 or 0 bit
- { 79, 0, L_VAR}, // unknown
- { 80, 2, L_FIX}, // "sprmCIstd" chp.istd istd, see stylesheet definition
- { 81, 0, L_VAR}, // "sprmCIstdPermute" chp.istd permutation vector
- { 82, 0, L_VAR}, // "sprmCDefault" whole CHP
- { 83, 0, L_FIX}, // "sprmCPlain" whole CHP
- { 85, 1, L_FIX}, // "sprmCFBold" chp.fBold 0,1, 128, or 129
- { 86, 1, L_FIX}, // "sprmCFItalic" chp.fItalic 0,1, 128, or 129
- { 87, 1, L_FIX}, // "sprmCFStrike" chp.fStrike 0,1, 128, or 129
- { 88, 1, L_FIX}, // "sprmCFOutline" chp.fOutline 0,1, 128, or 129
- { 89, 1, L_FIX}, // "sprmCFShadow" chp.fShadow 0,1, 128, or 129
- { 90, 1, L_FIX}, // "sprmCFSmallCaps" chp.fSmallCaps 0,1, 128, or 129
- { 91, 1, L_FIX}, // "sprmCFCaps" chp.fCaps 0,1, 128, or 129
- { 92, 1, L_FIX}, // "sprmCFVanish" chp.fVanish 0,1, 128, or 129
- { 93, 2, L_FIX}, // "sprmCFtc" chp.ftc ftc word
- { 94, 1, L_FIX}, // "sprmCKul" chp.kul kul byte
- { 95, 3, L_FIX}, // "sprmCSizePos" chp.hps, chp.hpsPos
- { 96, 2, L_FIX}, // "sprmCDxaSpace" chp.dxaSpace dxa
- { 97, 2, L_FIX}, // "sprmCLid" chp.lid LID
- { 98, 1, L_FIX}, // "sprmCIco" chp.ico ico byte
- { 99, 2, L_FIX}, // "sprmCHps" chp.hps hps !word!
- {100, 1, L_FIX}, // "sprmCHpsInc" chp.hps
- {101, 2, L_FIX}, // "sprmCHpsPos" chp.hpsPos hps !word!
- {102, 1, L_FIX}, // "sprmCHpsPosAdj" chp.hpsPos hps
- {103, 0, L_VAR}, // "?sprmCMajority" chp.fBold, chp.fItalic, ...
- {104, 1, L_FIX}, // "sprmCIss" chp.iss iss
- {105, 0, L_VAR}, // "sprmCHpsNew50" chp.hps hps variable width
- {106, 0, L_VAR}, // "sprmCHpsInc1" chp.hps complex
- {107, 2, L_FIX}, // "sprmCHpsKern" chp.hpsKern hps
- {108, 0, L_VAR}, // "sprmCMajority50" chp.fBold, chp.fItalic, ...
- {109, 2, L_FIX}, // "sprmCHpsMul" chp.hps percentage to grow hps
- {110, 2, L_FIX}, // "sprmCCondHyhen" chp.ysri ysri
- {111, 2, L_FIX}, // unknown
- {112, 2, L_FIX}, // unknown
- {113, 0, L_VAR}, // rtl property ?
- {115, 0, L_VAR}, // rtl property ?
- {116, 0, L_VAR}, // unknown
- {117, 1, L_FIX}, // "sprmCFSpec" chp.fSpec 1 or 0 bit
- {118, 1, L_FIX}, // "sprmCFObj" chp.fObj 1 or 0 bit
- {119, 1, L_FIX}, // "sprmPicBrcl" pic.brcl brcl (see PIC definition)
- {120,12, L_VAR}, // "sprmPicScale" pic.mx, pic.my, pic.dxaCropleft,
- {121, 2, L_FIX}, // "sprmPicBrcTop" pic.brcTop BRC word
- {122, 2, L_FIX}, // "sprmPicBrcLeft" pic.brcLeft BRC word
- {123, 2, L_FIX}, // "sprmPicBrcBottom" pic.brcBottom BRC word
- {124, 2, L_FIX}, // "sprmPicBrcRight" pic.brcRight BRC word
- {131, 1, L_FIX}, // "sprmSScnsPgn" sep.cnsPgn cns byte
- {132, 1, L_FIX}, // "sprmSiHeadingPgn" sep.iHeadingPgn
- {133, 0, L_VAR}, // "sprmSOlstAnm" sep.olstAnm OLST variable length
- {136, 3, L_FIX}, // "sprmSDxaColWidth" sep.rgdxaColWidthSpacing complex
- {137, 3, L_FIX}, // "sprmSDxaColSpacing" sep.rgdxaColWidthSpacing
- {138, 1, L_FIX}, // "sprmSFEvenlySpaced" sep.fEvenlySpaced 1 or 0
- {139, 1, L_FIX}, // "sprmSFProtected" sep.fUnlocked 1 or 0 byte
- {140, 2, L_FIX}, // "sprmSDmBinFirst" sep.dmBinFirst word
- {141, 2, L_FIX}, // "sprmSDmBinOther" sep.dmBinOther word
- {142, 1, L_FIX}, // "sprmSBkc" sep.bkc bkc byte
- {143, 1, L_FIX}, // "sprmSFTitlePage" sep.fTitlePage 0 or 1 byte
- {144, 2, L_FIX}, // "sprmSCcolumns" sep.ccolM1 # of cols - 1 word
- {145, 2, L_FIX}, // "sprmSDxaColumns" sep.dxaColumns dxa word
- {146, 1, L_FIX}, // "sprmSFAutoPgn" sep.fAutoPgn obsolete byte
- {147, 1, L_FIX}, // "sprmSNfcPgn" sep.nfcPgn nfc byte
- {148, 2, L_FIX}, // "sprmSDyaPgn" sep.dyaPgn dya short
- {149, 2, L_FIX}, // "sprmSDxaPgn" sep.dxaPgn dya short
- {150, 1, L_FIX}, // "sprmSFPgnRestart" sep.fPgnRestart 0 or 1 byte
- {151, 1, L_FIX}, // "sprmSFEndnote" sep.fEndnote 0 or 1 byte
- {152, 1, L_FIX}, // "sprmSLnc" sep.lnc lnc byte
- {153, 1, L_FIX}, // "sprmSGprfIhdt" sep.grpfIhdt grpfihdt
- {154, 2, L_FIX}, // "sprmSNLnnMod" sep.nLnnMod non-neg int. word
- {155, 2, L_FIX}, // "sprmSDxaLnn" sep.dxaLnn dxa word
- {156, 2, L_FIX}, // "sprmSDyaHdrTop" sep.dyaHdrTop dya word
- {157, 2, L_FIX}, // "sprmSDyaHdrBottom" sep.dyaHdrBottom dya word
- {158, 1, L_FIX}, // "sprmSLBetween" sep.fLBetween 0 or 1 byte
- {159, 1, L_FIX}, // "sprmSVjc" sep.vjc vjc byte
- {160, 2, L_FIX}, // "sprmSLnnMin" sep.lnnMin lnn word
- {161, 2, L_FIX}, // "sprmSPgnStart" sep.pgnStart pgn word
- {162, 1, L_FIX}, // "sprmSBOrientation" sep.dmOrientPage dm byte
- {163, 0, L_FIX}, // "?SprmSBCustomize 163"
- {164, 2, L_FIX}, // "sprmSXaPage" sep.xaPage xa word
- {165, 2, L_FIX}, // "sprmSYaPage" sep.yaPage ya word
- {166, 2, L_FIX}, // "sprmSDxaLeft" sep.dxaLeft dxa word
- {167, 2, L_FIX}, // "sprmSDxaRight" sep.dxaRight dxa word
- {168, 2, L_FIX}, // "sprmSDyaTop" sep.dyaTop dya word
- {169, 2, L_FIX}, // "sprmSDyaBottom" sep.dyaBottom dya word
- {170, 2, L_FIX}, // "sprmSDzaGutter" sep.dzaGutter dza word
- {171, 2, L_FIX}, // "sprmSDMPaperReq" sep.dmPaperReq dm word
- {179, 0, L_VAR}, // rtl property ?
- {181, 0, L_VAR}, // rtl property ?
- {182, 2, L_FIX}, // "sprmTJc" tap.jc jc (low order byte is significant)
- {183, 2, L_FIX}, // "sprmTDxaLeft" tap.rgdxaCenter dxa word
- {184, 2, L_FIX}, // "sprmTDxaGapHalf" tap.dxaGapHalf, tap.rgdxaCenter
- {185, 1, L_FIX}, // "sprmTFCantSplit" tap.fCantSplit 1 or 0 byte
- {186, 1, L_FIX}, // "sprmTTableHeader" tap.fTableHeader 1 or 0 byte
- {187,12, L_FIX}, // "sprmTTableBorders" tap.rgbrcTable complex 12 bytes
- {188, 0, L_VAR}, // "sprmTDefTable10" tap.rgdxaCenter, tap.rgtc complex
- {189, 2, L_FIX}, // "sprmTDyaRowHeight" tap.dyaRowHeight dya word
- {190, 0, L_VAR2},// "sprmTDefTable" tap.rgtc complex
- {191, 1, L_VAR}, // "sprmTDefTableShd" tap.rgshd complex
- {192, 4, L_FIX}, // "sprmTTlp" tap.tlp TLP 4 bytes
- {193, 5, L_FIX}, // "sprmTSetBrc" tap.rgtc[].rgbrc complex 5 bytes
- {194, 4, L_FIX}, // "sprmTInsert" tap.rgdxaCenter,tap.rgtc complex
- {195, 2, L_FIX}, // "sprmTDelete" tap.rgdxaCenter, tap.rgtc complex
- {196, 4, L_FIX}, // "sprmTDxaCol" tap.rgdxaCenter complex
- {197, 2, L_FIX}, // "sprmTMerge" tap.fFirstMerged, tap.fMerged complex
- {198, 2, L_FIX}, // "sprmTSplit" tap.fFirstMerged, tap.fMerged complex
- {199, 5, L_FIX}, // "sprmTSetBrc10" tap.rgtc[].rgbrc complex 5 bytes
- {200, 4, L_FIX} // "sprmTSetShd", tap.rgshd complex 4 bytes
- };
-
- static wwSprmSearcher aSprmSrch(aSprms, sizeof(aSprms) / sizeof(aSprms[0]));
- return &aSprmSrch;
-};
-
-const wwSprmSearcher *wwSprmParser::GetWW8SprmSearcher()
-{
- //double lock me
- //WW8+ Sprms
- static SprmInfo aSprms[] =
- {
- { 0, 0, L_FIX}, // "Default-sprm"/ wird uebersprungen
- {0x4600, 2, L_FIX}, // "sprmPIstd" pap.istd;istd (style code);short;
- {0xC601, 0, L_VAR}, // "sprmPIstdPermute" pap.istd;permutation vector
- {0x2602, 1, L_FIX}, // "sprmPIncLvl" pap.istd, pap.lvl;difference
- // between istd of base PAP and istd of PAP to be
- // produced
- {0x2403, 1, L_FIX}, // "sprmPJc" pap.jc;jc (justification);byte;
- {0x2404, 1, L_FIX}, // "sprmPFSideBySide" pap.fSideBySide;0 or 1;byte;
- {0x2405, 1, L_FIX}, // "sprmPFKeep" pap.fKeep;0 or 1;byte;
- {0x2406, 1, L_FIX}, // "sprmPFKeepFollow" pap.fKeepFollow;0 or 1;byte;
- {0x2407, 1, L_FIX}, // "sprmPFPageBreakBefore" pap.fPageBreakBefore;
- // 0 or 1
- {0x2408, 1, L_FIX}, // "sprmPBrcl" pap.brcl;brcl;byte;
- {0x2409, 1, L_FIX}, // "sprmPBrcp" pap.brcp;brcp;byte;
- {0x260A, 1, L_FIX}, // "sprmPIlvl" pap.ilvl;ilvl;byte;
- {0x460B, 2, L_FIX}, // "sprmPIlfo" pap.ilfo;ilfo (list index) ;short;
- {0x240C, 1, L_FIX}, // "sprmPFNoLineNumb" pap.fNoLnn;0 or 1;byte;
- {0xC60D, 0, L_VAR}, // "sprmPChgTabsPapx" pap.itbdMac, pap.rgdxaTab,
- // pap.rgtbd;complex
- {0x840E, 2, L_FIX}, // "sprmPDxaRight" pap.dxaRight;dxa;word;
- {0x840F, 2, L_FIX}, // "sprmPDxaLeft" pap.dxaLeft;dxa;word;
- {0x4610, 2, L_FIX}, // "sprmPNest" pap.dxaLeft;dxa
- {0x8411, 2, L_FIX}, // "sprmPDxaLeft1" pap.dxaLeft1;dxa;word;
- {0x6412, 4, L_FIX}, // "sprmPDyaLine" pap.lspd;an LSPD, a long word
- // structure consisting of a short of dyaLine
- // followed by a short of fMultLinespace
- {0xA413, 2, L_FIX}, // "sprmPDyaBefore" pap.dyaBefore;dya;word;
- {0xA414, 2, L_FIX}, // "sprmPDyaAfter" pap.dyaAfter;dya;word;
- {0xC615, 0, L_VAR}, // "sprmPChgTabs" pap.itbdMac, pap.rgdxaTab,
- // pap.rgtbd;complex
- {0x2416, 1, L_FIX}, // "sprmPFInTable" pap.fInTable;0 or 1;byte;
- {0x2417, 1, L_FIX}, // "sprmPFTtp" pap.fTtp;0 or 1;byte;
- {0x8418, 2, L_FIX}, // "sprmPDxaAbs" pap.dxaAbs;dxa;word;
- {0x8419, 2, L_FIX}, // "sprmPDyaAbs" pap.dyaAbs;dya;word;
- {0x841A, 2, L_FIX}, // "sprmPDxaWidth" pap.dxaWidth;dxa;word;
- {0x261B, 1, L_FIX}, // "sprmPPc" pap.pcHorz, pap.pcVert;complex
- {0x461C, 2, L_FIX}, // "sprmPBrcTop10" pap.brcTop;BRC10;word;
- {0x461D, 2, L_FIX}, // "sprmPBrcLeft10" pap.brcLeft;BRC10;word;
- {0x461E, 2, L_FIX}, // "sprmPBrcBottom10" pap.brcBottom;BRC10;word;
- {0x461F, 2, L_FIX}, // "sprmPBrcRight10" pap.brcRight;BRC10;word;
- {0x4620, 2, L_FIX}, // "sprmPBrcBetween10" pap.brcBetween;BRC10;word;
- {0x4621, 2, L_FIX}, // "sprmPBrcBar10" pap.brcBar;BRC10;word;
- {0x4622, 2, L_FIX}, // "sprmPDxaFromText10" pap.dxaFromText;dxa;word;
- {0x2423, 1, L_FIX}, // "sprmPWr" pap.wr;wr
- {0x6424, 4, L_FIX}, // "sprmPBrcTop" pap.brcTop;BRC;long;
- {0x6425, 4, L_FIX}, // "sprmPBrcLeft" pap.brcLeft;BRC;long;
- {0x6426, 4, L_FIX}, // "sprmPBrcBottom" pap.brcBottom;BRC;long;
- {0x6427, 4, L_FIX}, // "sprmPBrcRight" pap.brcRight;BRC;long;
- {0x6428, 4, L_FIX}, // "sprmPBrcBetween" pap.brcBetween;BRC;long;
- {0x6629, 4, L_FIX}, // "sprmPBrcBar" pap.brcBar;BRC;long;
- {0x242A, 1, L_FIX}, // "sprmPFNoAutoHyph" pap.fNoAutoHyph;0 or 1;byte;
- {0x442B, 2, L_FIX}, // "sprmPWHeightAbs" pap.wHeightAbs;w;word;
- {0x442C, 2, L_FIX}, // "sprmPDcs" pap.dcs;DCS;short;
- {0x442D, 2, L_FIX}, // "sprmPShd" pap.shd;SHD;word;
- {0x842E, 2, L_FIX}, // "sprmPDyaFromText" pap.dyaFromText;dya;word;
- {0x842F, 2, L_FIX}, // "sprmPDxaFromText" pap.dxaFromText;dxa;word;
- {0x2430, 1, L_FIX}, // "sprmPFLocked" pap.fLocked;0 or 1;byte;
- {0x2431, 1, L_FIX}, // "sprmPFWidowControl" pap.fWidowControl;0 or 1
- {0xC632, 0, L_VAR}, // "sprmPRuler" ;;variable length;
- {0x2433, 1, L_FIX}, // "sprmPFKinsoku" pap.fKinsoku;0 or 1;byte;
- {0x2434, 1, L_FIX}, // "sprmPFWordWrap" pap.fWordWrap;0 or 1;byte;
- {0x2435, 1, L_FIX}, // "sprmPFOverflowPunct" pap.fOverflowPunct;0 or 1
- {0x2436, 1, L_FIX}, // "sprmPFTopLinePunct" pap.fTopLinePunct;0 or 1
- {0x2437, 1, L_FIX}, // "sprmPFAutoSpaceDE" pap.fAutoSpaceDE;0 or 1
- {0x2438, 1, L_FIX}, // "sprmPFAutoSpaceDN" pap.fAutoSpaceDN;0 or 1
- {0x4439, 2, L_FIX}, // "sprmPWAlignFont" pap.wAlignFont;iFa
- {0x443A, 2, L_FIX}, // "sprmPFrameTextFlow" pap.fVertical pap.fBackward
- // pap.fRotateFont;complex
- {0x243B, 1, L_FIX}, // "sprmPISnapBaseLine" obsolete: not applicable in
- // Word97 and later versions;
- {0xC63E, 0, L_VAR}, // "sprmPAnld" pap.anld;;variable length;
- {0xC63F, 0, L_VAR}, // "sprmPPropRMark" pap.fPropRMark;complex
- {0x2640, 1, L_FIX}, // "sprmPOutLvl" pap.lvl;has no effect if pap.istd
- // is < 1 or is > 9
- {0x2441, 1, L_FIX}, // "sprmPFBiDi" ;;byte;
- {0x2443, 1, L_FIX}, // "sprmPFNumRMIns" pap.fNumRMIns;1 or 0;bit;
- {0x2444, 1, L_FIX}, // "sprmPCrLf" ;;byte;
- {0xC645, 0, L_VAR}, // "sprmPNumRM" pap.numrm;;variable length;
- {0x6645, 4, L_FIX}, // "sprmPHugePapx" fc in the data stream to locate
- // the huge grpprl
- {0x6646, 4, L_FIX}, // "sprmPHugePapx" fc in the data stream to locate
- // the huge grpprl
- {0x2447, 1, L_FIX}, // "sprmPFUsePgsuSettings" pap.fUsePgsuSettings;
- // 1 or 0
- {0x2448, 1, L_FIX}, // "sprmPFAdjustRight" pap.fAdjustRight;1 or 0;byte;
- {0x0800, 1, L_FIX}, // "sprmCFRMarkDel" chp.fRMarkDel;1 or 0;bit;
- {0x0801, 1, L_FIX}, // "sprmCFRMark" chp.fRMark;1 or 0;bit;
- {0x0802, 1, L_FIX}, // "sprmCFFldVanish" chp.fFldVanish;1 or 0;bit;
- {0x6A03, 4, L_FIX}, // "sprmCPicLocation" chp.fcPic and chp.fSpec;
- {0x4804, 2, L_FIX}, // "sprmCIbstRMark" chp.ibstRMark;index into
- // sttbRMark
- {0x6805, 4, L_FIX}, // "sprmCDttmRMark" chp.dttmRMark;DTTM;long;
- {0x0806, 1, L_FIX}, // "sprmCFData" chp.fData;1 or 0;bit;
- {0x4807, 2, L_FIX}, // "sprmCIdslRMark" chp.idslRMReason;an index to a
- // table of strings defined in Word 6.0
- // executables;short;
- {0xEA08, 1, L_FIX}, // "sprmCChs" chp.fChsDiff and chp.chse;
- {0x6A09, 4, L_FIX}, // "sprmCSymbol" chp.fSpec, chp.xchSym and
- // chp.ftcSym
- {0x080A, 1, L_FIX}, // "sprmCFOle2" chp.fOle2;1 or 0;bit;
- {0x480B, 0, L_FIX}, // "sprmCIdCharType" obsolete: not applicable in
- // Word97 and later versions;;;
- {0x2A0C, 1, L_FIX}, // "sprmCHighlight" chp.fHighlight,
- // chp.icoHighlight;ico (fHighlight is set to 1 iff
- // ico is not 0)
- {0x680E, 4, L_FIX}, // "sprmCObjLocation" chp.fcObj;FC;long;
- {0x2A10, 0, L_FIX}, // "sprmCFFtcAsciSymb" ;;;
- {0x4A30, 2, L_FIX}, // "sprmCIstd" chp.istd;istd, see stylesheet def
- {0xCA31, 0, L_VAR}, // "sprmCIstdPermute" chp.istd;permutation vector
- {0x2A32, 0, L_VAR}, // "sprmCDefault" whole CHP;none;variable length;
- {0x2A33, 0, L_FIX}, // "sprmCPlain" whole CHP;none;0;
- {0x2A34, 1, L_FIX}, // "sprmCKcd" ;;;
- {0x0835, 1, L_FIX}, // "sprmCFBold" chp.fBold;0,1, 128, or 129
- {0x0836, 1, L_FIX}, // "sprmCFItalic" chp.fItalic;0,1, 128, or 129
- {0x0837, 1, L_FIX}, // "sprmCFStrike" chp.fStrike;0,1, 128, or 129
- {0x0838, 1, L_FIX}, // "sprmCFOutline" chp.fOutline;0,1, 128, or 129
- {0x0839, 1, L_FIX}, // "sprmCFShadow" chp.fShadow;0,1, 128, or 129
- {0x083A, 1, L_FIX}, // "sprmCFSmallCaps" chp.fSmallCaps;0,1, 128, or 129
- {0x083B, 1, L_FIX}, // "sprmCFCaps" chp.fCaps;0,1, 128, or 129
- {0x083C, 1, L_FIX}, // "sprmCFVanish" chp.fVanish;0,1, 128, or 129
- {0x4A3D, 2, L_FIX}, // "sprmCFtcDefault" ;ftc, only used internally
- {0x2A3E, 1, L_FIX}, // "sprmCKul" chp.kul;kul;byte;
- {0xEA3F, 3, L_FIX}, // "sprmCSizePos" chp.hps, chp.hpsPos;3 bytes;
- {0x8840, 2, L_FIX}, // "sprmCDxaSpace" chp.dxaSpace;dxa;word;
- {0x4A41, 2, L_FIX}, // "sprmCLid" ;only used internally never stored
- {0x2A42, 1, L_FIX}, // "sprmCIco" chp.ico;ico;byte;
- {0x4A43, 2, L_FIX}, // "sprmCHps" chp.hps;hps
- {0x2A44, 1, L_FIX}, // "sprmCHpsInc" chp.hps;
- {0x4845, 2, L_FIX}, // "sprmCHpsPos" chp.hpsPos;hps;short; (doc wrong)
- {0x2A46, 1, L_FIX}, // "sprmCHpsPosAdj" chp.hpsPos;hps
- {0xCA47, 0, L_VAR}, // "sprmCMajority" chp.fBold, chp.fItalic,
- // chp.fSmallCaps, chp.fVanish, chp.fStrike,
- // chp.fCaps, chp.rgftc, chp.hps, chp.hpsPos,
- // chp.kul, chp.dxaSpace, chp.ico,
- // chp.rglid;complex;variable length, length byte
- // plus size of following grpprl;
- {0x2A48, 1, L_FIX}, // "sprmCIss" chp.iss;iss;byte;
- {0xCA49, 0, L_VAR}, // "sprmCHpsNew50" chp.hps;hps;variable width
- {0xCA4A, 0, L_VAR}, // "sprmCHpsInc1" chp.hps;complex
- {0x484B, 2, L_FIX}, // "sprmCHpsKern" chp.hpsKern;hps;short;
- {0xCA4C, 2, L_FIX}, // "sprmCMajority50" chp.fBold, chp.fItalic,
- // chp.fSmallCaps, chp.fVanish, chp.fStrike,
- // chp.fCaps, chp.ftc, chp.hps, chp.hpsPos, chp.kul,
- // chp.dxaSpace, chp.ico,;complex
- {0x4A4D, 2, L_FIX}, // "sprmCHpsMul" chp.hps;percentage to grow hps
- {0x484E, 2, L_FIX}, // "sprmCYsri" chp.ysri;ysri;short;
- {0x4A4F, 2, L_FIX}, // "sprmCRgFtc0" chp.rgftc[0];ftc for ASCII text
- {0x4A50, 2, L_FIX}, // "sprmCRgFtc1" chp.rgftc[1];ftc for Far East text
- {0x4A51, 2, L_FIX}, // "sprmCRgFtc2" chp.rgftc[2];ftc for non-FE text
- {0x4852, 2, L_FIX}, // "sprmCCharScale"
- {0x2A53, 1, L_FIX}, // "sprmCFDStrike" chp.fDStrike;;byte;
- {0x0854, 1, L_FIX}, // "sprmCFImprint" chp.fImprint;1 or 0;bit;
- {0x0855, 1, L_FIX}, // "sprmCFSpec" chp.fSpec ;1 or 0;bit;
- {0x0856, 1, L_FIX}, // "sprmCFObj" chp.fObj;1 or 0;bit;
- {0xCA57, 0, L_VAR}, // "sprmCPropRMark" chp.fPropRMark,
- // chp.ibstPropRMark, chp.dttmPropRMark;Complex
- {0x0858, 1, L_FIX}, // "sprmCFEmboss" chp.fEmboss;1 or 0;bit;
- {0x2859, 1, L_FIX}, // "sprmCSfxText" chp.sfxtText;text animation;byte;
- {0x085A, 1, L_FIX}, // "sprmCFBiDi" ;;;
- {0x085B, 1, L_FIX}, // "sprmCFDiacColor" ;;;
- {0x085C, 1, L_FIX}, // "sprmCFBoldBi" ;;;
- {0x085D, 1, L_FIX}, // "sprmCFItalicBi" ;;;
- {0x4A5E, 2, L_FIX},
- {0x485F, 2, L_FIX}, // "sprmCLidBi" ;;;
- {0x4A60, 1, L_FIX}, // "sprmCIcoBi" ;;;
- {0x4A61, 2, L_FIX}, // "sprmCHpsBi" ;;;
- {0xCA62, 0, L_VAR}, // "sprmCDispFldRMark" chp.fDispFldRMark,
- // chp.ibstDispFldRMark, chp.dttmDispFldRMark ;
- {0x4863, 2, L_FIX}, // "sprmCIbstRMarkDel" chp.ibstRMarkDel;index into
- // sttbRMark;short;
- {0x6864, 4, L_FIX}, // "sprmCDttmRMarkDel" chp.dttmRMarkDel;DTTM;long;
- {0x6865, 4, L_FIX}, // "sprmCBrc" chp.brc;BRC;long;
- {0x4866, 2, L_FIX}, // "sprmCShd" chp.shd;SHD;short;
- {0x4867, 2, L_FIX}, // "sprmCIdslRMarkDel" chp.idslRMReasonDel;an index
- // to a table of strings defined in Word 6.0
- // executables;short;
- {0x0868, 1, L_FIX}, // "sprmCFUsePgsuSettings"
- // chp.fUsePgsuSettings;1 or 0
- {0x486B, 2, L_FIX}, // "sprmCCpg" ;;word;
- {0x486D, 2, L_FIX}, // "sprmCRgLid0" chp.rglid[0];LID: for non-FE text
- {0x486E, 2, L_FIX}, // "sprmCRgLid1" chp.rglid[1];LID: for Far East text
- {0x286F, 1, L_FIX}, // "sprmCIdctHint" chp.idctHint;IDCT:
- {0x2E00, 1, L_FIX}, // "sprmPicBrcl" pic.brcl;brcl (see PIC definition)
- {0xCE01, 0, L_VAR}, // "sprmPicScale" pic.mx, pic.my, pic.dxaCropleft,
- // pic.dyaCropTop pic.dxaCropRight,
- // pic.dyaCropBottom;Complex
- {0x6C02, 4, L_FIX}, // "sprmPicBrcTop" pic.brcTop;BRC;long;
- {0x6C03, 4, L_FIX}, // "sprmPicBrcLeft" pic.brcLeft;BRC;long;
- {0x6C04, 4, L_FIX}, // "sprmPicBrcBottom" pic.brcBottom;BRC;long;
- {0x6C05, 4, L_FIX}, // "sprmPicBrcRight" pic.brcRight;BRC;long;
- {0x3000, 1, L_FIX}, // "sprmScnsPgn" sep.cnsPgn;cns;byte;
- {0x3001, 1, L_FIX}, // "sprmSiHeadingPgn" sep.iHeadingPgn;heading number
- // level;byte;
- {0xD202, 0, L_VAR}, // "sprmSOlstAnm" sep.olstAnm;OLST;variable length;
- {0xF203, 3, L_FIX}, // "sprmSDxaColWidth" sep.rgdxaColWidthSpacing;
- {0xF204, 3, L_FIX}, // "sprmSDxaColSpacing" sep.rgdxaColWidthSpacing;
- // complex
- {0x3005, 1, L_FIX}, // "sprmSFEvenlySpaced" sep.fEvenlySpaced;1 or 0
- {0x3006, 1, L_FIX}, // "sprmSFProtected" sep.fUnlocked;1 or 0;byte;
- {0x5007, 2, L_FIX}, // "sprmSDmBinFirst" sep.dmBinFirst;;word;
- {0x5008, 2, L_FIX}, // "sprmSDmBinOther" sep.dmBinOther;;word;
- {0x3009, 1, L_FIX}, // "sprmSBkc" sep.bkc;bkc;byte;
- {0x300A, 1, L_FIX}, // "sprmSFTitlePage" sep.fTitlePage;0 or 1;byte;
- {0x500B, 2, L_FIX}, // "sprmSCcolumns" sep.ccolM1;# of cols - 1;word;
- {0x900C, 2, L_FIX}, // "sprmSDxaColumns" sep.dxaColumns;dxa;word;
- {0x300D, 1, L_FIX}, // "sprmSFAutoPgn" sep.fAutoPgn;obsolete;byte;
- {0x300E, 1, L_FIX}, // "sprmSNfcPgn" sep.nfcPgn;nfc;byte;
- {0xB00F, 2, L_FIX}, // "sprmSDyaPgn" sep.dyaPgn;dya;short;
- {0xB010, 2, L_FIX}, // "sprmSDxaPgn" sep.dxaPgn;dya;short;
- {0x3011, 1, L_FIX}, // "sprmSFPgnRestart" sep.fPgnRestart;0 or 1;byte;
- {0x3012, 1, L_FIX}, // "sprmSFEndnote" sep.fEndnote;0 or 1;byte;
- {0x3013, 1, L_FIX}, // "sprmSLnc" sep.lnc;lnc;byte;
- {0x3014, 1, L_FIX}, // "sprmSGprfIhdt" sep.grpfIhdt;grpfihdt
- {0x5015, 2, L_FIX}, // "sprmSNLnnMod" sep.nLnnMod;non-neg int.;word;
- {0x9016, 2, L_FIX}, // "sprmSDxaLnn" sep.dxaLnn;dxa;word;
- {0xB017, 2, L_FIX}, // "sprmSDyaHdrTop" sep.dyaHdrTop;dya;word;
- {0xB018, 2, L_FIX}, // "sprmSDyaHdrBottom" sep.dyaHdrBottom;dya;word;
- {0x3019, 1, L_FIX}, // "sprmSLBetween" sep.fLBetween;0 or 1;byte;
- {0x301A, 1, L_FIX}, // "sprmSVjc" sep.vjc;vjc;byte;
- {0x501B, 2, L_FIX}, // "sprmSLnnMin" sep.lnnMin;lnn;word;
- {0x501C, 2, L_FIX}, // "sprmSPgnStart" sep.pgnStart;pgn;word;
- {0x301D, 1, L_FIX}, // "sprmSBOrientation" sep.dmOrientPage;dm;byte;
- {0x301E, 1, L_FIX}, // "sprmSBCustomize" ;;;
- {0xB01F, 2, L_FIX}, // "sprmSXaPage" sep.xaPage;xa;word;
- {0xB020, 2, L_FIX}, // "sprmSYaPage" sep.yaPage;ya;word;
- {0xB021, 2, L_FIX}, // "sprmSDxaLeft" sep.dxaLeft;dxa;word;
- {0xB022, 2, L_FIX}, // "sprmSDxaRight" sep.dxaRight;dxa;word;
- {0x9023, 2, L_FIX}, // "sprmSDyaTop" sep.dyaTop;dya;word;
- {0x9024, 2, L_FIX}, // "sprmSDyaBottom" sep.dyaBottom;dya;word;
- {0xB025, 2, L_FIX}, // "sprmSDzaGutter" sep.dzaGutter;dza;word;
- {0x5026, 2, L_FIX}, // "sprmSDmPaperReq" sep.dmPaperReq;dm;word;
- {0xD227, 0, L_VAR}, // "sprmSPropRMark" sep.fPropRMark,
- // sep.ibstPropRMark, sep.dttmPropRMark ;complex
- {0x3228, 1, L_FIX}, // "sprmSFBiDi" ;;;
- {0x3229, 1, L_FIX}, // "sprmSFFacingCol" ;;;
- {0x322A, 1, L_FIX}, // "sprmSFRTLGutter", set to one if gutter is on
- // right
- {0x702B, 4, L_FIX}, // "sprmSBrcTop" sep.brcTop;BRC;long;
- {0x702C, 4, L_FIX}, // "sprmSBrcLeft" sep.brcLeft;BRC;long;
- {0x702D, 4, L_FIX}, // "sprmSBrcBottom" sep.brcBottom;BRC;long;
- {0x702E, 4, L_FIX}, // "sprmSBrcRight" sep.brcRight;BRC;long;
- {0x522F, 2, L_FIX}, // "sprmSPgbProp" sep.pgbProp;;word;
- {0x7030, 4, L_FIX}, // "sprmSDxtCharSpace" sep.dxtCharSpace;dxt;long;
- {0x9031, 2, L_FIX}, // "sprmSDyaLinePitch"
- // sep.dyaLinePitch;dya; WRONG:long; RIGHT:short; !
- {0x5032, 2, L_FIX}, // "sprmSClm" ;;;
- {0x5033, 2, L_FIX}, // "sprmSTextFlow" sep.wTextFlow;complex
- {0x5400, 2, L_FIX}, // "sprmTJc" tap.jc;jc;word (low order byte is
- // significant);
- {0x9601, 2, L_FIX}, // "sprmTDxaLeft" tap.rgdxaCenter
- {0x9602, 2, L_FIX}, // "sprmTDxaGapHalf" tap.dxaGapHalf,
- // tap.rgdxaCenter
- {0x3403, 1, L_FIX}, // "sprmTFCantSplit" tap.fCantSplit;1 or 0;byte;
- {0x3404, 1, L_FIX}, // "sprmTTableHeader" tap.fTableHeader;1 or 0;byte;
- {0xD605, 0, L_VAR}, // "sprmTTableBorders" tap.rgbrcTable;complex
- {0xD606, 0, L_VAR}, // "sprmTDefTable10" tap.rgdxaCenter,
- // tap.rgtc;complex
- {0x9407, 2, L_FIX}, // "sprmTDyaRowHeight" tap.dyaRowHeight;dya;word;
- {0xD608, 0, L_VAR}, // "sprmTDefTable" tap.rgtc;complex
- {0xD609, 0, L_VAR}, // "sprmTDefTableShd" tap.rgshd;complex
- {0x740A, 4, L_FIX}, // "sprmTTlp" tap.tlp;TLP;4 bytes;
- {0x560B, 1, L_FIX}, // "sprmTFBiDi" ;;;
- {0x740C, 1, L_FIX}, // "sprmTHTMLProps" ;;;
- {0xD620, 0, L_VAR}, // "sprmTSetBrc" tap.rgtc[].rgbrc;complex
- {0x7621, 4, L_FIX}, // "sprmTInsert" tap.rgdxaCenter, tap.rgtc;complex
- {0x5622, 2, L_FIX}, // "sprmTDelete" tap.rgdxaCenter, tap.rgtc;complex
- {0x7623, 4, L_FIX}, // "sprmTDxaCol" tap.rgdxaCenter;complex
- {0x5624, 0, L_VAR}, // "sprmTMerge" tap.fFirstMerged, tap.fMerged;
- {0x5625, 0, L_VAR}, // "sprmTSplit" tap.fFirstMerged, tap.fMerged;
- {0xD626, 0, L_VAR}, // "sprmTSetBrc10" tap.rgtc[].rgbrc;complex
- {0x7627, 0, L_VAR}, // "sprmTSetShd" tap.rgshd;complex
- {0x7628, 0, L_VAR}, // "sprmTSetShdOdd" tap.rgshd;complex
- {0x7629, 0, L_VAR}, // "sprmTTextFlow" tap.rgtc[].fVerticaltap,
- // rgtc[].fBackwardtap, rgtc[].fRotateFont;0 or 10
- // or 10 or 1;word;
- {0xD62A, 1, L_FIX}, // "sprmTDiagLine" ;;;
- {0xD62B, 0, L_VAR}, // "sprmTVertMerge" tap.rgtc[].vertMerge
- {0xD62C, 0, L_VAR}, // "sprmTVertAlign" tap.rgtc[].vertAlign
- {0xCA78, 0, L_VAR}, // undocumented "sprmCDoubleLine ?"
- {0x6649, 4, L_FIX}, // undocumented
- {0xF614, 3, L_FIX}, // undocumented
- {0xD612, 0, L_VAR}, // undocumented, new background colours.
- {0xD613, 0, L_VAR}, // undocumented
- {0xD61A, 0, L_VAR}, // undocumented
- {0xD61B, 0, L_VAR}, // undocumented
- {0xD61C, 0, L_VAR}, // undocumented
- {0xD61D, 0, L_VAR}, // undocumented
- {0xD632, 0, L_VAR}, // undocumented
- {0xD634, 0, L_VAR}, // undocumented
- {0xD238, 0, L_VAR}, // undocumented sep
- {0xC64E, 0, L_VAR}, // undocumented
- {0xC64F, 0, L_VAR}, // undocumented
- {0xC650, 0, L_VAR}, // undocumented
- {0xC651, 0, L_VAR}, // undocumented
- {0xF661, 3, L_FIX}, // undocumented
- {0x4873, 2, L_FIX}, // undocumented
- {0x4874, 2, L_FIX}, // undocumented
- {0x6463, 4, L_FIX}, // undocumented
- {0x2461, 1, L_FIX}, // undoc, must be asian version of "sprmPJc"
- {0x845D, 2, L_FIX}, // undoc, must be asian version of "sprmPDxaRight"
- {0x845E, 2, L_FIX}, // undoc, must be asian version of "sprmPDxaLeft"
- {0x8460, 2, L_FIX}, // undoc, must be asian version of "sprmPDxaLeft1"
- {0x3615, 1, L_FIX}, // undocumented
- {0x360D, 1, L_FIX}, // undocumented
- {0x703A, 4, L_FIX}, // undocumented, sep, perhaps related to textgrids ?
- {0x303B, 1, L_FIX}, // undocumented, sep
- {0x244B, 1, L_FIX}, // undocumented, subtable "sprmPFInTable" equiv ?
- {0x244C, 1, L_FIX}, // undocumented, subtable "sprmPFTtp" equiv ?
- {0x940E, 2, L_FIX}, // undocumented
- {0x940F, 2, L_FIX}, // undocumented
- {0x9410, 2, L_FIX}, // undocumented
- {0x6815, 4, L_FIX}, // undocumented
- {0x6816, 4, L_FIX}, // undocumented
- {0x6870, 4, L_FIX}, // undocumented, text colour
- {0xC64D, 0, L_VAR}, // undocumented, para back colour
- {0x6467, 4, L_FIX}, // undocumented
- {0x646B, 4, L_FIX}, // undocumented
- {0xF617, 3, L_FIX}, // undocumented
- {0xD660, 0, L_VAR}, // undocumented, something to do with colour.
- {0xD670, 0, L_VAR}, // undocumented, something to do with colour.
- {0xCA71, 0, L_VAR}, // undocumented, text backcolour
- {0x303C, 1, L_FIX}, // undocumented, sep
- {0x245B, 1, L_FIX}, // undocumented, para autobefore
- {0x245C, 1, L_FIX} // undocumented, para autoafter
- };
-
- static wwSprmSearcher aSprmSrch(aSprms, sizeof(aSprms) / sizeof(aSprms[0]));
- return &aSprmSrch;
-};
-
-wwSprmParser::wwSprmParser(int nVersion) : mnVersion(nVersion)
-{
- ASSERT((mnVersion >= 6 && mnVersion <= 8), "Impossible value for version");
-
- mnDelta = (8 > mnVersion) ? 0 : 1;
-
- if (mnVersion < 8)
- mpKnownSprms = GetWW6SprmSearcher();
- else
- mpKnownSprms = GetWW8SprmSearcher();
-}
-
-SprmInfo wwSprmParser::GetSprmInfo(sal_uInt16 nId) const
-{
- // Find sprm
- SprmInfo aSrch;
- aSrch.nId = nId;
- const SprmInfo* pFound = mpKnownSprms->search(aSrch);
- if (pFound == 0)
- {
- ASSERT(mnVersion >= 8,
- "Unknown ww6 sprm, dangerous, report to development");
-
- aSrch.nId = 0;
- aSrch.nLen = 0;
- //All the unknown ww7 sprms appear to be variable (which makes sense)
- aSrch.nVari = L_VAR;
-
- if (mnVersion == 8) //We can recover perfectly in this case
- {
- aSrch.nVari = L_FIX;
- switch (nId >> 13)
- {
- case 0:
- case 1:
- aSrch.nLen = 1;
- break;
- case 2:
- aSrch.nLen = 2;
- break;
- case 3:
- aSrch.nLen = 4;
- break;
- case 4:
- case 5:
- aSrch.nLen = 2;
- break;
- case 6:
- aSrch.nLen = 0;
- aSrch.nVari = L_VAR;
- break;
- case 7:
- default:
- aSrch.nLen = 3;
- break;
- }
- }
-
- pFound = &aSrch;
- }
- return *pFound;
-}
-
-//-end
-
-inline sal_uInt8 Get_Byte( sal_uInt8 *& p )
-{
- sal_uInt8 n = SVBT8ToByte( *(SVBT8*)p );
- p += 1;
- return n;
-}
-
-inline sal_uInt16 Get_UShort( sal_uInt8 *& p )
-{
- sal_uInt16 n = SVBT16ToShort( *(SVBT16*)p );
- p += 2;
- return n;
-}
-
-inline short Get_Short( sal_uInt8 *& p )
-{
- return Get_UShort(p);
-}
-
-inline sal_uLong Get_ULong( sal_uInt8 *& p )
-{
- sal_uLong n = SVBT32ToUInt32( *(SVBT32*)p );
- p += 4;
- return n;
-}
-
-inline long Get_Long( sal_uInt8 *& p )
-{
- return Get_ULong(p);
-}
-
-WW8SprmIter::WW8SprmIter(const sal_uInt8* pSprms_, long nLen_,
- const wwSprmParser &rParser)
- : mrSprmParser(rParser), pSprms( pSprms_), nRemLen( nLen_)
-{
- UpdateMyMembers();
-}
-
-void WW8SprmIter::SetSprms(const sal_uInt8* pSprms_, long nLen_)
-{
- pSprms = pSprms_;
- nRemLen = nLen_;
- UpdateMyMembers();
-}
-
-const sal_uInt8* WW8SprmIter::operator ++( int )
-{
- if (nRemLen > 0)
- {
- pSprms += nAktSize;
- nRemLen -= nAktSize;
- UpdateMyMembers();
- }
- return pSprms;
-}
-
-void WW8SprmIter::UpdateMyMembers()
-{
- if (pSprms && nRemLen > 0)
- {
- nAktId = mrSprmParser.GetSprmId(pSprms);
- pAktParams = pSprms + mrSprmParser.DistanceToData(nAktId);
- nAktSize = mrSprmParser.GetSprmSize(nAktId, pSprms);
- }
- else
- {
- nAktId = 0;
- pAktParams = 0;
- nAktSize = 0;
- nRemLen = 0;
- }
-}
-
-const sal_uInt8* WW8SprmIter::FindSprm(sal_uInt16 nId)
-{
- while(GetSprms())
- {
- if( GetAktId() == nId )
- return GetAktParams(); // SPRM found!
- operator ++(0);
- }
-
- return 0; // SPRM _not_ found
-}
-
-//-----------------------------------------
-// temporaerer Test
-//-----------------------------------------
-// WW8PLCFx_PCDAttrs halten sich an WW8PLCF_Pcd fest und besitzen deshalb keine
-// eigenen Iteratoren. Alle sich auf Iteratoren beziehenden Methoden
-// sind deshalb Dummies.
-
-WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs(sal_uInt8 nVersion, WW8PLCFx_PCD* pPLCFx_PCD,
- const WW8ScannerBase* pBase)
- : WW8PLCFx(nVersion, true), pPcdI(pPLCFx_PCD->GetPLCFIter()),
- pPcd(pPLCFx_PCD), pGrpprls(pBase->pPieceGrpprls),
- nGrpprls(pBase->nPieceGrpprls)
-{
-}
-
-sal_uLong WW8PLCFx_PCDAttrs::GetIdx() const
-{
- return 0;
-}
-
-void WW8PLCFx_PCDAttrs::SetIdx( sal_uLong )
-{
-}
-
-bool WW8PLCFx_PCDAttrs::SeekPos(WW8_CP )
-{
- return true;
-}
-
-WW8PLCFx& WW8PLCFx_PCDAttrs::operator ++( int )
-{
- return *this;
-}
-
-WW8_CP WW8PLCFx_PCDAttrs::Where()
-{
- return ( pPcd ) ? pPcd->Where() : LONG_MAX;
-}
-
-void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
-{
- void* pData;
-
- p->bRealLineEnd = false;
- if ( !pPcdI || !pPcdI->Get(p->nStartPos, p->nEndPos, pData) )
- {
- // PLCF fully processed
- p->nStartPos = p->nEndPos = LONG_MAX;
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- return;
- }
-
- sal_uInt16 nPrm = SVBT16ToShort( ( (WW8_PCD*)pData )->prm );
- if ( nPrm & 1 )
- {
- // PRM Variant 2
- sal_uInt16 nSprmIdx = nPrm >> 1;
-
- if( nSprmIdx >= nGrpprls )
- {
- // Invalid Index
- p->nStartPos = p->nEndPos = LONG_MAX;
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- return;
- }
- const sal_uInt8* pSprms = pGrpprls[ nSprmIdx ];
-
- p->nSprmsLen = SVBT16ToShort( pSprms ); // Length
- pSprms += 2;
- p->pMemPos = pSprms; // Position
- }
- else
- {
- // PRM Variante 1: Sprm wird direkt in Member-Var abgelegt
- /*
- Dies sind die Attr, die in der Piece-Table stehen, statt im Text !
- */
-
- if(8 > GetVersion())
- {
- aShortSprm[0] = (sal_uInt8)( ( nPrm & 0xfe) >> 1 );
- aShortSprm[1] = (sal_uInt8)( nPrm >> 8 );
- p->nSprmsLen = ( nPrm ) ? 2 : 0; // Laenge
-
- // store Postion of internal mini storage in Data Pointer
- p->pMemPos = aShortSprm;
- }
- else
- {
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- sal_uInt8 nSprmListIdx = (sal_uInt8)((nPrm & 0xfe) >> 1);
- if( nSprmListIdx )
- {
- // process Sprm Id Matching as explained in MS Doku
- //
- // ''Property Modifier(variant 1) (PRM)''
- // see file: s62f39.htm
- //
- // Since isprm is 7 bits, rgsprmPrm can hold 0x80 entries.
- static const sal_uInt16 aSprmId[0x80] =
- {
- // sprmNoop, sprmNoop, sprmNoop, sprmNoop
- 0x0000,0x0000,0x0000,0x0000,
- // sprmPIncLvl, sprmPJc, sprmPFSideBySide, sprmPFKeep
- 0x2402,0x2403,0x2404,0x2405,
- // sprmPFKeepFollow, sprmPFPageBreakBefore, sprmPBrcl,
- // sprmPBrcp
- 0x2406,0x2407,0x2408,0x2409,
- // sprmPIlvl, sprmNoop, sprmPFNoLineNumb, sprmNoop
- 0x260A,0x0000,0x240C,0x0000,
- // sprmNoop, sprmNoop, sprmNoop, sprmNoop
- 0x0000,0x0000,0x0000,0x0000,
- // sprmNoop, sprmNoop, sprmNoop, sprmNoop
- 0x0000,0x0000,0x0000,0x0000,
- // sprmPFInTable, sprmPFTtp, sprmNoop, sprmNoop
- 0x2416,0x2417,0x0000,0x0000,
- // sprmNoop, sprmPPc, sprmNoop, sprmNoop
- 0x0000,0x261B,0x0000,0x0000,
- // sprmNoop, sprmNoop, sprmNoop, sprmNoop
- 0x0000,0x0000,0x0000,0x0000,
- // sprmNoop, sprmPWr, sprmNoop, sprmNoop
- 0x0000,0x2423,0x0000,0x0000,
- // sprmNoop, sprmNoop, sprmNoop, sprmNoop
- 0x0000,0x0000,0x0000,0x0000,
- // sprmPFNoAutoHyph, sprmNoop, sprmNoop, sprmNoop
- 0x242A,0x0000,0x0000,0x0000,
- // sprmNoop, sprmNoop, sprmPFLocked, sprmPFWidowControl
- 0x0000,0x0000,0x2430,0x2431,
- // sprmNoop, sprmPFKinsoku, sprmPFWordWrap,
- // sprmPFOverflowPunct
- 0x0000,0x2433,0x2434,0x2435,
- // sprmPFTopLinePunct, sprmPFAutoSpaceDE,
- // sprmPFAutoSpaceDN, sprmNoop
- 0x2436,0x2437,0x2438,0x0000,
- // sprmNoop, sprmPISnapBaseLine, sprmNoop, sprmNoop
- 0x0000,0x243B,0x000,0x0000,
- // sprmNoop, sprmCFStrikeRM, sprmCFRMark, sprmCFFldVanish
- 0x0000,0x0800,0x0801,0x0802,
- // sprmNoop, sprmNoop, sprmNoop, sprmCFData
- 0x0000,0x0000,0x0000,0x0806,
- // sprmNoop, sprmNoop, sprmNoop, sprmCFOle2
- 0x0000,0x0000,0x0000,0x080A,
- // sprmNoop, sprmCHighlight, sprmCFEmboss, sprmCSfxText
- 0x0000,0x2A0C,0x0858,0x2859,
- // sprmNoop, sprmNoop, sprmNoop, sprmCPlain
- 0x0000,0x0000,0x0000,0x2A33,
- // sprmNoop, sprmCFBold, sprmCFItalic, sprmCFStrike
- 0x0000,0x0835,0x0836,0x0837,
- // sprmCFOutline, sprmCFShadow, sprmCFSmallCaps, sprmCFCaps,
- 0x0838,0x0839,0x083a,0x083b,
- // sprmCFVanish, sprmNoop, sprmCKul, sprmNoop,
- 0x083C,0x0000,0x2A3E,0x0000,
- // sprmNoop, sprmNoop, sprmCIco, sprmNoop,
- 0x0000,0x0000,0x2A42,0x0000,
- // sprmCHpsInc, sprmNoop, sprmCHpsPosAdj, sprmNoop,
- 0x2A44,0x0000,0x2A46,0x0000,
- // sprmCIss, sprmNoop, sprmNoop, sprmNoop,
- 0x2A48,0x0000,0x0000,0x0000,
- // sprmNoop, sprmNoop, sprmNoop, sprmNoop,
- 0x0000,0x0000,0x0000,0x0000,
- // sprmNoop, sprmNoop, sprmNoop, sprmCFDStrike,
- 0x0000,0x0000,0x0000,0x2A53,
- // sprmCFImprint, sprmCFSpec, sprmCFObj, sprmPicBrcl,
- 0x0854,0x0855,0x0856,0x2E00,
- // sprmPOutLvl, sprmPFBiDi, sprmNoop, sprmNoop,
- 0x2640,0x2441,0x0000,0x0000,
- // sprmNoop, sprmNoop, sprmPPnbrRMarkNot
- 0x0000,0x0000,0x0000,0x0000
- };
-
- // find real Sprm Id:
- sal_uInt16 nSprmId = aSprmId[ nSprmListIdx ];
-
- if( nSprmId )
- {
- // move Sprm Id and Sprm Param to internal mini storage:
- aShortSprm[0] = (sal_uInt8)( ( nSprmId & 0x00ff) );
- aShortSprm[1] = (sal_uInt8)( ( nSprmId & 0xff00) >> 8 );
- aShortSprm[2] = (sal_uInt8)( nPrm >> 8 );
-
- // store Sprm Length in member:
- p->nSprmsLen = ( nPrm ) ? 3 : 0;
-
- // store Postion of internal mini storage in Data Pointer
- p->pMemPos = aShortSprm;
- }
- }
- }
- }
-}
-
-//------------------------------------------------------------------------
-
-WW8PLCFx_PCD::WW8PLCFx_PCD(sal_uInt8 nVersion, WW8PLCFpcd* pPLCFpcd,
- WW8_CP nStartCp, bool bVer67P)
- : WW8PLCFx(nVersion, false), nClipStart(-1)
-{
- // eigenen Iterator konstruieren
- pPcdI = new WW8PLCFpcd_Iter(*pPLCFpcd, nStartCp);
- bVer67= bVer67P;
-}
-
-WW8PLCFx_PCD::~WW8PLCFx_PCD()
-{
- // pPcd-Dtor which in called from WW8ScannerBase
- delete pPcdI;
-}
-
-sal_uLong WW8PLCFx_PCD::GetIMax() const
-{
- return pPcdI ? pPcdI->GetIMax() : 0;
-}
-
-sal_uLong WW8PLCFx_PCD::GetIdx() const
-{
- return pPcdI ? pPcdI->GetIdx() : 0;
-}
-
-void WW8PLCFx_PCD::SetIdx( sal_uLong nIdx )
-{
- if (pPcdI)
- pPcdI->SetIdx( nIdx );
-}
-
-bool WW8PLCFx_PCD::SeekPos(WW8_CP nCpPos)
-{
- return pPcdI ? pPcdI->SeekPos( nCpPos ) : false;
-}
-
-WW8_CP WW8PLCFx_PCD::Where()
-{
- return pPcdI ? pPcdI->Where() : LONG_MAX;
-}
-
-long WW8PLCFx_PCD::GetNoSprms( long& rStart, long& rEnd, long& rLen )
-{
- void* pData;
- rLen = 0;
-
- if ( !pPcdI || !pPcdI->Get(rStart, rEnd, pData) )
- {
- rStart = rEnd = LONG_MAX;
- return -1;
- }
- return pPcdI->GetIdx();
-}
-
-WW8PLCFx& WW8PLCFx_PCD::operator ++( int )
-{
- if (pPcdI)
- (*pPcdI)++;
- else
- ASSERT( !this, "pPcdI fehlt");
- return *this;
-}
-
-WW8_FC WW8PLCFx_PCD::AktPieceStartCp2Fc( WW8_CP nCp )
-{
- WW8_CP nCpStart, nCpEnd;
- void* pData;
-
- if ( !pPcdI->Get(nCpStart, nCpEnd, pData) )
- {
- ASSERT( !this, "AktPieceStartCp2Fc() with false Cp found (1)" );
- return LONG_MAX;
- }
-
- ASSERT( nCp >= nCpStart && nCp < nCpEnd,
- "AktPieceCp2Fc() with false Cp found (2)" );
-
- if( nCp < nCpStart )
- nCp = nCpStart;
- if( nCp >= nCpEnd )
- nCp = nCpEnd - 1;
-
- bool bIsUnicode = false;
- WW8_FC nFC = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
- if( !bVer67 )
- nFC = WW8PLCFx_PCD::TransformPieceAddress( nFC, bIsUnicode );
-
- return nFC + (nCp - nCpStart) * (bIsUnicode ? 2 : 1);
-}
-
-
-void WW8PLCFx_PCD::AktPieceFc2Cp( long& rStartPos, long& rEndPos,
- const WW8ScannerBase *pSBase )
-{
- //No point going anywhere with this
- if ((rStartPos == LONG_MAX) && (rEndPos == LONG_MAX))
- return;
-
- rStartPos = pSBase->WW8Fc2Cp( rStartPos );
- rEndPos = pSBase->WW8Fc2Cp( rEndPos );
-}
-
-WW8_CP WW8PLCFx_PCD::AktPieceStartFc2Cp( WW8_FC nStartPos )
-{
- WW8_CP nCpStart, nCpEnd;
- void* pData;
- if ( !pPcdI->Get( nCpStart, nCpEnd, pData ) )
- {
- ASSERT( !this, "AktPieceStartFc2Cp() - Fehler" );
- return LONG_MAX;
- }
- bool bIsUnicode = false;
- sal_Int32 nFcStart = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
- if( !bVer67 )
- nFcStart = WW8PLCFx_PCD::TransformPieceAddress( nFcStart, bIsUnicode );
-
- sal_Int32 nUnicodeFactor = bIsUnicode ? 2 : 1;
-
- if( nStartPos < nFcStart )
- nStartPos = nFcStart;
-
- if( nStartPos >= nFcStart + (nCpEnd - nCpStart) * nUnicodeFactor )
- nStartPos = nFcStart + (nCpEnd - nCpStart - 1) * nUnicodeFactor;
-
- return nCpStart + (nStartPos - nFcStart) / nUnicodeFactor;
-}
-
-//-----------------------------------------
-// Hilfsroutinen fuer alle
-//-----------------------------------------
-
-DateTime WW8ScannerBase::WW8DTTM2DateTime(long lDTTM)
-{
- /*
- mint short :6 0000003F minutes (0-59)
- hr short :5 000007C0 hours (0-23)
- dom short :5 0000F800 days of month (1-31)
- mon short :4 000F0000 months (1-12)
- yr short :9 1FF00000 years (1900-2411)-1900
- wdy short :3 E0000000 weekday(Sunday=0
- Monday=1
- ( wdy can be ignored ) Tuesday=2
- Wednesday=3
- Thursday=4
- Friday=5
- Saturday=6)
- */
- DateTime aDateTime(Date( 0 ), Time( 0 ));
- if( lDTTM )
- {
- sal_uInt16 lMin = (sal_uInt16)(lDTTM & 0x0000003F);
- lDTTM >>= 6;
- sal_uInt16 lHour= (sal_uInt16)(lDTTM & 0x0000001F);
- lDTTM >>= 5;
- sal_uInt16 lDay = (sal_uInt16)(lDTTM & 0x0000001F);
- lDTTM >>= 5;
- sal_uInt16 lMon = (sal_uInt16)(lDTTM & 0x0000000F);
- lDTTM >>= 4;
- sal_uInt16 lYear= (sal_uInt16)(lDTTM & 0x000001FF) + 1900;
- aDateTime = DateTime(Date(lDay, lMon, lYear), Time(lHour, lMin));
- }
- return aDateTime;
-}
-
-short WW8_BRC::DetermineBorderProperties(bool bVer67, short *pSpace,
- sal_uInt8 *pCol, short *pIdx) const
-{
- /*
- Word does not factor the width of the border into the width/height
- stored in the information for graphic/table/object widths, so we need
- to figure out this extra width here and utilize the returned size in
- our calculations
- */
- short nMSTotalWidth;
- sal_uInt8 nCol;
- short nIdx,nSpace;
- if( bVer67 )
- {
- sal_uInt16 aBrc1 = SVBT16ToShort(aBits1);
- nCol = ((aBrc1 >> 6) & 0x1f); // aBor.ico
- nSpace = (aBrc1 & 0xF800) >> 11;
-
- nMSTotalWidth = aBrc1 & 0x07;
- nIdx = (aBrc1 & 0x18) >> 3;
- //Dashed/Dotted unsets double/thick
- if (nMSTotalWidth > 5)
- {
- nMSTotalWidth=1;
- nIdx = 1;
- }
- nMSTotalWidth *= nIdx;
- nMSTotalWidth *= 15;
- }
- else
- {
- nIdx = aBits1[1];
- nCol = aBits2[0]; // aBor.ico
- nSpace = aBits2[1] & 0x1F; //space between line and object
-
- //Specification in 8ths of a point, 1 Point = 20 Twips, so by 2.5
- nMSTotalWidth = aBits1[ 0 ] * 20 / 8;
-
- //Figure out the real size of the border according to word
- switch (nIdx)
- {
- //Note that codes over 25 are undocumented, and I can't create
- //these 4 here in the wild.
- default:
- case 2:
- case 4:
- case 5:
- case 22:
- DBG_WARNING("Can't create these from the menus, please report");
- case 1:
- case 6:
- case 7:
- case 8:
- case 9:
- case 23: //Only 3pt in the menus, but honours the size setting.
- break;
- case 3:
- /*
- double line is three times the width of an ordinary line,
- except for the smallest 1/4 point size which appears to have
- exactly the same total border width as a 1/2 point size
- ordinary line, i.e. twice the nominal line width
- */
- nMSTotalWidth = (nMSTotalWidth == 5) ?
- nMSTotalWidth*2 : nMSTotalWidth*3;
- break;
- case 10:
- /*
- triple line is five times the width of an ordinary line,
- except that the smallest 1/4 point size appears to have
- exactly the same total border width as a 3/4 point size
- ordinary line, i.e. three times the nominal line width. The
- second smallest 1/2 point size appears to have exactly the
- total border width as a 2 1/4 border, i.e 4.5 times the size.
- */
- if (nMSTotalWidth == 5)
- nMSTotalWidth*=3;
- else if (nMSTotalWidth == 10)
- nMSTotalWidth = nMSTotalWidth*9/2;
- else
- nMSTotalWidth*=5;
- break;
- case 11:
- case 12:
- /*
- small gap thin thick and thick thin appears to have a 3/4
- point line, a 3/4 point gap and a thick line of the specified
- width
- */
- nMSTotalWidth = nMSTotalWidth + 15*2;
- break;
- case 13:
- /*
- thin thick thin appears to have two outside 3/4 point lines,
- two 3/4 point gaps and a thick line of the specified width
- */
- nMSTotalWidth = nMSTotalWidth + 15*4;
- break;
- case 14:
- case 15:
- /*
- medium gap thin thick and thick thin appears to have a line
- 50% of the thick line, and an equal sized gap and then the
- thick line of the specified width. But it appears to only
- use one of the existing predefined widths for the thin line,
- so the closest smallest existing border to the halved thick
- line is used.
- */
- switch (nMSTotalWidth)
- {
- case 45: //2 1/4, closest to half is 1
- nMSTotalWidth += 20 + (nMSTotalWidth-1)/2;
- break;
- case 5:
- case 10:
- nMSTotalWidth += 5;
- break;
- case 15: //3/4, closest to half is 1/4
- nMSTotalWidth += 5 + (nMSTotalWidth-1)/2;
- break;
- default:
- nMSTotalWidth*=2;
- break;
- }
- break;
- case 16:
- /*
- medium gap thin thick thin appears to have a line
- 50% of the thick line, and an equal sized gap and then the
- thick line of the specified width. But it appears to only
- use one of the existing predefined widths for the thin
- line, so the closest smallest existing border to the halved
- thick line is used. Though some fudging at smaller sizes is
- still required.
- */
- switch (nMSTotalWidth)
- {
- case 45: //2 1/4, closest to half is 1
- nMSTotalWidth += nMSTotalWidth + 20 * 2;
- break;
- case 20:
- case 15:
- nMSTotalWidth += nMSTotalWidth + 7 * 2;
- break;
- case 10:
- case 5:
- nMSTotalWidth += 5 + 4;
- break;
- default:
- nMSTotalWidth*=3;
- break;
- }
- break;
- case 17:
- case 18:
- /*
- large gap thin thick and thick thin appears to have a thick
- line of 1 1/2 pt and a narrow of 3/4 point, with a distance
- between the two of the explicitly set line width
- */
- nMSTotalWidth+=15+30;
- break;
- case 19:
- /*
- large gap thin thick thin appears to have a thick line of 1
- 1/2 pt and two narrows of 3/4 point, with a distance between
- the two of the explicitly set line width, though the narrowest
- line appears to behave as if it was even smaller
- */
- if (nMSTotalWidth == 5)
- nMSTotalWidth = 3;
- nMSTotalWidth = nMSTotalWidth*2 + 15*2 + 30;
- break;
- case 20:
- /*
- wave, the dimensions appear to be created by the drawing of
- the wave, so we have only two possibilites in the menus, 3/4
- point is equal to solid 3 point. This calculation seems to
- match well to results.
- */
- nMSTotalWidth +=45;
- break;
- case 21:
- /*
- double wave, the dimensions appear to be created by the
- drawing of the wave, so we have only one possibilites in the
- menus, that of 3/4 point is equal to solid 3 point. This
- calculation seems to match well to results.
- */
- nMSTotalWidth += 45*2;
- break;
- case 24:
- case 25:
- /*
- emboss and engrave consist of a three lines, the central is of
- the explicit point width, the other two (of equal size to each
- other are the shadows and are either 3/4 pt of 1 1/2 depending
- on if the central line is greater of less than 2 1/4 pt
- */
- if (nMSTotalWidth <= 45)
- nMSTotalWidth += 2*15;
- else
- nMSTotalWidth += 2*30;
- break;
- }
- }
-
- if (pIdx)
- *pIdx = nIdx;
- if (pSpace)
- *pSpace = nSpace*20;
- if (pCol)
- *pCol = nCol;
- return nMSTotalWidth;
-}
-
-WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
-{
- WW8_CP nFallBackCpEnd = LONG_MAX;
- if( nFcPos == LONG_MAX )
- return nFallBackCpEnd;
-
- bool bIsUnicode = false;
- if( pPieceIter ) // Complex File ?
- {
- sal_uLong nOldPos = pPieceIter->GetIdx();
-
- for (pPieceIter->SetIdx(0);
- pPieceIter->GetIdx() < pPieceIter->GetIMax();(*pPieceIter)++)
- {
- long nCpStart, nCpEnd;
- void* pData;
- if( !pPieceIter->Get( nCpStart, nCpEnd, pData ) )
- { // ausserhalb PLCFfpcd ?
- ASSERT( !this, "PLCFpcd-WW8Fc2Cp() ging schief" );
- break;
- }
- sal_Int32 nFcStart = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
- if( 8 <= pWw8Fib->nVersion )
- nFcStart = WW8PLCFx_PCD::TransformPieceAddress( nFcStart,
- bIsUnicode );
- sal_Int32 nLen = (nCpEnd - nCpStart) * (bIsUnicode ? 2 : 1);
-
- /*
- If this cp is inside this piece, or its the last piece and we are
- on the very last cp of that piece
- */
- if (nFcPos >= nFcStart)
- {
- // found
- WW8_CP nTempCp =
- nCpStart + ((nFcPos - nFcStart) / (bIsUnicode ? 2 : 1));
- if (nFcPos < nFcStart + nLen)
- {
- pPieceIter->SetIdx( nOldPos );
- return nTempCp;
- }
- else if (nFcPos == nFcStart + nLen)
- {
- //Keep this cp as its on a piece boundary because we might
- //need it if tests fail
- nFallBackCpEnd = nTempCp;
- }
- }
- }
- // not found
- pPieceIter->SetIdx( nOldPos ); // not found
- /*
- If it was not found, then this is because it has fallen between two
- stools, i.e. either it is the last cp/fc of the last piece, or it is
- the last cp/fc of a disjoint piece.
- */
- return nFallBackCpEnd;
- }
- // No complex file
- if (pWw8Fib->fExtChar)
- bIsUnicode=true;
- return ((nFcPos - pWw8Fib->fcMin) / (bIsUnicode ? 2 : 1));
-}
-
-WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode,
- WW8_CP* pNextPieceCp, bool* pTestFlag) const
-{
- if( pTestFlag )
- *pTestFlag = true;
- if( LONG_MAX == nCpPos )
- return LONG_MAX;
-
- bool bIsUnicode;
- if( !pIsUnicode )
- pIsUnicode = &bIsUnicode;
-
- if( pPieceIter )
- { // Complex File
- if( pNextPieceCp )
- *pNextPieceCp = LONG_MAX;
-
- if( !pPieceIter->SeekPos( nCpPos ) )
- {
- if( pTestFlag )
- *pTestFlag = false;
- else
- ASSERT( !this, "Falscher CP an WW8Cp2Fc() uebergeben" );
- return LONG_MAX;
- }
- long nCpStart, nCpEnd;
- void* pData;
- if( !pPieceIter->Get( nCpStart, nCpEnd, pData ) )
- {
- if( pTestFlag )
- *pTestFlag = false;
- else
- ASSERT( !this, "PLCFfpcd-Get ging schief" );
- return LONG_MAX;
- }
- if( pNextPieceCp )
- *pNextPieceCp = nCpEnd;
-
- WW8_FC nRet = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
- if (8 > pWw8Fib->nVersion)
- *pIsUnicode = false;
- else
- nRet = WW8PLCFx_PCD::TransformPieceAddress( nRet, *pIsUnicode );
-
-
- nRet += (nCpPos - nCpStart) * (*pIsUnicode ? 2 : 1);
-
- return nRet;
- }
-
- // No complex file
- if (pWw8Fib->fExtChar)
- *pIsUnicode = true;
- else
- *pIsUnicode = false;
- return pWw8Fib->fcMin + nCpPos * (*pIsUnicode ? 2 : 1);
-}
-
-//-----------------------------------------
-// class WW8ScannerBase
-//-----------------------------------------
-
-WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF )
-{
- if ( ((8 > pWw8Fib->nVersion) && !pWwF->fComplex) || !pWwF->lcbClx )
- return 0;
-
- WW8_FC nClxPos = pWwF->fcClx;
- sal_Int32 nClxLen = pWwF->lcbClx;
- sal_Int32 nLeft = nClxLen;
- sal_Int16 nGrpprl = 0;
- sal_uInt8 clxt;
-
- pStr->Seek( nClxPos );
- while( 1 ) // Zaehle Zahl der Grpprls
- {
- *pStr >> clxt;
- nLeft--;
- if( 2 == clxt ) // PLCFfpcd ?
- break; // PLCFfpcd gefunden
- if( 1 == clxt ) // clxtGrpprl ?
- nGrpprl++;
- sal_uInt16 nLen;
- *pStr >> nLen;
- nLeft -= 2 + nLen;
- if( nLeft < 0 )
- return 0; // schiefgegangen
- pStr->SeekRel( nLen ); // ueberlies grpprl
- }
- pStr->Seek( nClxPos );
- nLeft = nClxLen;
- pPieceGrpprls = new sal_uInt8*[nGrpprl + 1];
- memset( pPieceGrpprls, 0, ( nGrpprl + 1 ) * 4 );
- nPieceGrpprls = nGrpprl;
- sal_Int16 nAktGrpprl = 0; // lies Grpprls ein
- while( 1 )
- {
- *pStr >> clxt;
- nLeft--;
- if( 2 == clxt) // PLCFfpcd ?
- break; // PLCFfpcd gefunden
- sal_uInt16 nLen;
- *pStr >> nLen;
- nLeft -= 2 + nLen;
- if( nLeft < 0 )
- return 0; // schiefgegangen
- if( 1 == clxt ) // clxtGrpprl ?
- {
- sal_uInt8* p = new sal_uInt8[nLen+2]; // alloziere
- ShortToSVBT16(nLen, p); // trage Laenge ein
- pStr->Read( p+2, nLen ); // lies grpprl
- pPieceGrpprls[nAktGrpprl++] = p; // trage in Array ein
- }
- else
- pStr->SeekRel( nLen ); // ueberlies nicht-Grpprl
- }
- // lies Piece Table PLCF ein
- sal_Int32 nPLCFfLen;
- *pStr >> nPLCFfLen;
- ASSERT( 65536 > nPLCFfLen, "PLCFfpcd ueber 64 k" );
- return new WW8PLCFpcd( pStr, pStr->Tell(), nPLCFfLen, 8 );
-}
-
-void WW8ScannerBase::DeletePieceTable()
-{
- if( pPieceGrpprls )
- {
- for( sal_uInt8** p = pPieceGrpprls; *p; p++ )
- delete[] (*p);
- delete[] pPieceGrpprls;
- pPieceGrpprls = 0;
- }
-}
-
-WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTblSt,
- SvStream* pDataSt, const WW8Fib* pWwFib )
- : pWw8Fib(pWwFib), pMainFdoa(0), pHdFtFdoa(0), pMainTxbx(0),
- pMainTxbxBkd(0), pHdFtTxbx(0), pHdFtTxbxBkd(0), pMagicTables(0),
- pPieceGrpprls(0)
-{
- pPiecePLCF = OpenPieceTable( pTblSt, pWw8Fib ); // Complex
- if( pPiecePLCF )
- {
- pPieceIter = new WW8PLCFpcd_Iter( *pPiecePLCF );
- pPLCFx_PCD = new WW8PLCFx_PCD( pWwFib->nVersion, pPiecePLCF, 0,
- 8 > pWw8Fib->nVersion );
- pPLCFx_PCDAttrs = new WW8PLCFx_PCDAttrs( pWwFib->nVersion, pPLCFx_PCD,
- this);
- }
- else
- {
- pPieceIter = 0;
- pPLCFx_PCD = 0;
- pPLCFx_PCDAttrs = 0;
- }
-
- // pChpPLCF and pPapPLCF may NOT be created before pPLCFx_PCD !!
- pChpPLCF = new WW8PLCFx_Cp_FKP( pSt, pTblSt, pDataSt, *this, CHP ); // CHPX
- pPapPLCF = new WW8PLCFx_Cp_FKP( pSt, pTblSt, pDataSt, *this, PAP ); // PAPX
-
- pSepPLCF = new WW8PLCFx_SEPX( pSt, pTblSt, *pWwFib, 0 ); // SEPX
-
- // Footnotes
- pFtnPLCF = new WW8PLCFx_SubDoc( pTblSt, pWwFib->nVersion, 0,
- pWwFib->fcPlcffndRef, pWwFib->lcbPlcffndRef, pWwFib->fcPlcffndTxt,
- pWwFib->lcbPlcffndTxt, 2 );
- // Endnotes
- pEdnPLCF = new WW8PLCFx_SubDoc( pTblSt, pWwFib->nVersion, 0,
- pWwFib->fcPlcfendRef, pWwFib->lcbPlcfendRef, pWwFib->fcPlcfendTxt,
- pWwFib->lcbPlcfendTxt, 2 );
- // Anmerkungen
- pAndPLCF = new WW8PLCFx_SubDoc( pTblSt, pWwFib->nVersion, 0,
- pWwFib->fcPlcfandRef, pWwFib->lcbPlcfandRef, pWwFib->fcPlcfandTxt,
- pWwFib->lcbPlcfandTxt, (8 > pWwFib->nVersion) ? 20 : 30 );
-
- // Fields Main Text
- pFldPLCF = new WW8PLCFx_FLD(pTblSt, *pWwFib, MAN_MAINTEXT);
- // Fields Header / Footer
- pFldHdFtPLCF= new WW8PLCFx_FLD(pTblSt, *pWwFib, MAN_HDFT);
- // Fields Footnote
- pFldFtnPLCF = new WW8PLCFx_FLD(pTblSt, *pWwFib, MAN_FTN);
- // Fields Endnote
- pFldEdnPLCF = new WW8PLCFx_FLD(pTblSt, *pWwFib, MAN_EDN);
- // Fields Anmerkungen
- pFldAndPLCF = new WW8PLCFx_FLD(pTblSt, *pWwFib, MAN_AND);
- // Fields in Textboxes in Main Text
- pFldTxbxPLCF= new WW8PLCFx_FLD(pTblSt, *pWwFib, MAN_TXBX);
- // Fields in Textboxes in Header / Footer
- pFldTxbxHdFtPLCF = new WW8PLCFx_FLD(pTblSt,*pWwFib,MAN_TXBX_HDFT);
-
- // Note: 6 stands for "6 OR 7", 7 stands for "ONLY 7"
- switch( pWw8Fib->nVersion )
- {
- case 6:
- case 7:
- if( pWwFib->fcPlcfdoaMom && pWwFib->lcbPlcfdoaMom )
- {
- pMainFdoa = new WW8PLCFspecial( pTblSt, pWwFib->fcPlcfdoaMom,
- pWwFib->lcbPlcfdoaMom, 6 );
- }
- if( pWwFib->fcPlcfdoaHdr && pWwFib->lcbPlcfdoaHdr )
- {
- pHdFtFdoa = new WW8PLCFspecial( pTblSt, pWwFib->fcPlcfdoaHdr,
- pWwFib->lcbPlcfdoaHdr, 6 );
- }
- break;
- case 8:
- if( pWwFib->fcPlcfspaMom && pWwFib->lcbPlcfspaMom )
- {
- pMainFdoa = new WW8PLCFspecial( pTblSt, pWwFib->fcPlcfspaMom,
- pWwFib->lcbPlcfspaMom, 26 );
- }
- if( pWwFib->fcPlcfspaHdr && pWwFib->lcbPlcfspaHdr )
- {
- pHdFtFdoa = new WW8PLCFspecial( pTblSt, pWwFib->fcPlcfspaHdr,
- pWwFib->lcbPlcfspaHdr, 26 );
- }
- // PLCF fuer TextBox-Break-Deskriptoren im Maintext
- if( pWwFib->fcPlcftxbxBkd && pWwFib->lcbPlcftxbxBkd )
- {
- pMainTxbxBkd = new WW8PLCFspecial( pTblSt,
- pWwFib->fcPlcftxbxBkd, pWwFib->lcbPlcftxbxBkd, 0);
- }
- // PLCF fuer TextBox-Break-Deskriptoren im Header-/Footer-Bereich
- if( pWwFib->fcPlcfHdrtxbxBkd && pWwFib->lcbPlcfHdrtxbxBkd )
- {
- pHdFtTxbxBkd = new WW8PLCFspecial( pTblSt,
- pWwFib->fcPlcfHdrtxbxBkd, pWwFib->lcbPlcfHdrtxbxBkd, 0);
- }
- // Sub table cp positions
- if (pWwFib->fcMagicTable && pWwFib->lcbMagicTable)
- {
- pMagicTables = new WW8PLCFspecial( pTblSt,
- pWwFib->fcMagicTable, pWwFib->lcbMagicTable, 4);
- }
- break;
- default:
- ASSERT( !this, "Es wurde vergessen, nVersion zu kodieren!" );
- break;
- }
-
- // PLCF fuer TextBox-Stories im Maintext
- long nLenTxBxS = (8 > pWw8Fib->nVersion) ? 0 : 22;
- if( pWwFib->fcPlcftxbxTxt && pWwFib->lcbPlcftxbxTxt )
- {
- pMainTxbx = new WW8PLCFspecial( pTblSt, pWwFib->fcPlcftxbxTxt,
- pWwFib->lcbPlcftxbxTxt, nLenTxBxS );
- }
-
- // PLCF fuer TextBox-Stories im Header-/Footer-Bereich
- if( pWwFib->fcPlcfHdrtxbxTxt && pWwFib->lcbPlcfHdrtxbxTxt )
- {
- pHdFtTxbx = new WW8PLCFspecial( pTblSt, pWwFib->fcPlcfHdrtxbxTxt,
- pWwFib->lcbPlcfHdrtxbxTxt, nLenTxBxS );
- }
-
- pBook = new WW8PLCFx_Book(pTblSt, *pWwFib);
-}
-
-WW8ScannerBase::~WW8ScannerBase()
-{
- DeletePieceTable();
- delete pPLCFx_PCDAttrs;
- delete pPLCFx_PCD;
- delete pPieceIter;
- delete pPiecePLCF;
- delete pBook;
- delete pFldEdnPLCF;
- delete pFldFtnPLCF;
- delete pFldAndPLCF;
- delete pFldHdFtPLCF;
- delete pFldPLCF;
- delete pFldTxbxPLCF;
- delete pFldTxbxHdFtPLCF;
- delete pEdnPLCF;
- delete pFtnPLCF;
- delete pAndPLCF;
- delete pSepPLCF;
- delete pPapPLCF;
- delete pChpPLCF;
- // vergessene Schaeflein
- delete pMainFdoa;
- delete pHdFtFdoa;
- delete pMainTxbx;
- delete pMainTxbxBkd;
- delete pHdFtTxbx;
- delete pHdFtTxbxBkd;
- delete pMagicTables;
-}
-
-//-----------------------------------------
-// Fields
-//-----------------------------------------
-static bool WW8SkipField(WW8PLCFspecial& rPLCF)
-{
- void* pData;
- long nP;
-
- if (!rPLCF.Get(nP, pData)) // Ende des PLCFspecial ?
- return false;
-
- rPLCF++;
-
- if((((sal_uInt8*)pData)[0] & 0x1f ) != 0x13 ) // Kein Anfang ?
- return true; // Bei Fehler nicht abbrechen
-
- if( !rPLCF.Get( nP, pData ) )
- return false;
-
-
- while((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13 )
- {
- // immer noch neue (nested) Anfaenge ?
- WW8SkipField( rPLCF ); // nested Field im Beschreibungsteil
- if( !rPLCF.Get( nP, pData ) )
- return false;
- }
-
- if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x14 )
- {
-
- // Field Separator ?
- rPLCF++;
-
- if( !rPLCF.Get( nP, pData ) )
- return false;
-
- while ((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13)
- {
- // immer noch neue (nested) Anfaenge ?
- WW8SkipField( rPLCF ); // nested Field im Resultatteil
- if( !rPLCF.Get( nP, pData ) )
- return false;
- }
- }
- rPLCF++;
-
- return true;
-}
-
-static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
-{
- void* pData;
- sal_uLong nOldIdx = rPLCF.GetIdx();
-
- rF.nLen = rF.nId = rF.nOpt = rF.bCodeNest = rF.bResNest = 0;
-
- if( !rPLCF.Get( rF.nSCode, pData ) ) // Ende des PLCFspecial ?
- goto Err;
-
- rPLCF++;
-
- if((((sal_uInt8*)pData)[0] & 0x1f ) != 0x13 ) // Kein Anfang ?
- goto Err;
-
- rF.nId = ((sal_uInt8*)pData)[1];
-
- if( !rPLCF.Get( rF.nLCode, pData ) )
- goto Err;
-
- rF.nSRes = rF.nLCode; // Default
- rF.nSCode++; // ohne Marken
- rF.nLCode -= rF.nSCode; // Pos zu Laenge
-
- while((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13 )
- {
- // immer noch neue (nested) Anfaenge ?
- WW8SkipField( rPLCF ); // nested Field im Beschreibungsteil
- rF.bCodeNest = true;
- if( !rPLCF.Get( rF.nSRes, pData ) )
- goto Err;
- }
-
- if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x14 ){ // Field Separator ?
- rPLCF++;
-
- if( !rPLCF.Get( rF.nLRes, pData ) )
- goto Err;
-
- while((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13 )
- {
- // immer noch neue (nested) Anfaenge ?
- WW8SkipField( rPLCF ); // nested Field im Resultatteil
- rF.bResNest = true;
- if( !rPLCF.Get( rF.nLRes, pData ) )
- goto Err;
- }
- rF.nLen = rF.nLRes - rF.nSCode + 2; // nLRes ist noch die Endposition
- rF.nLRes -= rF.nSRes; // nun: nLRes = Laenge
- rF.nSRes++; // Endpos encl. Marken
- rF.nLRes--;
-
- }else{
- rF.nLRes = 0; // Kein Result vorhanden
- rF.nLen = rF.nSRes - rF.nSCode + 2; // Gesamtlaenge
- }
-
- rPLCF++;
- if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x15 )
- {
- // Field Ende ?
- // INDEX-Fld hat Bit7 gesetzt!?!
- rF.nOpt = ((sal_uInt8*)pData)[1]; // Ja -> Flags uebernehmen
- }else{
- rF.nId = 0; // Nein -> Feld ungueltig
- }
-
- rPLCF.SetIdx( nOldIdx );
- return true;
-Err:
- rPLCF.SetIdx( nOldIdx );
- return false;
-}
-
-
-//-----------------------------------------
-
-
-// WW8ReadPString liest einen Pascal-String ein und gibt ihn zurueck. Der
-// Pascal- String hat am Ende ein \0, der aber im Laengenbyte nicht
-// mitgezaehlt wird. Der Speicher fuer den Pascalstring wird alloziert.
-String WW8ReadPString(SvStream& rStrm, rtl_TextEncoding eEnc,
- bool bAtEndSeekRel1)
-{
- ByteString aByteStr;
- sal_uInt8 b;
- rStrm >> b;
-
- if (b)
- {
- // Alloc methode automatically sets Zero at the end
- sal_Char* pByteData = aByteStr.AllocBuffer( b );
-
- sal_uLong nWasRead = rStrm.Read( pByteData, b );
- if( nWasRead != b )
- aByteStr.ReleaseBufferAccess(static_cast<xub_StrLen>(nWasRead));
- }
-
- if( bAtEndSeekRel1 )
- rStrm.SeekRel( 1 ); // ueberspringe das Null-Byte am Ende.
-
-
- return String( aByteStr, eEnc );
-}
-
-String WW8Read_xstz(SvStream& rStrm, sal_uInt16 nChars, bool bAtEndSeekRel1)
-{
- sal_uInt16 b;
-
- if( nChars )
- b = nChars;
- else
- rStrm >> b;
-
- String aStr;
- if (b)
- {
- // Alloc methode automatically sets Zero at the end
- sal_Unicode* pData = aStr.AllocBuffer( b );
-
- sal_uLong nWasRead = rStrm.Read( (sal_Char*)pData, b * 2 );
- if( nWasRead != static_cast<sal_uLong>(b*2) )
- {
- b = static_cast<sal_uInt16>(nWasRead / 2);
- aStr.ReleaseBufferAccess( b );
- pData = aStr.GetBufferAccess();
- }
-
-#ifdef OSL_BIGENDIAN
- sal_uLong n;
- sal_Unicode *pWork;
- for( n = 0, pWork = pData; n < b; ++n, ++pWork )
- *pWork = SWAPSHORT( *pWork );
-#endif // ifdef OSL_BIGENDIAN
- }
-
- if( bAtEndSeekRel1 )
- rStrm.SeekRel( 2 ); // ueberspringe das Null-Character am Ende.
-
- return aStr;
-}
-
-static sal_uLong SafeReadString(ByteString &rStr,sal_uInt16 nLen,SvStream &rStrm)
-{
- sal_uLong nWasRead=0;
- if (nLen)
- {
- nWasRead = rStrm.Read( rStr.AllocBuffer( nLen ), nLen);
- if( nWasRead != nLen )
- rStr.ReleaseBufferAccess(static_cast<xub_StrLen>(nWasRead));
- }
- return nWasRead;
-}
-
-sal_uInt16 WW8ScannerBase::WW8ReadString( SvStream& rStrm, String& rStr,
- WW8_CP nAktStartCp, long nTotalLen, rtl_TextEncoding eEnc ) const
-{
- // Klartext einlesen, der sich ueber mehrere Pieces erstrecken kann
- rStr.Erase();
-
- long nTotalRead = 0;
- WW8_CP nBehindTextCp = nAktStartCp + nTotalLen;
- WW8_CP nNextPieceCp = nBehindTextCp; // Initialisierung wichtig fuer Ver6
- do
- {
- bool bIsUnicode, bPosOk;
- WW8_FC fcAct = WW8Cp2Fc(nAktStartCp,&bIsUnicode,&nNextPieceCp,&bPosOk);
-
- // vermutlich uebers Dateiende hinaus gezielt, macht nix!
- if( !bPosOk )
- break;
-
- rStrm.Seek( fcAct );
-
- long nLen = ( (nNextPieceCp < nBehindTextCp) ? nNextPieceCp
- : nBehindTextCp ) - nAktStartCp;
-
- if( 0 >= nLen )
- break;
-
- if( nLen > USHRT_MAX - 1 )
- nLen = USHRT_MAX - 1;
-
- if( bIsUnicode )
- rStr.Append(WW8Read_xstz(rStrm, (sal_uInt16)nLen, false));
- else
- {
- // Alloc method automatically sets Zero at the end
- ByteString aByteStr;
- SafeReadString(aByteStr,(sal_uInt16)nLen,rStrm);
- rStr += String( aByteStr, eEnc );
- }
- nTotalRead += nLen;
- nAktStartCp += nLen;
- if ( nTotalRead != rStr.Len() )
- break;
- }
- while( nTotalRead < nTotalLen );
-
- return rStr.Len();
-}
-
-//-----------------------------------------
-// WW8PLCFspecial
-//-----------------------------------------
-
-// Bei nStartPos < 0 wird das erste Element des PLCFs genommen
-WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, long nFilePos, long nPLCF,
- long nStruct, long nStartPos, bool bNoEnd)
- : nIdx(0), nStru(nStruct)
-{
- nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
- // Pointer auf Pos- u. Struct-Array
- pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ];
-
- long nOldPos = pSt->Tell();
-
- pSt->Seek( nFilePos );
- pSt->Read( pPLCF_PosArray, nPLCF );
-#ifdef OSL_BIGENDIAN
- for( nIdx = 0; nIdx <= nIMax; nIdx++ )
- pPLCF_PosArray[nIdx] = SWAPLONG( pPLCF_PosArray[nIdx] );
- nIdx = 0;
-#endif // OSL_BIGENDIAN
- if( bNoEnd )
- nIMax++;
- if( nStruct ) // Pointer auf Inhalts-Array
- pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
- else
- pPLCF_Contents = 0; // kein Inhalt
- if( nStartPos >= 0 )
- SeekPos( nStartPos );
-
- pSt->Seek( nOldPos );
-}
-
-// WW8PLCFspecial::SeekPos() stellt den WW8PLCFspecial auf die Stelle nPos, wobei auch noch der
-// Eintrag benutzt wird, der vor nPos beginnt und bis hinter nPos reicht.
-// geeignet fuer normale Attribute. Allerdings wird der Attributanfang nicht
-// auf die Position nPos korrigiert.
-bool WW8PLCFspecial::SeekPos(long nP)
-{
- if( nP < pPLCF_PosArray[0] )
- {
- nIdx = 0;
- return false; // Not found: nP unterhalb kleinstem Eintrag
- }
-
- // Search from beginning?
- if( (1 > nIdx) || (nP < pPLCF_PosArray[ nIdx-1 ]) )
- nIdx = 1;
-
- long nI = nIdx ? nIdx : 1;
- long nEnd = nIMax;
-
- for(int n = (1==nIdx ? 1 : 2); n; --n )
- {
- for( ; nI <=nEnd; ++nI)
- { // Suchen mit um 1 erhoehtem Index
- if( nP < pPLCF_PosArray[nI] )
- { // Position gefunden
- nIdx = nI - 1; // nI - 1 ist der richtige Index
- return true; // ... und fertig
- }
- }
- nI = 1;
- nEnd = nIdx-1;
- }
- nIdx = nIMax; // Nicht gefunden, groesser als alle Eintraege
- return false;
-}
-
-// WW8PLCFspecial::SeekPosExact() wie SeekPos(), aber es wird sichergestellt,
-// dass kein Attribut angeschnitten wird, d.h. das naechste gelieferte
-// Attribut beginnt auf oder hinter nPos. Wird benutzt fuer Felder +
-// Bookmarks.
-bool WW8PLCFspecial::SeekPosExact(long nP)
-{
- if( nP < pPLCF_PosArray[0] )
- {
- nIdx = 0;
- return false; // Not found: nP unterhalb kleinstem Eintrag
- }
- // Search from beginning?
- if( nP <=pPLCF_PosArray[nIdx] )
- nIdx = 0;
-
- long nI = nIdx ? nIdx-1 : 0;
- long nEnd = nIMax;
-
- for(int n = (0==nIdx ? 1 : 2); n; --n )
- {
- for( ; nI < nEnd; ++nI)
- {
- if( nP <=pPLCF_PosArray[nI] )
- { // Position gefunden
- nIdx = nI; // nI ist der richtige Index
- return true; // ... und fertig
- }
- }
- nI = 0;
- nEnd = nIdx;
- }
- nIdx = nIMax; // Not found, groesser als alle Eintraege
- return false;
-}
-
-bool WW8PLCFspecial::Get(long& rPos, void*& rpValue) const
-{
- return GetData( nIdx, rPos, rpValue );
-}
-
-bool WW8PLCFspecial::GetData(long nInIdx, long& rPos, void*& rpValue) const
-{
- if ( nInIdx >= nIMax )
- {
- rPos = LONG_MAX;
- return false;
- }
- rPos = pPLCF_PosArray[nInIdx];
- rpValue = pPLCF_Contents ? (void*)&pPLCF_Contents[nInIdx * nStru] : 0;
- return true;
-}
-
-//-----------------------------------------
-// WW8PLCF z.B. fuer SEPX
-//-----------------------------------------
-
-// Ctor fuer *andere* als Fkps
-// Bei nStartPos < 0 wird das erste Element des PLCFs genommen
-WW8PLCF::WW8PLCF( SvStream* pSt, long nFilePos, long nPLCF, long nStruct,
- long nStartPos ) :nIdx( 0 ), nStru( nStruct )
-{
- ASSERT( nPLCF, "WW8PLCF: nPLCF ist Null!" );
-
- nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
-
- ReadPLCF( pSt, nFilePos, nPLCF );
-
- if( nStartPos >= 0 )
- SeekPos( nStartPos );
-}
-
-// Ctor *nur* fuer Fkps
-// Die letzten 2 Parameter sind fuer PLCF.Chpx und PLCF.Papx noetig. ist ncpN
-// != 0, dann wird ein unvollstaendiger PLCF vervollstaendigt. Das ist bei
-// WW6 bei Resourcenmangel und bei WordPad (W95) immer noetig. Bei nStartPos
-// < 0 wird das erste Element des PLCFs genommen
-WW8PLCF::WW8PLCF( SvStream* pSt, long nFilePos, long nPLCF, long nStruct,
- long nStartPos, long nPN, long ncpN ) :nIdx( 0 ), nStru( nStruct )
-{
- nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
-
- if( nIMax >= (long) ncpN )
- ReadPLCF( pSt, nFilePos, nPLCF );
- else
- GeneratePLCF( pSt, nPN, ncpN );
-
- if( nStartPos >= 0 )
- SeekPos( nStartPos );
-}
-
-void WW8PLCF::ReadPLCF( SvStream* pSt, long nFilePos, long nPLCF )
-{
- // Pointer auf Pos-Array
- pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ];
-
- long nOldPos = pSt->Tell();
-
- pSt->Seek( nFilePos );
- pSt->Read( pPLCF_PosArray, nPLCF );
-#ifdef OSL_BIGENDIAN
- for( nIdx = 0; nIdx <= nIMax; nIdx++ )
- pPLCF_PosArray[nIdx] = SWAPLONG( pPLCF_PosArray[nIdx] );
- nIdx = 0;
-#endif // OSL_BIGENDIAN
- // Pointer auf Inhalts-Array
- pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
-
- pSt->Seek( nOldPos );
-}
-
-void WW8PLCF::GeneratePLCF( SvStream* pSt, long nPN, long ncpN )
-{
- ASSERT( nIMax < (long)ncpN, "Pcl.Fkp: Warum ist PLCF zu gross ?" );
- nIMax = ncpN;
- long nSiz = 6 * nIMax + 4;
- pPLCF_PosArray = new sal_Int32[ ( nSiz + 3 ) / 4 ]; // Pointer auf Pos-Array
- memset( pPLCF_PosArray, 0, (size_t)nSiz );
-
- sal_Int32 nFc;
- sal_uInt16 i;
-
- for( i = 0; i < ncpN; i++ ){ // Baue FC-Eintraege
- pSt->Seek( ( nPN + i ) << 9 ); // erster FC-Eintrag jedes Fkp
- *pSt >> nFc;
- pPLCF_PosArray[i] = nFc;
- }
- sal_uLong nLastFkpPos = ( ( nPN + nIMax - 1 ) << 9 );
- pSt->Seek( nLastFkpPos + 511 ); // Anz. Fkp-Eintraege des letzten Fkp
- sal_uInt8 nb;
- *pSt >> nb;
- pSt->Seek( nLastFkpPos + nb * 4 ); // letzer FC-Eintrag des letzten Fkp
- *pSt >> nFc;
- pPLCF_PosArray[nIMax] = nFc; // Ende des letzten Fkp
-
- // Pointer auf Inhalts-Array
- pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
- sal_uInt8* p = pPLCF_Contents;
-
- for( i = 0; i < ncpN; i++ ) // Baue PNs
- {
- ShortToSVBT16(nPN + i, p);
- p+=2;
- }
-}
-
-bool WW8PLCF::SeekPos(long nPos)
-{
- long nP = nPos;
-
- if( nP < pPLCF_PosArray[0] )
- {
- nIdx = 0;
- // Nicht gefunden: nPos unterhalb kleinstem Eintrag
- return false;
- }
-
- // Search from beginning?
- if( (1 > nIdx) || (nP < pPLCF_PosArray[ nIdx-1 ]) )
- nIdx = 1;
-
- long nI = nIdx ? nIdx : 1;
- long nEnd = nIMax;
-
- for(int n = (1==nIdx ? 1 : 2); n; --n )
- {
- for( ; nI <=nEnd; ++nI) // Suchen mit um 1 erhoehtem Index
- {
- if( nP < pPLCF_PosArray[nI] ) // Position gefunden
- {
- nIdx = nI - 1; // nI - 1 ist der richtige Index
- return true; // ... und fertig
- }
- }
- nI = 1;
- nEnd = nIdx-1;
- }
-
- nIdx = nIMax; // Nicht gefunden, groesser als alle Eintraege
- return false;
-}
-
-bool WW8PLCF::Get(long& rStart, long& rEnd, void*& rpValue) const
-{
- if ( nIdx >= nIMax )
- {
- rStart = rEnd = LONG_MAX;
- return false;
- }
- rStart = pPLCF_PosArray[ nIdx ];
- rEnd = pPLCF_PosArray[ nIdx + 1 ];
- rpValue = (void*)&pPLCF_Contents[nIdx * nStru];
- return true;
-}
-
-long WW8PLCF::Where() const
-{
- if ( nIdx >= nIMax )
- return LONG_MAX;
-
- return pPLCF_PosArray[nIdx];
-}
-
-//-----------------------------------------
-// WW8PLCFpcd
-//-----------------------------------------
-
-WW8PLCFpcd::WW8PLCFpcd( SvStream* pSt, long nFilePos, long nPLCF, long nStruct )
- :nStru( nStruct )
-{
- nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
- pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ]; // Pointer auf Pos-Array
-
- long nOldPos = pSt->Tell();
-
- pSt->Seek( nFilePos );
- pSt->Read( pPLCF_PosArray, nPLCF );
-#ifdef OSL_BIGENDIAN
- for( long nI = 0; nI <= nIMax; nI++ )
- pPLCF_PosArray[nI] = SWAPLONG( pPLCF_PosArray[nI] );
-#endif // OSL_BIGENDIAN
-
- // Pointer auf Inhalts-Array
- pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
-
- pSt->Seek( nOldPos );
-}
-
-// Bei nStartPos < 0 wird das erste Element des PLCFs genommen
-WW8PLCFpcd_Iter::WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, long nStartPos )
- :rPLCF( rPLCFpcd ), nIdx( 0 )
-{
- if( nStartPos >= 0 )
- SeekPos( nStartPos );
-}
-
-bool WW8PLCFpcd_Iter::SeekPos(long nPos)
-{
- long nP = nPos;
-
- if( nP < rPLCF.pPLCF_PosArray[0] )
- {
- nIdx = 0;
- return false; // Nicht gefunden: nPos unterhalb kleinstem Eintrag
- }
- // Search from beginning?
- if( (1 > nIdx) || (nP < rPLCF.pPLCF_PosArray[ nIdx-1 ]) )
- nIdx = 1;
-
- long nI = nIdx ? nIdx : 1;
- long nEnd = rPLCF.nIMax;
-
- for(int n = (1==nIdx ? 1 : 2); n; --n )
- {
- for( ; nI <=nEnd; ++nI)
- { // Suchen mit um 1 erhoehtem Index
- if( nP < rPLCF.pPLCF_PosArray[nI] )
- { // Position gefunden
- nIdx = nI - 1; // nI - 1 ist der richtige Index
- return true; // ... und fertig
- }
- }
- nI = 1;
- nEnd = nIdx-1;
- }
- nIdx = rPLCF.nIMax; // Nicht gefunden, groesser als alle Eintraege
- return false;
-}
-
-bool WW8PLCFpcd_Iter::Get(long& rStart, long& rEnd, void*& rpValue) const
-{
- if( nIdx >= rPLCF.nIMax )
- {
- rStart = rEnd = LONG_MAX;
- return false;
- }
- rStart = rPLCF.pPLCF_PosArray[nIdx];
- rEnd = rPLCF.pPLCF_PosArray[nIdx + 1];
- rpValue = (void*)&rPLCF.pPLCF_Contents[nIdx * rPLCF.nStru];
- return true;
-}
-
-long WW8PLCFpcd_Iter::Where() const
-{
- if ( nIdx >= rPLCF.nIMax )
- return LONG_MAX;
-
- return rPLCF.pPLCF_PosArray[nIdx];
-}
-
-//-----------------------------------------
-bool WW8PLCFx_Fc_FKP::WW8Fkp::Entry::operator<
- (const WW8PLCFx_Fc_FKP::WW8Fkp::Entry& rSecond) const
-{
- return (mnFC < rSecond.mnFC);
-}
-
-WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(sal_uInt8 nFibVer, SvStream* pSt, SvStream* pDataSt,
- long _nFilePos, long nItemSiz, ePLCFT ePl, WW8_FC nStartFc)
- : nItemSize(nItemSiz), nFilePos(_nFilePos), nIdx(0), ePLCF(ePl),
- maSprmParser(nFibVer)
-{
- long nOldPos = pSt->Tell();
-
- pSt->Seek(nFilePos);
- pSt->Read(maRawData, 512);
- nIMax = maRawData[511];
-
- sal_uInt8 *pStart = maRawData;
- // Pointer to Offset-Location in maRawData
- sal_uInt8* pOfs = maRawData + (nIMax + 1) * 4;
-
- for (nIdx = 0; nIdx < nIMax; ++nIdx)
- {
- sal_uInt16 nOfs = (*(pOfs + nIdx * nItemSize)) * 2;
- Entry aEntry(Get_Long(pStart));
-
- if (nOfs)
- {
- switch (ePLCF)
- {
- case CHP:
- aEntry.mnLen = maRawData[nOfs];
- aEntry.mpData = maRawData + nOfs + 1;
- break;
- case PAP:
- sal_uInt8 nDelta = 0;
-
- aEntry.mnLen = maRawData[nOfs];
- if (8 <= nFibVer && !aEntry.mnLen)
- {
- aEntry.mnLen = maRawData[ nOfs+1 ];
- nDelta++;
- }
-
- aEntry.mnIStd = SVBT16ToShort(maRawData+nOfs+1+nDelta);
-
- aEntry.mpData = maRawData + nOfs + 3+ nDelta;
-
- sal_uInt16 nSpId = maSprmParser.GetSprmId(aEntry.mpData);
-
- if (0x6645 == nSpId || 0x6646 == nSpId)
- {
- sal_uInt32 nCurr = pDataSt->Tell();
-
- sal_uInt32 nPos = SVBT32ToUInt32(aEntry.mpData + 2);
- pDataSt->Seek(nPos);
- *pDataSt >> aEntry.mnLen;
- aEntry.mpData = new sal_uInt8[aEntry.mnLen];
- aEntry.mbMustDelete = true;
- pDataSt->Read(aEntry.mpData, aEntry.mnLen);
-
- pDataSt->Seek( nCurr );
- }
- else
- {
- aEntry.mnLen *= 2;
- aEntry.mnLen -= 2;
- }
- break;
- }
- }
-
- maEntries.push_back(aEntry);
- }
-
- //one more FC than grrpl entries
- maEntries.push_back(Entry(Get_Long(pStart)));
-
- //#104773#, we expect them sorted, but it appears possible
- //for them to arive unsorted
- std::sort(maEntries.begin(), maEntries.end());
-
- nIdx = 0;
-
- if (nStartFc >= 0)
- SeekPos(nStartFc);
-
- pSt->Seek(nOldPos);
-}
-
-WW8PLCFx_Fc_FKP::WW8Fkp::Entry::Entry(const Entry &rEntry)
- : mnFC(rEntry.mnFC), mnLen(rEntry.mnLen), mnIStd(rEntry.mnIStd),
- mbMustDelete(rEntry.mbMustDelete)
-{
- if (mbMustDelete)
- {
- mpData = new sal_uInt8[mnLen];
- memcpy(mpData, rEntry.mpData, mnLen);
- }
- else
- mpData = rEntry.mpData;
-}
-
-WW8PLCFx_Fc_FKP::WW8Fkp::Entry&
- WW8PLCFx_Fc_FKP::WW8Fkp::Entry::operator=(const Entry &rEntry)
-{
- if (mbMustDelete)
- delete[] mpData;
-
- mnFC = rEntry.mnFC;
- mnLen = rEntry.mnLen;
- mnIStd = rEntry.mnIStd;
- mbMustDelete = rEntry.mbMustDelete;
-
- if (mbMustDelete)
- {
- mpData = new sal_uInt8[mnLen];
- memcpy(mpData, rEntry.mpData, mnLen);
- }
- else
- mpData = rEntry.mpData;
- return *this;
-}
-
-WW8PLCFx_Fc_FKP::WW8Fkp::Entry::~Entry()
-{
- if (mbMustDelete)
- delete[] mpData;
-}
-
-void WW8PLCFx_Fc_FKP::WW8Fkp::Reset(WW8_FC nFc)
-{
- SetIdx(0);
- if (nFc >= 0)
- SeekPos(nFc);
-}
-
-bool WW8PLCFx_Fc_FKP::WW8Fkp::SeekPos(WW8_FC nFc)
-{
- if (nFc < maEntries[0].mnFC)
- {
- nIdx = 0;
- return false; // Nicht gefunden: nPos unterhalb kleinstem Eintrag
- }
- // Search from beginning?
- if( (1 > nIdx) || (nFc < maEntries[nIdx-1].mnFC) )
- nIdx = 1;
-
- long nI = nIdx ? nIdx : 1;
- long nEnd = nIMax;
-
- for(int n = (1==nIdx ? 1 : 2); n; --n )
- {
- for( ; nI <=nEnd; ++nI)
- { // Suchen mit um 1 erhoehtem Index
- if (nFc < maEntries[nI].mnFC)
- { // Position gefunden
- nIdx = nI - 1; // nI - 1 ist der richtige Index
- return true; // ... und fertig
- }
- }
- nI = 1;
- nEnd = nIdx-1;
- }
- nIdx = nIMax; // Nicht gefunden, groesser als alle Eintraege
- return false;
-}
-
-sal_uInt8* WW8PLCFx_Fc_FKP::WW8Fkp::Get( WW8_FC& rStart, WW8_FC& rEnd, long& rLen )
- const
-{
- rLen = 0;
-
- if( nIdx >= nIMax )
- {
- rStart = LONG_MAX;
- return 0;
- }
-
- rStart = maEntries[nIdx].mnFC;
- rEnd = maEntries[nIdx + 1].mnFC;
-
- sal_uInt8* pSprms = GetLenAndIStdAndSprms( rLen );
- return pSprms;
-}
-
-void WW8PLCFx_Fc_FKP::WW8Fkp::SetIdx( sal_uLong nI )
-{
- if( nI < nIMax)
- nIdx = (short)nI;
-}
-
-sal_uInt8* WW8PLCFx_Fc_FKP::WW8Fkp::GetLenAndIStdAndSprms(long& rLen) const
-{
- rLen = maEntries[nIdx].mnLen;
- return maEntries[nIdx].mpData;
-}
-
-const sal_uInt8* WW8PLCFx_Fc_FKP::WW8Fkp::HasSprm( sal_uInt16 nId )
-{
- if( nIdx >= nIMax )
- return 0;
-
- long nLen;
- sal_uInt8* pSprms = GetLenAndIStdAndSprms( nLen );
-
- WW8SprmIter aIter(pSprms, nLen, maSprmParser);
- return aIter.FindSprm(nId);
-}
-
-bool WW8PLCFx_Fc_FKP::WW8Fkp::HasSprm(sal_uInt16 nId,
- std::vector<const sal_uInt8 *> &rResult)
-{
- if (nIdx >= nIMax)
- return false;
-
- long nLen;
- sal_uInt8* pSprms = GetLenAndIStdAndSprms( nLen );
-
- WW8SprmIter aIter(pSprms, nLen, maSprmParser);
-
- while(aIter.GetSprms())
- {
- if (aIter.GetAktId() == nId)
- rResult.push_back(aIter.GetAktParams());
- aIter++;
- };
- return !rResult.empty();
-}
-
-//-----------------------------------------
-void WW8PLCFx::GetSprms( WW8PLCFxDesc* p )
-{
- ASSERT( !this, "Falsches GetSprms gerufen" );
- p->nStartPos = p->nEndPos = LONG_MAX;
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- p->bRealLineEnd = false;
- return;
-}
-
-long WW8PLCFx::GetNoSprms( long& rStart, long& rEnd, long& rLen )
-{
- ASSERT( !this, "Falsches GetNoSprms gerufen" );
- rStart = rEnd = LONG_MAX;
- rLen = 0;
- return 0;
-}
-
-// ...Idx2: Default: ignorieren
-sal_uLong WW8PLCFx::GetIdx2() const
-{
- return 0;
-}
-
-void WW8PLCFx::SetIdx2(sal_uLong )
-{
-}
-
-class SamePos :
- public std::unary_function<const WW8PLCFx_Fc_FKP::WW8Fkp *, bool>
-{
-private:
- long mnPo;
-public:
- SamePos(long nPo) : mnPo(nPo) {};
- bool operator()(const WW8PLCFx_Fc_FKP::WW8Fkp *pFkp)
- {return mnPo == pFkp->GetFilePos();}
-};
-
-//-----------------------------------------
-bool WW8PLCFx_Fc_FKP::NewFkp()
-{
- long nPLCFStart, nPLCFEnd;
- void* pPage;
-
- static const int WW8FkpSizeTabVer6[ PLCF_END ] =
- {
- 1, 7, 0 /*, 0, 0, 0*/
- };
- static const int WW8FkpSizeTabVer8[ PLCF_END ] =
- {
- 1, 13, 0 /*, 0, 0, 0*/
- };
- const int* pFkpSizeTab;
- switch (GetVersion())
- {
- case 6:
- case 7:
- pFkpSizeTab = WW8FkpSizeTabVer6;
- break;
- case 8:
- pFkpSizeTab = WW8FkpSizeTabVer8;
- break;
- default:
- // Programm-Fehler!
- ASSERT( !this, "Es wurde vergessen, nVersion zu kodieren!" );
- return false;
- }
-
- if (!pPLCF->Get( nPLCFStart, nPLCFEnd, pPage ))
- {
- pFkp = 0;
- return false; // PLCF fertig abgearbeitet
- }
- (*pPLCF)++;
- long nPo = SVBT16ToShort( (sal_uInt8 *)pPage );
- nPo <<= 9; // shift als LONG
-
- long nAktFkpFilePos = pFkp ? pFkp->GetFilePos() : -1;
- if (nAktFkpFilePos == nPo)
- pFkp->Reset(GetStartFc()); // #79464# //
- else
- {
- myiter aIter =
- std::find_if(maFkpCache.begin(), maFkpCache.end(), SamePos(nPo));
- if (aIter != maFkpCache.end())
- {
- pFkp = *aIter;
- pFkp->Reset(GetStartFc());
- }
- else if ((pFkp = new WW8Fkp(GetVersion(), pFKPStrm, pDataStrm, nPo,
- pFkpSizeTab[ ePLCF ], ePLCF, GetStartFc())))
- {
- maFkpCache.push_back(pFkp);
-
- if (maFkpCache.size() > eMaxCache)
- {
- delete maFkpCache.front();
- maFkpCache.pop_front();
- }
- }
- }
-
- SetStartFc( -1 ); // Nur das erste Mal
- return true;
-}
-
-WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream* pSt, SvStream* pTblSt,
- SvStream* pDataSt, const WW8Fib& rFib, ePLCFT ePl, WW8_FC nStartFcL)
- : WW8PLCFx(rFib.nVersion, true), pFKPStrm(pSt), pDataStrm(pDataSt),
- pFkp(0), ePLCF(ePl), pPCDAttrs(0)
-{
- SetStartFc(nStartFcL);
- long nLenStruct = (8 > rFib.nVersion) ? 2 : 4;
- if (ePl == CHP)
- {
- pPLCF = new WW8PLCF(pTblSt, rFib.fcPlcfbteChpx, rFib.lcbPlcfbteChpx,
- nLenStruct, GetStartFc(), rFib.pnChpFirst, rFib.cpnBteChp);
- }
- else
- {
- pPLCF = new WW8PLCF(pTblSt, rFib.fcPlcfbtePapx, rFib.lcbPlcfbtePapx,
- nLenStruct, GetStartFc(), rFib.pnPapFirst, rFib.cpnBtePap);
- }
-}
-
-WW8PLCFx_Fc_FKP::~WW8PLCFx_Fc_FKP()
-{
- myiter aEnd = maFkpCache.end();
- for (myiter aIter = maFkpCache.begin(); aIter != aEnd; ++aIter)
- delete *aIter;
- delete pPLCF;
- delete pPCDAttrs;
-}
-
-sal_uLong WW8PLCFx_Fc_FKP::GetIdx() const
-{
- sal_uLong u = pPLCF->GetIdx() << 8;
- if (pFkp)
- u |= pFkp->GetIdx();
- return u;
-}
-
-void WW8PLCFx_Fc_FKP::SetIdx( sal_uLong nIdx )
-{
- if( !( nIdx & 0xffffff00L ) )
- {
- pPLCF->SetIdx( nIdx >> 8 );
- pFkp = 0;
- }
- else
- { //Es gab einen Fkp
- //Lese PLCF um 1 Pos zurueck, um die Adresse des Fkp wiederzubekommen
- pPLCF->SetIdx( ( nIdx >> 8 ) - 1 );
- if ( NewFkp() ) // und lese Fkp wieder ein
- pFkp->SetIdx( nIdx & 0xff ); // Dann stelle Fkp-Pos wieder ein
- }
-}
-
-bool WW8PLCFx_Fc_FKP::SeekPos(WW8_FC nFcPos)
-{
- // StartPos for next Where()
- SetStartFc( nFcPos );
-
- // find StartPos for next pPLCF->Get()
- bool bRet = pPLCF->SeekPos(nFcPos);
-
- // make FKP invalid?
- long nPLCFStart, nPLCFEnd;
- void* pPage;
- if( pFkp && pPLCF->Get( nPLCFStart, nPLCFEnd, pPage ) )
- {
- long nPo = SVBT16ToShort( (sal_uInt8 *)pPage );
- nPo <<= 9; // shift als LONG
- if (nPo != pFkp->GetFilePos())
- pFkp = 0;
- else
- pFkp->SeekPos( nFcPos );
- }
- return bRet;
-}
-
-WW8_FC WW8PLCFx_Fc_FKP::Where()
-{
- if( !pFkp )
- {
- if( !NewFkp() )
- return LONG_MAX;
- }
- WW8_FC nP = pFkp->Where();
- if( nP != LONG_MAX )
- return nP;
-
- pFkp = 0; // FKP beendet -> hole neuen
- return Where(); // am einfachsten rekursiv
-}
-
-sal_uInt8* WW8PLCFx_Fc_FKP::GetSprmsAndPos(WW8_FC& rStart, WW8_FC& rEnd, long& rLen)
-{
- rLen = 0; // Default
- rStart = rEnd = LONG_MAX;
-
- if( !pFkp ) // Fkp not there ?
- {
- if( !NewFkp() )
- return 0;
- }
-
- sal_uInt8* pPos = pFkp->Get( rStart, rEnd, rLen );
- if( rStart == LONG_MAX ) //Not found
- return 0;
- return pPos;
-}
-
-WW8PLCFx& WW8PLCFx_Fc_FKP::operator ++( int )
-{
- if( !pFkp )
- {
- if( !NewFkp() )
- return *this;
- }
-
- (*pFkp)++;
- if( pFkp->Where() == LONG_MAX )
- NewFkp();
-
- return *this;
-}
-
-sal_uInt16 WW8PLCFx_Fc_FKP::GetIstd() const
-{
- return pFkp ? pFkp->GetIstd() : 0xFFFF;
-}
-
-void WW8PLCFx_Fc_FKP::GetPCDSprms( WW8PLCFxDesc& rDesc )
-{
- rDesc.pMemPos = 0;
- rDesc.nSprmsLen = 0;
- if( pPCDAttrs )
- {
- if( !pFkp )
- {
- DBG_WARNING(
- "+Problem: GetPCDSprms: NewFkp necessay (not possible!)" );
- if( !NewFkp() )
- return;
- }
- pPCDAttrs->GetSprms(&rDesc);
- }
-}
-
-const sal_uInt8* WW8PLCFx_Fc_FKP::HasSprm( sal_uInt16 nId )
-{
- // const waere schoener, aber dafuer muesste NewFkp() ersetzt werden oder
- // wegfallen
- if( !pFkp )
- {
- DBG_WARNING( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
- // Passiert bei BugDoc 31722
- if( !NewFkp() )
- return 0;
- }
-
- const sal_uInt8* pRes = pFkp->HasSprm( nId );
-
- if( !pRes )
- {
- WW8PLCFxDesc aDesc;
- GetPCDSprms( aDesc );
-
- if (aDesc.pMemPos)
- {
- WW8SprmIter aIter(aDesc.pMemPos, aDesc.nSprmsLen,
- pFkp->GetSprmParser());
- pRes = aIter.FindSprm(nId);
- }
- }
-
- return pRes;
-}
-
-bool WW8PLCFx_Fc_FKP::HasSprm(sal_uInt16 nId, std::vector<const sal_uInt8 *> &rResult)
-{
- // const waere schoener, aber dafuer muesste NewFkp() ersetzt werden oder
- // wegfallen
- if (!pFkp)
- {
- DBG_WARNING( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
- // Passiert bei BugDoc 31722
- if( !NewFkp() )
- return 0;
- }
-
- pFkp->HasSprm(nId, rResult);
-
- WW8PLCFxDesc aDesc;
- GetPCDSprms( aDesc );
-
- if (aDesc.pMemPos)
- {
- WW8SprmIter aIter(aDesc.pMemPos, aDesc.nSprmsLen,
- pFkp->GetSprmParser());
- while(aIter.GetSprms())
- {
- if (aIter.GetAktId() == nId)
- rResult.push_back(aIter.GetAktParams());
- aIter++;
- };
- }
- return !rResult.empty();
-}
-
-//-----------------------------------------
-
-WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP( SvStream* pSt, SvStream* pTblSt,
- SvStream* pDataSt, const WW8ScannerBase& rBase, ePLCFT ePl )
- : WW8PLCFx_Fc_FKP(pSt, pTblSt, pDataSt, *rBase.pWw8Fib, ePl,
- rBase.WW8Cp2Fc(0)), rSBase(rBase), nAttrStart(-1), nAttrEnd(-1),
- bLineEnd(false),
- bComplex( (7 < rBase.pWw8Fib->nVersion) || (0 != rBase.pWw8Fib->fComplex) )
-{
- ResetAttrStartEnd();
-
- pPcd = rSBase.pPiecePLCF ? new WW8PLCFx_PCD( rBase.pWw8Fib->nVersion,
- rBase.pPiecePLCF, 0, ((6 == GetVersion()) || (7 == GetVersion())) )
- : 0;
-
- /*
- Make a copy of the piece attributes for so that the calls to HasSprm on a
- Fc_FKP will be able to take into account the current piece attributes,
- despite the fact that such attributes can only be found through a cp based
- mechanism.
- */
- if (pPcd)
- {
- pPCDAttrs = rSBase.pPLCFx_PCDAttrs ? new WW8PLCFx_PCDAttrs(
- rSBase.pWw8Fib->nVersion, pPcd, &rSBase) : 0;
- }
-
- pPieceIter = rSBase.pPieceIter;
-}
-
-WW8PLCFx_Cp_FKP::~WW8PLCFx_Cp_FKP()
-{
- delete pPcd;
-}
-
-void WW8PLCFx_Cp_FKP::ResetAttrStartEnd()
-{
- nAttrStart = -1;
- nAttrEnd = -1;
- bLineEnd = false;
-}
-
-sal_uLong WW8PLCFx_Cp_FKP::GetPCDIMax() const
-{
- return pPcd ? pPcd->GetIMax() : 0;
-}
-
-sal_uLong WW8PLCFx_Cp_FKP::GetPCDIdx() const
-{
- return pPcd ? pPcd->GetIdx() : 0;
-}
-
-void WW8PLCFx_Cp_FKP::SetPCDIdx( sal_uLong nIdx )
-{
- if( pPcd )
- pPcd->SetIdx( nIdx );
-}
-
-bool WW8PLCFx_Cp_FKP::SeekPos(WW8_CP nCpPos)
-{
- if( pPcd ) // Complex
- {
- if( !pPcd->SeekPos( nCpPos ) ) // Piece setzen
- return false;
- if (pPCDAttrs && !pPCDAttrs->GetIter()->SeekPos(nCpPos))
- return false;
- return WW8PLCFx_Fc_FKP::SeekPos(pPcd->AktPieceStartCp2Fc(nCpPos));
- }
- // KEINE Piece-Table !!!
- return WW8PLCFx_Fc_FKP::SeekPos( rSBase.WW8Cp2Fc(nCpPos) );
-}
-
-WW8_CP WW8PLCFx_Cp_FKP::Where()
-{
- WW8_FC nFc = WW8PLCFx_Fc_FKP::Where();
- if( pPcd )
- return pPcd->AktPieceStartFc2Cp( nFc ); // Piece ermitteln
- return rSBase.WW8Fc2Cp( nFc ); // KEINE Piece-Table !!!
-}
-
-void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
-{
- WW8_CP nOrigCp = p->nStartPos;
-
- if (!GetDirty()) //Normal case
- {
- p->pMemPos = WW8PLCFx_Fc_FKP::GetSprmsAndPos(p->nStartPos, p->nEndPos,
- p->nSprmsLen);
- }
- else
- {
- /*
- #93702#
- For the odd case where we have a location in a fastsaved file which
- does not have an entry in the FKP, perhaps its para end is in the next
- piece, or perhaps the cp just doesn't exist at all in this document.
- AdvSprm doesn't know so it sets the PLCF as dirty and we figure out
- in this method what the situation is
-
- It doesn't exist then the piece iterator will not be able to find it.
- Otherwise our cool fastsave algorithm can be brought to bear on the
- problem.
- */
- sal_uLong nOldPos = pPieceIter->GetIdx();
- bool bOk = pPieceIter->SeekPos(nOrigCp);
- pPieceIter->SetIdx( nOldPos );
- if (!bOk)
- return;
- }
-
- if( pPcd ) // Piece-Table vorhanden !!!
- {
- // Init ( noch kein ++ gerufen )
- if( (nAttrStart > nAttrEnd) || (nAttrStart == -1) )
- {
- p->bRealLineEnd = (ePLCF == PAP);
-
- if ( ((ePLCF == PAP ) || (ePLCF == CHP)) && (nOrigCp != LONG_MAX) )
- {
- bool bIsUnicode=false;
- /*
- To find the end of a paragraph for a character in a
- complex format file.
-
- It is necessary to know the piece that contains the
- character and the FC assigned to the character.
- */
-
- //We set the piece iterator to the piece that contains the
- //character, now we have the correct piece for this character
- sal_uLong nOldPos = pPieceIter->GetIdx();
- p->nStartPos = nOrigCp;
- pPieceIter->SeekPos( p->nStartPos);
-
- //This is the FC assigned to the character, but we already
- //have the result of the next stage, so we can skip this step
- //WW8_FC nStartFc = rSBase.WW8Cp2Fc(p->nStartPos, &bIsUnicode);
-
- /*
- Using the FC of the character, first search the FKP that
- describes the character to find the smallest FC in the rgfc
- that is larger than the character FC.
- */
- //But the search has already been done, the next largest FC is
- //p->nEndPos.
- WW8_FC nOldEndPos = p->nEndPos;
-
- /*
- If the FC found in the FKP is less than or equal to the limit
- FC of the piece, the end of the paragraph that contains the
- character is at the FKP FC minus 1.
- */
- long nCpStart, nCpEnd;
- void* pData;
- pPieceIter->Get(nCpStart, nCpEnd, pData);
-
- WW8_FC nLimitFC = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
- WW8_FC nBeginLimitFC = nLimitFC;
- if( 8 <= GetVersion() )
- {
- nBeginLimitFC =
- WW8PLCFx_PCD::TransformPieceAddress(nLimitFC,
- bIsUnicode);
- }
- nLimitFC = nBeginLimitFC +
- (nCpEnd - nCpStart) * (bIsUnicode ? 2 : 1);
-
- if (nOldEndPos <= nLimitFC)
- {
- p->nEndPos = nCpEnd -
- (nLimitFC-nOldEndPos) / (bIsUnicode ? 2 : 1);
- }
- else
- {
- if (ePLCF == CHP)
- p->nEndPos = nCpEnd;
- else
- {
- /*
- If the FKP FC that was found was greater than the FC
- of the end of the piece, scan piece by piece toward
- the end of the document until a piece is found that
- contains a paragraph end mark.
- */
-
- /*
- It's possible to check if a piece contains a paragraph
- mark by using the FC of the beginning of the piece to
- search in the FKPs for the smallest FC in the FKP rgfc
- that is greater than the FC of the beginning of the
- piece. If the FC found is less than or equal to the
- limit FC of the piece, then the character that ends
- the paragraph is the character immediately before the
- FKP fc
- */
-
- (*pPieceIter)++;
-
- for (;pPieceIter->GetIdx() < pPieceIter->GetIMax();
- (*pPieceIter)++)
- {
- if( !pPieceIter->Get( nCpStart, nCpEnd, pData ) )
- {
- ASSERT( !this, "piece iter broken!" );
- break;
- }
- bIsUnicode = false;
- sal_Int32 nFcStart=SVBT32ToUInt32(((WW8_PCD*)pData)->fc);
-
- if( 8 <= GetVersion() )
- {
- nFcStart =
- WW8PLCFx_PCD::TransformPieceAddress(
- nFcStart,bIsUnicode );
- }
- nLimitFC = nFcStart + (nCpEnd - nCpStart) *
- (bIsUnicode ? 2 : 1);
-
- //if it doesn't exist, skip it
- if (!SeekPos(nCpStart))
- continue;
-
- WW8_FC nOne,nSmallest;
- p->pMemPos = WW8PLCFx_Fc_FKP::GetSprmsAndPos(nOne,
- nSmallest, p->nSprmsLen);
-
- if (nSmallest <= nLimitFC)
- {
- p->nEndPos = nCpEnd -
- (nLimitFC-nSmallest) / (bIsUnicode ? 2 : 1);
- break;
- }
- }
- }
- }
- pPieceIter->SetIdx( nOldPos );
- }
- else
- pPcd->AktPieceFc2Cp( p->nStartPos, p->nEndPos,&rSBase );
- }
- else
- {
- p->nStartPos = nAttrStart;
- p->nEndPos = nAttrEnd;
- p->bRealLineEnd = bLineEnd;
- }
- }
- else // KEINE Piece-Table !!!
- {
- p->nStartPos = rSBase.WW8Fc2Cp( p->nStartPos );
- p->nEndPos = rSBase.WW8Fc2Cp( p->nEndPos );
- p->bRealLineEnd = ePLCF == PAP;
- }
-}
-
-WW8PLCFx& WW8PLCFx_Cp_FKP::operator ++( int )
-{
- WW8PLCFx_Fc_FKP::operator ++( 0 );
- // !pPcd: Notbremse
- if ( !bComplex || !pPcd )
- return *this;
-
- if( GetPCDIdx() >= GetPCDIMax() ) // End of PLCF
- {
- nAttrStart = nAttrEnd = LONG_MAX;
- return *this;
- }
-
- long nFkpLen; // Fkp-Eintrag
- // Fkp-Eintrag holen
- WW8PLCFx_Fc_FKP::GetSprmsAndPos(nAttrStart, nAttrEnd, nFkpLen);
-
- pPcd->AktPieceFc2Cp( nAttrStart, nAttrEnd, &rSBase );
- bLineEnd = (ePLCF == PAP);
- return *this;
-}
-
-//-----------------------------------------
-//-----------------------------------------
-
-WW8PLCFx_SEPX::WW8PLCFx_SEPX(SvStream* pSt, SvStream* pTblSt,
- const WW8Fib& rFib, WW8_CP nStartCp)
- : WW8PLCFx(rFib.nVersion, true), maSprmParser(rFib.nVersion), pStrm(pSt),
- nArrMax(256), nSprmSiz(0)
-{
- pPLCF = rFib.lcbPlcfsed
- ? new WW8PLCF(pTblSt, rFib.fcPlcfsed, rFib.lcbPlcfsed, 12, nStartCp)
- : 0;
-
- pSprms = new sal_uInt8[nArrMax]; // maximum length
-}
-
-WW8PLCFx_SEPX::~WW8PLCFx_SEPX()
-{
- delete pPLCF;
- delete[] pSprms;
-}
-
-sal_uLong WW8PLCFx_SEPX::GetIdx() const
-{
- return pPLCF ? pPLCF->GetIdx() : 0;
-}
-
-void WW8PLCFx_SEPX::SetIdx( sal_uLong nIdx )
-{
- if( pPLCF ) pPLCF->SetIdx( nIdx );
-}
-
-bool WW8PLCFx_SEPX::SeekPos(WW8_CP nCpPos)
-{
- return pPLCF ? pPLCF->SeekPos( nCpPos ) : 0;
-}
-
-WW8_CP WW8PLCFx_SEPX::Where()
-{
- return pPLCF ? pPLCF->Where() : 0;
-}
-
-void WW8PLCFx_SEPX::GetSprms(WW8PLCFxDesc* p)
-{
- if( !pPLCF ) return;
-
- void* pData;
-
- p->bRealLineEnd = false;
- if (!pPLCF->Get( p->nStartPos, p->nEndPos, pData ))
- {
- p->nStartPos = p->nEndPos = LONG_MAX; // PLCF fertig abgearbeitet
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- }
- else
- {
- long nPo = SVBT32ToUInt32( (sal_uInt8*)pData+2 );
- if (nPo == -1L)
- {
- p->nStartPos = p->nEndPos = LONG_MAX; // Sepx empty
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- }
- else
- {
- pStrm->Seek( nPo );
- *pStrm >> nSprmSiz; // read len
-
- if( nSprmSiz > nArrMax )
- { // passt nicht
- delete[] pSprms;
- nArrMax = nSprmSiz; // Hole mehr Speicher
- pSprms = new sal_uInt8[nArrMax];
- }
- pStrm->Read( pSprms, nSprmSiz ); // read Sprms
-
- p->nSprmsLen = nSprmSiz;
- p->pMemPos = pSprms; // return Position
- }
- }
-}
-
-WW8PLCFx& WW8PLCFx_SEPX::operator ++( int )
-{
- if( pPLCF )
- (*pPLCF)++;
- return *this;
-}
-
-const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId ) const
-{
- return HasSprm( nId, pSprms, nSprmSiz);
-}
-
-const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, const sal_uInt8* pOtherSprms,
- long nOtherSprmSiz ) const
-{
- const sal_uInt8 *pRet = 0;
- if (pPLCF)
- {
- WW8SprmIter aIter(pOtherSprms, nOtherSprmSiz, maSprmParser);
- pRet = aIter.FindSprm(nId);
- }
- return pRet;
-}
-
-bool WW8PLCFx_SEPX::Find4Sprms(sal_uInt16 nId1,sal_uInt16 nId2,sal_uInt16 nId3,sal_uInt16 nId4,
- sal_uInt8*& p1, sal_uInt8*& p2, sal_uInt8*& p3, sal_uInt8*& p4) const
-{
- if( !pPLCF )
- return 0;
-
- bool bFound = false;
- p1 = 0;
- p2 = 0;
- p3 = 0;
- p4 = 0;
-
- sal_uInt8* pSp = pSprms;
- sal_uInt16 i=0;
- while (i + maSprmParser.MinSprmLen() <= nSprmSiz)
- {
- // Sprm gefunden?
- sal_uInt16 nAktId = maSprmParser.GetSprmId(pSp);
- bool bOk = true;
- if( nAktId == nId1 )
- p1 = pSp + maSprmParser.DistanceToData(nId1);
- else if( nAktId == nId2 )
- p2 = pSp + maSprmParser.DistanceToData(nId2);
- else if( nAktId == nId3 )
- p3 = pSp + maSprmParser.DistanceToData(nId3);
- else if( nAktId == nId4 )
- p4 = pSp + maSprmParser.DistanceToData(nId4);
- else
- bOk = false;
- bFound |= bOk;
- // erhoehe Zeiger, so dass er auf naechsten Sprm zeigt
- sal_uInt16 x = maSprmParser.GetSprmSize(nAktId, pSp);
- i += x;
- pSp += x;
- }
- return bFound;
-}
-
-const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const
-{
- if( !pPLCF )
- return 0;
-
- sal_uInt8* pSp = pSprms;
-
- sal_uInt16 i=0;
- while (i + maSprmParser.MinSprmLen() <= nSprmSiz)
- {
- // Sprm gefunden?
- sal_uInt16 nAktId = maSprmParser.GetSprmId(pSp);
- if (nAktId == nId)
- {
- sal_uInt8 *pRet = pSp + maSprmParser.DistanceToData(nId);
- if (*pRet == n2nd)
- return pRet;
- }
- // erhoehe Zeiger, so dass er auf naechsten Sprm zeigt
- sal_uInt16 x = maSprmParser.GetSprmSize(nAktId, pSp);
- i += x;
- pSp += x;
- }
-
- return 0; // Sprm nicht gefunden
-}
-
-//-----------------------------------------
-WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, sal_uInt8 nVersion,
- WW8_CP nStartCp, long nFcRef, long nLenRef, long nFcTxt, long nLenTxt,
- long nStruct)
- : WW8PLCFx(nVersion, false), pRef(0), pTxt(0)
-{
- if( nLenRef && nLenTxt )
- {
- pRef = new WW8PLCF( pSt, nFcRef, nLenRef, nStruct, nStartCp );
- pTxt = new WW8PLCF( pSt, nFcTxt, nLenTxt, 0, nStartCp );
- }
-}
-
-WW8PLCFx_SubDoc::~WW8PLCFx_SubDoc()
-{
- delete pRef;
- delete pTxt;
-}
-
-sal_uLong WW8PLCFx_SubDoc::GetIdx() const
-{
- // Wahrscheinlich pTxt... nicht noetig
- if( pRef )
- return ( pRef->GetIdx() << 16 | pTxt->GetIdx() );
- return 0;
-}
-
-void WW8PLCFx_SubDoc::SetIdx( sal_uLong nIdx )
-{
- if( pRef )
- {
- pRef->SetIdx( nIdx >> 16 );
- // Wahrscheinlich pTxt... nicht noetig
- pTxt->SetIdx( nIdx & 0xFFFF );
- }
-}
-
-bool WW8PLCFx_SubDoc::SeekPos( WW8_CP nCpPos )
-{
- return ( pRef ) ? pRef->SeekPos( nCpPos ) : false;
-}
-
-WW8_CP WW8PLCFx_SubDoc::Where()
-{
- return ( pRef ) ? pRef->Where() : LONG_MAX;
-}
-
-long WW8PLCFx_SubDoc::GetNoSprms( WW8_CP& rStart, long& rEnd, long& rLen )
-{
- void* pData;
- long nSt, nE;
- rEnd = LONG_MAX;
-
- if ( !pRef )
- {
- rStart = LONG_MAX; // Es gibt keine Noten
- rLen = 0;
- return -1;
- }
-
- sal_uLong nNr = pRef->GetIdx();
-
- if (!pRef->Get( rStart, nE, pData ))
- {
- rStart = LONG_MAX; // PLCF fertig abgearbeitet
- rLen = 0;
- return -1;
- }
- pTxt->SetIdx( nNr );
-
- if(!pTxt->Get( nSt, rLen, pData ))
- {
- rStart = LONG_MAX; // PLCF fertig abgearbeitet
- rLen = 0;
- return -1;
- }
-
- rLen -= nSt;
- return nSt;
-}
-
-WW8PLCFx& WW8PLCFx_SubDoc::operator ++( int )
-{
- if( pRef && pTxt )
- {
- (*pRef)++;
- (*pTxt)++;
- }
- return *this;
-}
-
-//-----------------------------------------
-// Felder
-//-----------------------------------------
-
-WW8PLCFx_FLD::WW8PLCFx_FLD( SvStream* pSt, const WW8Fib& rMyFib, short nType)
- : WW8PLCFx(rMyFib.nVersion, true), pPLCF(0), rFib(rMyFib)
-{
- long nFc, nLen;
-
- switch( nType )
- {
- case MAN_HDFT:
- nFc = rFib.fcPlcffldHdr;
- nLen = rFib.lcbPlcffldHdr;
- break;
- case MAN_FTN:
- nFc = rFib.fcPlcffldFtn;
- nLen = rFib.lcbPlcffldFtn;
- break;
- case MAN_EDN:
- nFc = rFib.fcPlcffldEdn;
- nLen = rFib.lcbPlcffldEdn;
- break;
- case MAN_AND:
- nFc = rFib.fcPlcffldAtn;
- nLen = rFib.lcbPlcffldAtn;
- break;
- case MAN_TXBX:
- nFc = rFib.fcPlcffldTxbx;
- nLen = rFib.lcbPlcffldTxbx;
- break;
- case MAN_TXBX_HDFT:
- nFc = rFib.fcPlcffldHdrTxbx;
- nLen = rFib.lcbPlcffldHdrTxbx;
- break;
- default:
- nFc = rFib.fcPlcffldMom;
- nLen = rFib.lcbPlcffldMom;
- break;
- }
-
- if( nLen )
- pPLCF = new WW8PLCFspecial( pSt, nFc, nLen, 2 );
-}
-
-WW8PLCFx_FLD::~WW8PLCFx_FLD()
-{
- delete pPLCF;
-}
-
-sal_uLong WW8PLCFx_FLD::GetIdx() const
-{
- return pPLCF ? pPLCF->GetIdx() : 0;
-}
-
-void WW8PLCFx_FLD::SetIdx( sal_uLong nIdx )
-{
- if( pPLCF )
- pPLCF->SetIdx( nIdx );
-}
-
-bool WW8PLCFx_FLD::SeekPos(WW8_CP nCpPos)
-{
- return pPLCF ? pPLCF->SeekPosExact( nCpPos ) : false;
-}
-
-WW8_CP WW8PLCFx_FLD::Where()
-{
- return pPLCF ? pPLCF->Where() : LONG_MAX;
-}
-
-bool WW8PLCFx_FLD::StartPosIsFieldStart()
-{
- void* pData;
- long nTest;
- if (
- (!pPLCF || !pPLCF->Get(nTest, pData) ||
- ((((sal_uInt8*)pData)[0] & 0x1f) != 0x13))
- )
- return false;
- return true;
-}
-
-bool WW8PLCFx_FLD::EndPosIsFieldEnd()
-{
- bool bRet = false;
-
- if (pPLCF)
- {
- long n = pPLCF->GetIdx();
-
- (*pPLCF)++;
-
- void* pData;
- long nTest;
- if ( pPLCF->Get(nTest, pData) && ((((sal_uInt8*)pData)[0] & 0x1f) == 0x15) )
- bRet = true;
-
- pPLCF->SetIdx(n);
- }
-
- return bRet;
-}
-
-void WW8PLCFx_FLD::GetSprms(WW8PLCFxDesc* p)
-{
- p->nStartPos = p->nEndPos = LONG_MAX;
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- p->bRealLineEnd = false;
-
- if (!pPLCF)
- {
- p->nStartPos = LONG_MAX; // Es gibt keine Felder
- return;
- }
-
- long n = pPLCF->GetIdx();
-
- long nP;
- void *pData;
- if (!pPLCF->Get(nP, pData)) // Ende des PLCFspecial ?
- {
- p->nStartPos = LONG_MAX; // PLCF fertig abgearbeitet
- return;
- }
-
- p->nStartPos = nP;
-
- (*pPLCF)++;
- if (!pPLCF->Get(nP, pData)) // Ende des PLCFspecial ?
- {
- p->nStartPos = LONG_MAX; // PLCF fertig abgearbeitet
- return;
- }
-
- p->nEndPos = nP;
-
- pPLCF->SetIdx(n);
-
- p->nCp2OrIdx = pPLCF->GetIdx();
-}
-
-WW8PLCFx& WW8PLCFx_FLD::operator ++( int )
-{
- (*pPLCF)++;
- return *this;
-}
-
-bool WW8PLCFx_FLD::GetPara(long nIdx, WW8FieldDesc& rF)
-{
- ASSERT( pPLCF, "Aufruf ohne Feld PLCFspecial" );
- if( !pPLCF )
- return false;
-
- long n = pPLCF->GetIdx();
- pPLCF->SetIdx(nIdx);
-
- bool bOk = WW8GetFieldPara(*pPLCF, rF);
-
- pPLCF->SetIdx(n);
- return bOk;
-}
-
-//-----------------------------------------
-// class WW8PLCF_Book
-//-----------------------------------------
-
-/* to be optimized like this: */
-void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen,
- sal_uInt16 nExtraLen, rtl_TextEncoding eCS, std::vector<String> &rArray,
- std::vector<String>* pExtraArray)
-{
- sal_uLong nOldPos = rStrm.Tell();
- rStrm.Seek( nStart );
-
- sal_uInt16 nLen2;
- rStrm >> nLen2; // bVer67: total length of structure
- // bVer8 : count of strings
-
- if( bVer8 )
- {
- sal_uInt16 nStrings;
- bool bUnicode = (0xFFFF == nLen2);
- if( bUnicode )
- rStrm >> nStrings;
- else
- nStrings = nLen2;
-
- rStrm >> nExtraLen;
-
- for( sal_uInt16 i=0; i < nStrings; i++ )
- {
- if( bUnicode )
- rArray.push_back(WW8Read_xstz(rStrm, 0, false));
- else
- {
- sal_uInt8 nBChar;
- rStrm >> nBChar;
- ByteString aTmp;
- SafeReadString(aTmp,nBChar,rStrm);
- rArray.push_back(String(aTmp, eCS));
- }
-
- // Skip the extra data
- if( nExtraLen )
- {
- if (pExtraArray)
- {
- ByteString aTmp;
- SafeReadString(aTmp,nExtraLen,rStrm);
- pExtraArray->push_back(String(aTmp, eCS));
- }
- else
- rStrm.SeekRel( nExtraLen );
- }
- }
- }
- else
- {
- sal_uInt8 nBChar;
- if( nLen2 != nLen )
- {
- ASSERT( nLen2 == nLen, "Fib length and read length are different" );
- if (nLen > USHRT_MAX)
- nLen = USHRT_MAX;
- else if (nLen < 2 )
- nLen = 2;
- nLen2 = static_cast<sal_uInt16>(nLen);
- }
- sal_uLong nRead = 0;
- for( nLen2 -= 2; nRead < nLen2; )
- {
- rStrm >> nBChar; ++nRead;
- if (nBChar)
- {
- ByteString aTmp;
- nRead += SafeReadString(aTmp,nBChar,rStrm);
- rArray.push_back(String(aTmp, eCS));
- }
- else
- rArray.push_back(aEmptyStr);
-
- // #89125# Skip the extra data (for bVer67 versions this must come
- // from external knowledge)
- if (nExtraLen)
- {
- if (pExtraArray)
- {
- ByteString aTmp;
- SafeReadString(aTmp,nExtraLen,rStrm);
- pExtraArray->push_back(String(aTmp, eCS));
- }
- else
- rStrm.SeekRel( nExtraLen );
- nRead+=nExtraLen;
- }
- }
- }
- rStrm.Seek( nOldPos );
-}
-
-WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTblSt, const WW8Fib& rFib)
- : WW8PLCFx(rFib.nVersion, false), pStatus(0), nIsEnd(0)
-{
- if( !rFib.fcPlcfbkf || !rFib.lcbPlcfbkf || !rFib.fcPlcfbkl ||
- !rFib.lcbPlcfbkl || !rFib.fcSttbfbkmk || !rFib.lcbSttbfbkmk )
- {
- pBook[0] = pBook[1] = 0;
- nIMax = 0;
- }
- else
- {
- pBook[0] = new WW8PLCFspecial(pTblSt,rFib.fcPlcfbkf,rFib.lcbPlcfbkf,4);
-
- pBook[1] = new WW8PLCFspecial( pTblSt, rFib.fcPlcfbkl, rFib.lcbPlcfbkl,
- 0, -1, true);
-
- rtl_TextEncoding eStructChrSet = WW8Fib::GetFIBCharset(rFib.chseTables);
-
- WW8ReadSTTBF( (7 < rFib.nVersion), *pTblSt, rFib.fcSttbfbkmk,
- rFib.lcbSttbfbkmk, 0, eStructChrSet, aBookNames );
-
- nIMax = aBookNames.size();
-
- if( pBook[0]->GetIMax() < nIMax ) // Count of Bookmarks
- nIMax = pBook[0]->GetIMax();
- if( pBook[1]->GetIMax() < nIMax )
- nIMax = pBook[1]->GetIMax();
- pStatus = new eBookStatus[ nIMax ];
- memset( pStatus, 0, nIMax * sizeof( eBookStatus ) );
- }
-}
-
-WW8PLCFx_Book::~WW8PLCFx_Book()
-{
- delete[] pStatus;
- delete pBook[1];
- delete pBook[0];
-}
-
-sal_uLong WW8PLCFx_Book::GetIdx() const
-{
- return nIMax ? pBook[0]->GetIdx() : 0;
-}
-
-void WW8PLCFx_Book::SetIdx( sal_uLong nI )
-{
- if( nIMax )
- pBook[0]->SetIdx( nI );
-}
-
-sal_uLong WW8PLCFx_Book::GetIdx2() const
-{
- return nIMax ? ( pBook[1]->GetIdx() | ( ( nIsEnd ) ? 0x80000000 : 0 ) ) : 0;
-}
-
-void WW8PLCFx_Book::SetIdx2( sal_uLong nI )
-{
- if( nIMax )
- {
- pBook[1]->SetIdx( nI & 0x7fffffff );
- nIsEnd = (sal_uInt16)( ( nI >> 31 ) & 1 ); // 0 oder 1
- }
-}
-
-bool WW8PLCFx_Book::SeekPos(WW8_CP nCpPos)
-{
- if( !pBook[0] )
- return false;
-
- bool bOk = pBook[0]->SeekPosExact( nCpPos );
- bOk &= pBook[1]->SeekPosExact( nCpPos );
- nIsEnd = 0;
-
- return bOk;
-}
-
-WW8_CP WW8PLCFx_Book::Where()
-{
- return pBook[nIsEnd]->Where();
-}
-
-long WW8PLCFx_Book::GetNoSprms( long& rStart, long& rEnd, long& rLen )
-{
- void* pData;
- rEnd = LONG_MAX;
- rLen = 0;
-
- if (!pBook[0] || !pBook[1] || !nIMax || (pBook[nIsEnd]->GetIdx()) >= nIMax)
- {
- rStart = rEnd = LONG_MAX;
- return -1;
- }
-
- pBook[nIsEnd]->Get( rStart, pData ); // Pos. abfragen
-
- return pBook[nIsEnd]->GetIdx();
-}
-
-// Der Operator ++ hat eine Tuecke: Wenn 2 Bookmarks aneinandergrenzen, dann
-// sollte erst das Ende des ersten und dann der Anfang des 2. erreicht werden.
-// Liegen jedoch 2 Bookmarks der Laenge 0 aufeinander, *muss* von jedem Bookmark
-// erst der Anfang und dann das Ende gefunden werden.
-// Der Fall: ][
-// [...]
-// ][
-// ist noch nicht geloest, dabei muesste ich in den Anfangs- und Endindices
-// vor- und zurueckspringen, wobei ein weiterer Index oder ein Bitfeld
-// oder etwas aehnliches zum Merken der bereits abgearbeiteten Bookmarks
-// noetig wird.
-WW8PLCFx& WW8PLCFx_Book::operator ++( int )
-{
- if( pBook[0] && pBook[1] && nIMax )
- {
- (*pBook[nIsEnd])++;
-
- sal_uLong l0 = pBook[0]->Where();
- sal_uLong l1 = pBook[1]->Where();
- if( l0 < l1 )
- nIsEnd = 0;
- else if( l1 < l0 )
- nIsEnd = 1;
- else
- nIsEnd = ( nIsEnd ) ? 0 : 1;
- }
- return *this;
-}
-
-long WW8PLCFx_Book::GetLen() const
-{
- if( nIsEnd )
- {
- ASSERT( !this, "Falscher Aufruf (1) von PLCF_Book::GetLen()" );
- return 0;
- }
- void * p;
- WW8_CP nStartPos;
- if( !pBook[0]->Get( nStartPos, p ) )
- {
- ASSERT( !this, "Falscher Aufruf (2) von PLCF_Book::GetLen()" );
- return 0;
- }
- sal_uInt16 nEndIdx = SVBT16ToShort( *((SVBT16*)p) );
- long nNum = pBook[1]->GetPos( nEndIdx );
- nNum -= nStartPos;
- return nNum;
-}
-
-void WW8PLCFx_Book::SetStatus(sal_uInt16 nIndex, eBookStatus eStat )
-{
- ASSERT(nIndex < nIMax, "set status of non existing bookmark!");
- pStatus[nIndex] = (eBookStatus)( pStatus[nIndex] | eStat );
-}
-
-eBookStatus WW8PLCFx_Book::GetStatus() const
-{
- if( !pStatus )
- return BOOK_NORMAL;
- long nEndIdx = GetHandle();
- return ( nEndIdx < nIMax ) ? pStatus[nEndIdx] : BOOK_NORMAL;
-}
-
-long WW8PLCFx_Book::GetHandle() const
-{
- if( !pBook[0] || !pBook[1] )
- return LONG_MAX;
-
- if( nIsEnd )
- return pBook[1]->GetIdx();
- else
- {
- if (const void* p = pBook[0]->GetData(pBook[0]->GetIdx()))
- return SVBT16ToShort( *((SVBT16*)p) );
- else
- return LONG_MAX;
- }
-}
-
-String WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex)
-{
- bool bFound = false;
- sal_uInt16 i = 0;
- if( pBook[0] && pBook[1] )
- {
- WW8_CP nStartAkt, nEndAkt;
- do
- {
- void* p;
- sal_uInt16 nEndIdx;
-
- if( pBook[0]->GetData( i, nStartAkt, p ) && p )
- nEndIdx = SVBT16ToShort( *((SVBT16*)p) );
- else
- {
- ASSERT( !this, "Bookmark-EndIdx nicht lesbar" );
- nEndIdx = i;
- }
-
- nEndAkt = pBook[1]->GetPos( nEndIdx );
-
- if ((nStartAkt >= nStart) && (nEndAkt <= nEnd))
- {
- nIndex = i;
- bFound=true;
- break;
- }
- ++i;
- }
- while (i < pBook[0]->GetIMax());
- }
- return bFound ? aBookNames[i] : aEmptyStr;
-}
-
-bool WW8PLCFx_Book::MapName(String& rName)
-{
- if( !pBook[0] || !pBook[1] )
- return false;
-
- bool bFound = false;
- sal_uInt16 i = 0;
- WW8_CP nStartAkt, nEndAkt;
- do
- {
- void* p;
- sal_uInt16 nEndIdx;
-
- if( pBook[0]->GetData( i, nStartAkt, p ) && p )
- nEndIdx = SVBT16ToShort( *((SVBT16*)p) );
- else
- {
- ASSERT( !this, "Bookmark-EndIdx nicht lesbar" );
- nEndIdx = i;
- }
- nEndAkt = pBook[1]->GetPos( nEndIdx );
- if (COMPARE_EQUAL == rName.CompareIgnoreCaseToAscii(aBookNames[i]))
- {
- rName = aBookNames[i];
- bFound = true;
- }
- ++i;
- }
- while (!bFound && i < pBook[0]->GetIMax());
- return bFound;
-}
-
-const String* WW8PLCFx_Book::GetName() const
-{
- const String *pRet = 0;
- if (!nIsEnd && (pBook[0]->GetIdx() < nIMax))
- pRet = &(aBookNames[pBook[0]->GetIdx()]);
- return pRet;
-}
-
-//-----------------------------------------
-// WW8PLCFMan
-//-----------------------------------------
-
-#ifndef DUMP
-
-// Am Ende eines Absatzes reichen bei WW6 die Attribute bis hinter das <CR>.
-// Das wird fuer die Verwendung mit dem SW um 1 Zeichen zurueckgesetzt, wenn
-// dadurch kein AErger zu erwarten ist.
-void WW8PLCFMan::AdjustEnds( WW8PLCFxDesc& rDesc )
-{
- //Store old end position for supercool new property finder that uses
- //cp instead of fc's as nature intended
- rDesc.nOrigEndPos = rDesc.nEndPos;
- rDesc.nOrigStartPos = rDesc.nStartPos;
-
- /*
- Normally given ^XXX{para end}^ we don't actually insert a para end
- character into the document, so we clip the para end property one to the
- left to make the para properties end when the paragraph text does. In a
- drawing textbox we actually do insert a para end character, so we don't
- clip it. Making the para end properties end after the para end char.
- */
- if (GetDoingDrawTextBox())
- return;
-
- if ( (&rDesc == pPap) && rDesc.bRealLineEnd )
- {
- if ( pPap->nEndPos != LONG_MAX ) // Para adjust
- {
- nLineEnd = pPap->nEndPos;// nLineEnd zeigt *hinter* das <CR>
- pPap->nEndPos--; // Absatzende um 1 Zeichen verkuerzen
-
- // gibt es bereits ein CharAttr-Ende das auf das jetzige
- // Absatzende zeigt ? ... dann auch um 1 Zeichen verkuerzen
- if (pChp->nEndPos == nLineEnd)
- pChp->nEndPos--;
-
- // gibt es bereits ein Sep-Ende, das auf das jetzige Absatzende
- // zeigt ? ... dann auch um 1 Zeichen verkuerzen
- if( pSep->nEndPos == nLineEnd )
- pSep->nEndPos--;
- }
- }
- else if ( (&rDesc == pChp) || (&rDesc == pSep) )
- {
- // Char Adjust oder Sep Adjust Wenn Ende Char-Attr == Absatzende ...
- if( (rDesc.nEndPos == nLineEnd) && (rDesc.nEndPos > rDesc.nStartPos) )
- rDesc.nEndPos--; // ... dann um 1 Zeichen verkuerzen
- }
-}
-
-void WW8PLCFxDesc::ReduceByOffset()
-{
- ASSERT((LONG_MAX == nStartPos) || (nStartPos <= nEndPos),
- "Attr-Anfang und -Ende ueber Kreuz" );
-
- if( nStartPos != LONG_MAX )
- {
- /*
- ##516##,##517##
- Force the property change to happen at the beginning of this
- subdocument, same as in GetNewNoSprms, except that the target type is
- attributes attached to a piece that might span subdocument boundaries
- */
- if (nCpOfs > nStartPos)
- nStartPos = 0;
- else
- nStartPos -= nCpOfs;
- }
- if( nEndPos != LONG_MAX )
- {
- ASSERT(nCpOfs <= nEndPos,
- "oh oh, so much for the subdocument piece theory");
- nEndPos -= nCpOfs;
- }
-}
-
-void WW8PLCFMan::GetNewSprms( WW8PLCFxDesc& rDesc )
-{
- rDesc.pPLCFx->GetSprms(&rDesc);
- rDesc.ReduceByOffset();
-
- rDesc.bFirstSprm = true;
- AdjustEnds( rDesc );
- rDesc.nOrigSprmsLen = rDesc.nSprmsLen;
-}
-
-void WW8PLCFMan::GetNewNoSprms( WW8PLCFxDesc& rDesc )
-{
- rDesc.nCp2OrIdx = rDesc.pPLCFx->GetNoSprms(rDesc.nStartPos, rDesc.nEndPos,
- rDesc.nSprmsLen);
-
- ASSERT((LONG_MAX == rDesc.nStartPos) || (rDesc.nStartPos <= rDesc.nEndPos),
- "Attr-Anfang und -Ende ueber Kreuz" );
-
- rDesc.ReduceByOffset();
-
- rDesc.bFirstSprm = true;
- rDesc.nOrigSprmsLen = rDesc.nSprmsLen;
-}
-
-sal_uInt16 WW8PLCFMan::GetId(const WW8PLCFxDesc* p) const
-{
- sal_uInt16 nId;
-
- if (p == pFld)
- nId = eFLD;
- else if (p->nSprmsLen > 0)
- nId = maSprmParser.GetSprmId(p->pMemPos);
- else
- nId = 0; // Id = 0 for empty attributes
-
- return nId;
-}
-
-WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, short nType, long nStartCp,
- bool bDoingDrawTextBox)
- : maSprmParser(pBase->pWw8Fib->nVersion),
- mbDoingDrawTextBox(bDoingDrawTextBox)
-{
- pWwFib = pBase->pWw8Fib;
-
- nLastWhereIdxCp = 0;
- memset( aD, 0, sizeof( aD ) );
- nLineEnd = LONG_MAX;
- nManType = nType;
- sal_uInt16 i;
-
- if( MAN_MAINTEXT == nType )
- {
- // Suchreihenfolge der Attribute
- nPLCF = MAN_ANZ_PLCF;
- pFld = &aD[0];
- pBkm = &aD[1];
- pEdn = &aD[2];
- pFtn = &aD[3];
- pAnd = &aD[4];
-
- pPcd = ( pBase->pPLCFx_PCD ) ? &aD[5] : 0;
- //pPcdA index == pPcd index + 1
- pPcdA = ( pBase->pPLCFx_PCDAttrs ) ? &aD[6] : 0;
-
- pChp = &aD[7];
- pPap = &aD[8];
- pSep = &aD[9];
-
- pSep->pPLCFx = pBase->pSepPLCF;
- pFtn->pPLCFx = pBase->pFtnPLCF;
- pEdn->pPLCFx = pBase->pEdnPLCF;
- pBkm->pPLCFx = pBase->pBook;
- pAnd->pPLCFx = pBase->pAndPLCF;
-
- }
- else
- {
- // Suchreihenfolge der Attribute
- nPLCF = 7;
- pFld = &aD[0];
- pBkm = ( pBase->pBook ) ? &aD[1] : 0;
-
- pPcd = ( pBase->pPLCFx_PCD ) ? &aD[2] : 0;
- //pPcdA index == pPcd index + 1
- pPcdA= ( pBase->pPLCFx_PCDAttrs ) ? &aD[3] : 0;
-
- pChp = &aD[4];
- pPap = &aD[5];
- pSep = &aD[6]; // Dummy
-
- pAnd = pFtn = pEdn = 0; // unbenutzt bei SpezText
- }
-
- pChp->pPLCFx = pBase->pChpPLCF;
- pPap->pPLCFx = pBase->pPapPLCF;
- if( pPcd )
- pPcd->pPLCFx = pBase->pPLCFx_PCD;
- if( pPcdA )
- pPcdA->pPLCFx= pBase->pPLCFx_PCDAttrs;
- if( pBkm )
- pBkm->pPLCFx = pBase->pBook;
-
- pMagicTables = pBase->pMagicTables;
-
- switch( nType ) // Feld-Initialisierung
- {
- case MAN_HDFT:
- pFld->pPLCFx = pBase->pFldHdFtPLCF;
- nCpO = pWwFib->ccpText + pWwFib->ccpFtn;
- pFdoa = pBase->pHdFtFdoa;
- pTxbx = pBase->pHdFtTxbx;
- pTxbxBkd = pBase->pHdFtTxbxBkd;
- break;
- case MAN_FTN:
- pFld->pPLCFx = pBase->pFldFtnPLCF;
- nCpO = pWwFib->ccpText;
- pFdoa = pTxbx = pTxbxBkd = 0;
- break;
- case MAN_EDN:
- pFld->pPLCFx = pBase->pFldEdnPLCF;
- nCpO = pWwFib->ccpText + pWwFib->ccpFtn + pWwFib->ccpHdr +
- pWwFib->ccpAtn;
- pFdoa = pTxbx = pTxbxBkd = 0;
- break;
- case MAN_AND:
- pFld->pPLCFx = pBase->pFldAndPLCF;
- nCpO = pWwFib->ccpText + pWwFib->ccpFtn + pWwFib->ccpHdr;
- pFdoa = pTxbx = pTxbxBkd = 0;
- break;
- case MAN_TXBX:
- pFld->pPLCFx = pBase->pFldTxbxPLCF;
- nCpO = pWwFib->ccpText + pWwFib->ccpFtn + pWwFib->ccpHdr +
- pWwFib->ccpMcr + pWwFib->ccpAtn + pWwFib->ccpEdn;
- pTxbx = pBase->pMainTxbx;
- pTxbxBkd = pBase->pMainTxbxBkd;
- pFdoa = 0;
- break;
- case MAN_TXBX_HDFT:
- pFld->pPLCFx = pBase->pFldTxbxHdFtPLCF;
- nCpO = pWwFib->ccpText + pWwFib->ccpFtn + pWwFib->ccpHdr +
- pWwFib->ccpMcr + pWwFib->ccpAtn + pWwFib->ccpEdn +
- pWwFib->ccpTxbx;
- pTxbx = pBase->pHdFtTxbx;
- pTxbxBkd = pBase->pHdFtTxbxBkd;
- pFdoa = 0;
- break;
- default:
- pFld->pPLCFx = pBase->pFldPLCF;
- nCpO = 0;
- pFdoa = pBase->pMainFdoa;
- pTxbx = pBase->pMainTxbx;
- pTxbxBkd = pBase->pMainTxbxBkd;
- break;
- }
-
- if( nStartCp || nCpO )
- SeekPos( nStartCp ); // PLCFe auf Text-StartPos einstellen
-
- // initialisieren der Member-Vars Low-Level
- GetChpPLCF()->ResetAttrStartEnd();
- GetPapPLCF()->ResetAttrStartEnd();
- for( i=0; i < nPLCF; i++)
- {
- WW8PLCFxDesc* p = &aD[i];
-
- /*
- ##516##,##517##
- For subdocuments we modify the cp of properties to be relative to
- the beginning of subdocuments, we should also do the same for
- piecetable changes, and piecetable properties, otherwise a piece
- change that happens in a subdocument is lost.
- */
- p->nCpOfs = ( p == pChp || p == pPap || p == pBkm || p == pPcd ||
- p == pPcdA ) ? nCpO : 0;
-
- p->nCp2OrIdx = 0;
- p->bFirstSprm = false;
- p->pIdStk = 0;
-
- if ((p == pChp) || (p == pPap))
- p->nStartPos = p->nEndPos = nStartCp;
- else
- p->nStartPos = p->nEndPos = LONG_MAX;
- }
-
- // initialisieren der Member-Vars High-Level
- for( i=0; i<nPLCF; i++){
- WW8PLCFxDesc* p = &aD[i];
-
- if( !p->pPLCFx )
- {
- p->nStartPos = p->nEndPos = LONG_MAX;
- continue;
- }
-
- if( p->pPLCFx->IsSprm() )
- {
- // Vorsicht: nEndPos muss bereits
- p->pIdStk = new std::stack<sal_uInt16>;
- if ((p == pChp) || (p == pPap))
- {
- WW8_CP nTemp = p->nEndPos+p->nCpOfs;
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- p->nStartPos = nTemp;
- if (!(*p->pPLCFx).SeekPos(p->nStartPos))
- p->nEndPos = p->nStartPos = LONG_MAX;
- else
- GetNewSprms( *p );
- }
- else
- GetNewSprms( *p ); // bei allen PLCFen initialisiert sein
- }
- else if( p->pPLCFx )
- GetNewNoSprms( *p );
- }
-}
-
-WW8PLCFMan::~WW8PLCFMan()
-{
- for( sal_uInt16 i=0; i<nPLCF; i++)
- delete aD[i].pIdStk;
-}
-
-// 0. welche Attr.-Klasse,
-// 1. ob ein Attr.-Start ist,
-// 2. CP, wo ist naechste Attr.-Aenderung
-sal_uInt16 WW8PLCFMan::WhereIdx(bool* pbStart, long* pPos) const
-{
- ASSERT(nPLCF,"What the hell");
- long nNext = LONG_MAX; // SuchReihenfolge:
- sal_uInt16 nNextIdx = nPLCF;// first ending found ( CHP, PAP, ( SEP ) ),
- bool bStart = true; // dann Anfaenge finden ( ( SEP ), PAP, CHP )
- sal_uInt16 i;
- const WW8PLCFxDesc* pD;
- for (i=0; i < nPLCF; i++)
- {
- pD = &aD[i];
- if (pD != pPcdA)
- {
- if( (pD->nEndPos < nNext) && (pD->nStartPos == LONG_MAX) )
- {
- // sonst ist Anfang = Ende
- nNext = pD->nEndPos;
- nNextIdx = i;
- bStart = false;
- }
- }
- }
- for (i=nPLCF; i > 0; i--)
- {
- pD = &aD[i-1];
- if (pD != pPcdA)
- {
- if( pD->nStartPos < nNext )
- {
- nNext = pD->nStartPos;
- nNextIdx = i-1;
- bStart = true;
- }
- }
- }
- if( pPos )
- *pPos = nNext;
- if( pbStart )
- *pbStart = bStart;
- return nNextIdx;
-}
-
-// gibt die CP-Pos der naechsten Attribut-Aenderung zurueck
-WW8_CP WW8PLCFMan::Where() const
-{
- long l;
- WhereIdx(0, &l);
- return l;
-}
-
-void WW8PLCFMan::SeekPos( long nNewCp )
-{
- pChp->pPLCFx->SeekPos( nNewCp + nCpO ); // Attribute neu
- pPap->pPLCFx->SeekPos( nNewCp + nCpO ); // aufsetzen
- pFld->pPLCFx->SeekPos( nNewCp );
- if( pPcd )
- pPcd->pPLCFx->SeekPos( nNewCp + nCpO );
- if( pBkm )
- pBkm->pPLCFx->SeekPos( nNewCp + nCpO );
-}
-
-void WW8PLCFMan::SaveAllPLCFx( WW8PLCFxSaveAll& rSave ) const
-{
- sal_uInt16 i, n=0;
- if( pPcd )
- pPcd->Save( rSave.aS[n++] );
- if( pPcdA )
- pPcdA->Save( rSave.aS[n++] );
-
- for(i=0; i<nPLCF; ++i)
- if( pPcd != &aD[i] && pPcdA != &aD[i] )
- aD[i].Save( rSave.aS[n++] );
-}
-
-void WW8PLCFMan::RestoreAllPLCFx( const WW8PLCFxSaveAll& rSave )
-{
- sal_uInt16 i, n=0;
- if( pPcd )
- pPcd->Restore( rSave.aS[n++] );
- if( pPcdA )
- pPcdA->Restore( rSave.aS[n++] );
-
- for(i=0; i<nPLCF; ++i)
- if( pPcd != &aD[i] && pPcdA != &aD[i] )
- aD[i].Restore( rSave.aS[n++] );
-}
-
-void WW8PLCFMan::GetSprmStart( short nIdx, WW8PLCFManResult* pRes ) const
-{
- memset( pRes, 0, sizeof( WW8PLCFManResult ) );
-
- // Pruefen !!!
-
- pRes->nMemLen = 0;
-
- const WW8PLCFxDesc* p = &aD[nIdx];
-
- // first Sprm in a Group
- if( p->bFirstSprm )
- {
- if( p == pPap )
- pRes->nFlags |= MAN_MASK_NEW_PAP;
- else if( p == pSep )
- pRes->nFlags |= MAN_MASK_NEW_SEP;
- }
- pRes->pMemPos = p->pMemPos;
- pRes->nSprmId = GetId(p);
- pRes->nCp2OrIdx = p->nCp2OrIdx;
- if (p->nSprmsLen)
- {
- // Length of actual sprm
- pRes->nMemLen = maSprmParser.GetSprmSize(pRes->nSprmId, pRes->pMemPos);
- }
-}
-
-void WW8PLCFMan::GetSprmEnd( short nIdx, WW8PLCFManResult* pRes ) const
-{
- memset( pRes, 0, sizeof( WW8PLCFManResult ) );
-
- const WW8PLCFxDesc* p = &aD[nIdx];
-
- if (!(p->pIdStk->empty()))
- pRes->nSprmId = p->pIdStk->top(); // get end position
- else
- {
- ASSERT( !this, "No Id on the Stack" );
- pRes->nSprmId = 0;
- }
-}
-
-void WW8PLCFMan::GetNoSprmStart( short nIdx, WW8PLCFManResult* pRes ) const
-{
- const WW8PLCFxDesc* p = &aD[nIdx];
-
- pRes->nCpPos = p->nStartPos;
- pRes->nMemLen = p->nSprmsLen;
- pRes->nCp2OrIdx = p->nCp2OrIdx;
-
- if( p == pFld )
- pRes->nSprmId = eFLD;
- else if( p == pFtn )
- pRes->nSprmId = eFTN;
- else if( p == pEdn )
- pRes->nSprmId = eEDN;
- else if( p == pBkm )
- pRes->nSprmId = eBKN;
- else if( p == pAnd )
- pRes->nSprmId = eAND;
- else if( p == pPcd )
- {
- //We slave the piece table attributes to the piece table, the piece
- //table attribute iterator contains the sprms for this piece.
- GetSprmStart( nIdx+1, pRes );
- }
- else
- pRes->nSprmId = 0; // default: not found
-}
-
-void WW8PLCFMan::GetNoSprmEnd( short nIdx, WW8PLCFManResult* pRes ) const
-{
- pRes->nMemLen = -1; // Ende-Kennzeichen
-
- if( &aD[nIdx] == pBkm )
- pRes->nSprmId = eBKN;
- else if( &aD[nIdx] == pPcd )
- {
- //We slave the piece table attributes to the piece table, the piece
- //table attribute iterator contains the sprms for this piece.
- GetSprmEnd( nIdx+1, pRes );
- }
- else
- pRes->nSprmId = 0;
-}
-
-bool WW8PLCFMan::TransferOpenSprms(std::stack<sal_uInt16> &rStack)
-{
- for (int i = 0; i < nPLCF; ++i)
- {
- WW8PLCFxDesc* p = &aD[i];
- if (!p || !p->pIdStk)
- continue;
- while (!p->pIdStk->empty())
- {
- rStack.push(p->pIdStk->top());
- p->pIdStk->pop();
- }
- }
- return rStack.empty();
-}
-
-void WW8PLCFMan::AdvSprm(short nIdx, bool bStart)
-{
- WW8PLCFxDesc* p = &aD[nIdx]; // Sprm-Klasse(!) ermitteln
-
- p->bFirstSprm = false;
- if( bStart )
- {
- sal_uInt16 nLastId = GetId(p);
- p->pIdStk->push(nLastId); // merke Id fuer Attribut-Ende
-
- if( p->nSprmsLen )
- { /*
- Pruefe, ob noch Sprm(s) abzuarbeiten sind
- */
- if( p->pMemPos )
- {
- // Length of last sprm
- sal_uInt16 nSprmL = maSprmParser.GetSprmSize(nLastId, p->pMemPos);
-
- // Gesamtlaenge Sprms um SprmLaenge verringern
- p->nSprmsLen -= nSprmL;
-
- // Pos des evtl. naechsten Sprm
- if (p->nSprmsLen < maSprmParser.MinSprmLen())
- {
- // sicherheitshalber auf Null setzen, da Enden folgen!
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- }
- else
- p->pMemPos += nSprmL;
- }
- else
- p->nSprmsLen = 0;
- }
- if (p->nSprmsLen < maSprmParser.MinSprmLen())
- p->nStartPos = LONG_MAX; // es folgen Enden
- }
- else
- {
- if (!(p->pIdStk->empty()))
- p->pIdStk->pop();
- if (p->pIdStk->empty())
- {
- if ( (p == pChp) || (p == pPap) )
- {
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- p->nStartPos = p->nOrigEndPos+p->nCpOfs;
-
- /*
- #93702#
- On failed seek we have run out of sprms, probably. But if its
- a fastsaved file (has pPcd) then we may be just in a sprm free
- gap between pieces that have them, so set dirty flag in sprm
- finder to consider than.
- */
- if (!(*p->pPLCFx).SeekPos(p->nStartPos))
- {
- p->nEndPos = LONG_MAX;
- p->pPLCFx->SetDirty(true);
- }
- if (!p->pPLCFx->GetDirty() || pPcd)
- GetNewSprms( *p );
- p->pPLCFx->SetDirty(false);
-
- /*
- #i2325#
- To get the character and paragraph properties you first get
- the pap and chp and then apply the fastsaved pPcd properties
- to the range. If a pap or chp starts inside the pPcd range
- then we must bring the current pPcd range to a halt so as to
- end those sprms, then the pap/chp will be processed, and then
- we must force a restart of the pPcd on that pap/chp starting
- boundary. Doing that effectively means that the pPcd sprms will
- be applied to the new range. Not doing it means that the pPcd
- sprms will only be applied to the first pap/chp set of
- properties contained in the pap/chp range.
-
- So we bring the pPcd to a halt on this location here, by
- settings its end to the current start, then store the starting
- position of the current range to clipstart. The pPcd sprms
- will end as normal (albeit earlier than originally expected),
- and the existance of a clipstart will force the pPcd iterater
- to reread the current set of sprms instead of advancing to its
- next set. Then the clipstart will be set as the starting
- position which will force them to be applied directly after
- the pap and chps.
- */
- if (pPcd && ((p->nStartPos > pPcd->nStartPos) ||
- (pPcd->nStartPos == LONG_MAX)) &&
- (pPcd->nEndPos != p->nStartPos))
- {
- pPcd->nEndPos = p->nStartPos;
- ((WW8PLCFx_PCD *)(pPcd->pPLCFx))->SetClipStart(
- p->nStartPos);
- }
-
- }
- else
- {
- (*p->pPLCFx)++; // next Group of Sprms
- p->pMemPos = 0; // !!!
- p->nSprmsLen = 0;
- GetNewSprms( *p );
- }
- ASSERT( p->nStartPos <= p->nEndPos, "Attribut ueber Kreuz" );
- }
- }
-}
-
-void WW8PLCFMan::AdvNoSprm(short nIdx, bool bStart)
-{
- /*
- For the case of a piece table we slave the piece table attribute iterator
- to the piece table and access it through that only. They are two seperate
- structures, but act together as one logical one. The attributes only go
- to the next entry when the piece changes
- */
- WW8PLCFxDesc* p = &aD[nIdx];
-
- if( p == pPcd )
- {
- AdvSprm(nIdx+1,bStart);
- if( bStart )
- p->nStartPos = aD[nIdx+1].nStartPos;
- else
- {
- if (aD[nIdx+1].pIdStk->empty())
- {
- WW8PLCFx_PCD *pTemp = (WW8PLCFx_PCD*)(pPcd->pPLCFx);
- /*
- #i2325#
- As per normal, go on to the next set of properties, i.e. we
- have traversed over to the next piece. With a clipstart set
- we are being told to reread the current piece sprms so as to
- reapply them to a new chp or pap range.
- */
- if (pTemp->GetClipStart() == -1)
- (*p->pPLCFx)++;
- p->pMemPos = 0;
- p->nSprmsLen = 0;
- GetNewSprms( aD[nIdx+1] );
- GetNewNoSprms( *p );
- if (pTemp->GetClipStart() != -1)
- {
- /*
- #i2325#, now we will force our starting position to the
- clipping start so as to force the application of these
- sprms after the current pap/chp sprms so as to apply the
- fastsave sprms to the current range.
- */
- p->nStartPos = pTemp->GetClipStart();
- pTemp->SetClipStart(-1);
- }
- }
- }
- }
- else
- { // NoSprm ohne Ende
- (*p->pPLCFx)++;
- p->pMemPos = 0; // MemPos ungueltig
- p->nSprmsLen = 0;
- GetNewNoSprms( *p );
- }
-}
-
-WW8PLCFMan& WW8PLCFMan::operator ++(int)
-{
- bool bStart;
- sal_uInt16 nIdx = WhereIdx(&bStart);
- if (nIdx < nPLCF)
- {
- WW8PLCFxDesc* p = &aD[nIdx];
-
- p->bFirstSprm = true; // Default
-
- if( p->pPLCFx->IsSprm() )
- AdvSprm( nIdx, bStart );
- else // NoSprm
- AdvNoSprm( nIdx, bStart );
- }
- return *this;
-}
-
-// Rueckgabe true fuer Anfang eines Attributes oder Fehler,
-// false fuer Ende d. Attr
-// Restliche Rueckgabewerte werden in der vom Aufrufer zu stellenden Struktur
-// WW8PclxManResults geliefert.
-bool WW8PLCFMan::Get(WW8PLCFManResult* pRes) const
-{
- memset( pRes, 0, sizeof( WW8PLCFManResult ) );
- bool bStart;
- sal_uInt16 nIdx = WhereIdx(&bStart);
-
- if( nIdx >= nPLCF )
- {
- ASSERT( !this, "Position not found" );
- return true;
- }
-
- if( aD[nIdx].pPLCFx->IsSprm() )
- {
- if( bStart )
- {
- GetSprmStart( nIdx, pRes );
- return true;
- }
- else
- {
- GetSprmEnd( nIdx, pRes );
- return false;
- }
- }
- else
- {
- if( bStart )
- {
- GetNoSprmStart( nIdx, pRes );
- return true;
- }
- else
- {
- GetNoSprmEnd( nIdx, pRes );
- return false;
- }
- }
-}
-
-sal_uInt16 WW8PLCFMan::GetColl() const
-{
- if( pPap->pPLCFx )
- return pPap->pPLCFx->GetIstd();
- else
- {
- ASSERT( !this, "GetColl ohne PLCF_Pap" );
- return 0;
- }
-}
-
-WW8PLCFx_FLD* WW8PLCFMan::GetFld() const
-{
- return (WW8PLCFx_FLD*)pFld->pPLCFx;
-}
-
-const sal_uInt8* WW8PLCFMan::HasParaSprm( sal_uInt16 nId ) const
-{
- return ((WW8PLCFx_Cp_FKP*)pPap->pPLCFx)->HasSprm( nId );
-}
-
-const sal_uInt8* WW8PLCFMan::HasCharSprm( sal_uInt16 nId ) const
-{
- return ((WW8PLCFx_Cp_FKP*)pChp->pPLCFx)->HasSprm( nId );
-}
-
-bool WW8PLCFMan::HasCharSprm(sal_uInt16 nId,
- std::vector<const sal_uInt8 *> &rResult) const
-{
- return ((WW8PLCFx_Cp_FKP*)pChp->pPLCFx)->HasSprm(nId, rResult);
-}
-
-#endif // !DUMP
-
-void WW8PLCFx::Save( WW8PLCFxSave1& rSave ) const
-{
- rSave.nPLCFxPos = GetIdx();
- rSave.nPLCFxPos2 = GetIdx2();
- rSave.nPLCFxMemOfs = 0;
- rSave.nStartFC = GetStartFc();
-}
-
-void WW8PLCFx::Restore( const WW8PLCFxSave1& rSave )
-{
- SetIdx( rSave.nPLCFxPos );
- SetIdx2( rSave.nPLCFxPos2 );
- SetStartFc( rSave.nStartFC );
-}
-
-sal_uLong WW8PLCFx_Cp_FKP::GetIdx2() const
-{
- return GetPCDIdx();
-}
-
-void WW8PLCFx_Cp_FKP::SetIdx2( sal_uLong nIdx )
-{
- SetPCDIdx( nIdx );
-}
-
-void WW8PLCFx_Cp_FKP::Save( WW8PLCFxSave1& rSave ) const
-{
- WW8PLCFx::Save( rSave );
-
- rSave.nAttrStart = nAttrStart;
- rSave.nAttrEnd = nAttrEnd;
- rSave.bLineEnd = bLineEnd;
-}
-
-void WW8PLCFx_Cp_FKP::Restore( const WW8PLCFxSave1& rSave )
-{
- WW8PLCFx::Restore( rSave );
-
- nAttrStart = rSave.nAttrStart;
- nAttrEnd = rSave.nAttrEnd;
- bLineEnd = rSave.bLineEnd;
-}
-
-void WW8PLCFxDesc::Save( WW8PLCFxSave1& rSave ) const
-{
- if( pPLCFx )
- {
- pPLCFx->Save( rSave );
- if( pPLCFx->IsSprm() )
- {
- WW8PLCFxDesc aD;
- aD.nStartPos = nOrigStartPos+nCpOfs;
- aD.nCpOfs = rSave.nCpOfs = nCpOfs;
- if (!(pPLCFx->SeekPos(aD.nStartPos)))
- {
- aD.nEndPos = LONG_MAX;
- pPLCFx->SetDirty(true);
- }
- pPLCFx->GetSprms(&aD);
- pPLCFx->SetDirty(false);
- aD.ReduceByOffset();
- rSave.nStartCp = aD.nStartPos;
- rSave.nPLCFxMemOfs = nOrigSprmsLen - nSprmsLen;
- }
- }
-}
-
-void WW8PLCFxDesc::Restore( const WW8PLCFxSave1& rSave )
-{
- if( pPLCFx )
- {
- pPLCFx->Restore( rSave );
- if( pPLCFx->IsSprm() )
- {
- WW8PLCFxDesc aD;
- aD.nStartPos = rSave.nStartCp+rSave.nCpOfs;
- nCpOfs = aD.nCpOfs = rSave.nCpOfs;
- if (!(pPLCFx->SeekPos(aD.nStartPos)))
- {
- aD.nEndPos = LONG_MAX;
- pPLCFx->SetDirty(true);
- }
- pPLCFx->GetSprms(&aD);
- pPLCFx->SetDirty(false);
- aD.ReduceByOffset();
- pMemPos = aD.pMemPos + rSave.nPLCFxMemOfs;
- }
- }
-}
-
-//-----------------------------------------
-
-
-WW8Fib::WW8Fib( SvStream& rSt, sal_uInt8 nWantedVersion,sal_uInt32 nOffset )
- : nFibError( 0 )
-{
- sal_uInt8 aBits1;
- sal_uInt8 aBits2;
- sal_uInt8 aVer8Bits1; // nur ab WinWord 8 benutzt
- rSt.Seek( nOffset );
- /*
- Wunsch-Nr vermerken, File-Versionsnummer ermitteln
- und gegen Wunsch-Nr. checken !
- */
- nVersion = nWantedVersion;
- rSt >> wIdent;
- rSt >> nFib;
- rSt >> nProduct;
- if( 0 != rSt.GetError() )
- {
- sal_Int16 nFibMin;
- sal_Int16 nFibMax;
- // note: 6 stands for "6 OR 7", 7 stands for "ONLY 7"
- switch( nVersion )
- {
- case 6:
- nFibMin = 0x0065; // von 101 WinWord 6.0
- // 102 "
- // und 103 WinWord 6.0 fuer Macintosh
- // 104 "
- nFibMax = 0x0069; // bis 105 WinWord 95
- break;
- case 7:
- nFibMin = 0x0069; // von 105 WinWord 95
- nFibMax = 0x0069; // bis 105 WinWord 95
- break;
- case 8:
- nFibMin = 0x006A; // von 106 WinWord 97
- nFibMax = 0x00c1; // bis 193 WinWord 97 (?)
- break;
- default:
- nFibMin = 0; // Programm-Fehler!
- nFibMax = 0;
- nFib = 1;
- ASSERT( !this, "Es wurde vergessen, nVersion zu kodieren!" );
- break;
- }
- if ( (nFib < nFibMin) || (nFib > nFibMax) )
- {
- nFibError = ERR_SWG_READ_ERROR; // Error melden
- return; // und hopp raus!
- }
- }
-
- // praktische Hilfsvariablen:
- bool bVer67 = ((6 == nVersion) || (7 == nVersion));
- bool bVer8 = (8 == nVersion);
-
- // Hilfs-Varis fuer Ver67:
- sal_Int16 pnChpFirst_Ver67=0;
- sal_Int16 pnPapFirst_Ver67=0;
- sal_Int16 cpnBteChp_Ver67=0;
- sal_Int16 cpnBtePap_Ver67=0;
-
- // und auf gehts: FIB einlesen
- rSt >> lid;
- rSt >> pnNext;
- rSt >> aBits1;
- rSt >> aBits2;
- rSt >> nFibBack;
- rSt >> lKey1;
- rSt >> lKey2;
- rSt >> envr;
- rSt >> aVer8Bits1; // unter Ver67 nur leeres Reservefeld
- // Inhalt von aVer8Bits1
- //
- // sal_uInt8 fMac :1;
- // sal_uInt8 fEmptySpecial :1;
- // sal_uInt8 fLoadOverridePage :1;
- // sal_uInt8 fFuturesavedUndo :1;
- // sal_uInt8 fWord97Saved :1;
- // sal_uInt8 :3;
- rSt >> chse;
- rSt >> chseTables;
- rSt >> fcMin;
- rSt >> fcMac;
-
-// Einschub fuer WW8 *****************************************************
- if( !bVer67 )
- {
- rSt >> csw;
-
- // Marke: "rgsw" Beginning of the array of shorts
- rSt >> wMagicCreated;
- rSt >> wMagicRevised;
- rSt >> wMagicCreatedPrivate;
- rSt >> wMagicRevisedPrivate;
- rSt.SeekRel( 9 * sizeof( sal_Int16 ) );
-
- /*
- // dies sind die 9 unused Felder:
- && (bVer67 || WW8ReadINT16( rSt, pnFbpChpFirst_W6 )) // 1
- && (bVer67 || WW8ReadINT16( rSt, pnChpFirst_W6 )) // 2
- && (bVer67 || WW8ReadINT16( rSt, cpnBteChp_W6 )) // 3
- && (bVer67 || WW8ReadINT16( rSt, pnFbpPapFirst_W6 )) // 4
- && (bVer67 || WW8ReadINT16( rSt, pnPapFirst_W6 )) // 5
- && (bVer67 || WW8ReadINT16( rSt, cpnBtePap_W6 )) // 6
- && (bVer67 || WW8ReadINT16( rSt, pnFbpLvcFirst_W6 )) // 7
- && (bVer67 || WW8ReadINT16( rSt, pnLvcFirst_W6 )) // 8
- && (bVer67 || WW8ReadINT16( rSt, cpnBteLvc_W6 )) // 9
- */
- rSt >> lidFE;
- rSt >> clw;
- }
-
-// Ende des Einschubs fuer WW8 *******************************************
-
- // Marke: "rglw" Beginning of the array of longs
- rSt >> cbMac;
-
- // 2 Longs uebergehen, da unwichtiger Quatsch
- rSt.SeekRel( 2 * sizeof( sal_Int32) );
-
- // weitere 2 Longs nur bei Ver67 ueberspringen
- if( bVer67 )
- rSt.SeekRel( 2 * sizeof( sal_Int32) );
-
- rSt >> ccpText;
- rSt >> ccpFtn;
- rSt >> ccpHdr;
- rSt >> ccpMcr;
- rSt >> ccpAtn;
- rSt >> ccpEdn;
- rSt >> ccpTxbx;
- rSt >> ccpHdrTxbx;
-
- // weiteres Long nur bei Ver67 ueberspringen
- if( bVer67 )
- rSt.SeekRel( 1 * sizeof( sal_Int32) );
- else
- {
-// Einschub fuer WW8 *****************************************************
- rSt >> pnFbpChpFirst;
- rSt >> pnChpFirst;
- rSt >> cpnBteChp;
- rSt >> pnFbpPapFirst;
- rSt >> pnPapFirst;
- rSt >> cpnBtePap;
- rSt >> pnFbpLvcFirst;
- rSt >> pnLvcFirst;
- rSt >> cpnBteLvc;
- rSt >> fcIslandFirst;
- rSt >> fcIslandLim;
- rSt >> cfclcb;
- }
-
-// Ende des Einschubs fuer WW8 *******************************************
-
- // Marke: "rgfclcb" Beginning of array of FC/LCB pairs.
- rSt >> fcStshfOrig;
- rSt >> lcbStshfOrig;
- rSt >> fcStshf;
- rSt >> lcbStshf;
- rSt >> fcPlcffndRef;
- rSt >> lcbPlcffndRef;
- rSt >> fcPlcffndTxt;
- rSt >> lcbPlcffndTxt;
- rSt >> fcPlcfandRef;
- rSt >> lcbPlcfandRef;
- rSt >> fcPlcfandTxt;
- rSt >> lcbPlcfandTxt;
- rSt >> fcPlcfsed;
- rSt >> lcbPlcfsed;
- rSt >> fcPlcfpad;
- rSt >> lcbPlcfpad;
- rSt >> fcPlcfphe;
- rSt >> lcbPlcfphe;
- rSt >> fcSttbfglsy;
- rSt >> lcbSttbfglsy;
- rSt >> fcPlcfglsy;
- rSt >> lcbPlcfglsy;
- rSt >> fcPlcfhdd;
- rSt >> lcbPlcfhdd;
- rSt >> fcPlcfbteChpx;
- rSt >> lcbPlcfbteChpx;
- rSt >> fcPlcfbtePapx;
- rSt >> lcbPlcfbtePapx;
- rSt >> fcPlcfsea;
- rSt >> lcbPlcfsea;
- rSt >> fcSttbfffn;
- rSt >> lcbSttbfffn;
- rSt >> fcPlcffldMom;
- rSt >> lcbPlcffldMom;
- rSt >> fcPlcffldHdr;
- rSt >> lcbPlcffldHdr;
- rSt >> fcPlcffldFtn;
- rSt >> lcbPlcffldFtn;
- rSt >> fcPlcffldAtn;
- rSt >> lcbPlcffldAtn;
- rSt >> fcPlcffldMcr;
- rSt >> lcbPlcffldMcr;
- rSt >> fcSttbfbkmk;
- rSt >> lcbSttbfbkmk;
- rSt >> fcPlcfbkf;
- rSt >> lcbPlcfbkf;
- rSt >> fcPlcfbkl;
- rSt >> lcbPlcfbkl;
- rSt >> fcCmds;
- rSt >> lcbCmds;
- rSt >> fcPlcfmcr;
- rSt >> lcbPlcfmcr;
- rSt >> fcSttbfmcr;
- rSt >> lcbSttbfmcr;
- rSt >> fcPrDrvr;
- rSt >> lcbPrDrvr;
- rSt >> fcPrEnvPort;
- rSt >> lcbPrEnvPort;
- rSt >> fcPrEnvLand;
- rSt >> lcbPrEnvLand;
- rSt >> fcWss;
- rSt >> lcbWss;
- rSt >> fcDop;
- rSt >> lcbDop;
- rSt >> fcSttbfAssoc;
- rSt >> cbSttbfAssoc;
- rSt >> fcClx;
- rSt >> lcbClx;
- rSt >> fcPlcfpgdFtn;
- rSt >> lcbPlcfpgdFtn;
- rSt >> fcAutosaveSource;
- rSt >> lcbAutosaveSource;
- rSt >> fcGrpStAtnOwners;
- rSt >> lcbGrpStAtnOwners;
- rSt >> fcSttbfAtnbkmk;
- rSt >> lcbSttbfAtnbkmk;
-
- // weiteres short nur bei Ver67 ueberspringen
- if (bVer67)
- {
- rSt.SeekRel( 1*sizeof( sal_Int16) );
-
- // folgende 4 Shorts existieren nur bei Ver67;
- rSt >> pnChpFirst_Ver67;
- rSt >> pnPapFirst_Ver67;
- rSt >> cpnBteChp_Ver67;
- rSt >> cpnBtePap_Ver67;
- }
-
- rSt >> fcPlcfdoaMom;
- rSt >> lcbPlcfdoaMom;
- rSt >> fcPlcfdoaHdr;
- rSt >> lcbPlcfdoaHdr;
- rSt >> fcPlcfspaMom;
- rSt >> lcbPlcfspaMom;
- rSt >> fcPlcfspaHdr;
- rSt >> lcbPlcfspaHdr;
-
- rSt >> fcPlcfAtnbkf;
- rSt >> lcbPlcfAtnbkf;
- rSt >> fcPlcfAtnbkl;
- rSt >> lcbPlcfAtnbkl;
- rSt >> fcPms;
- rSt >> lcbPMS;
- rSt >> fcFormFldSttbf;
- rSt >> lcbFormFldSttbf;
- rSt >> fcPlcfendRef;
- rSt >> lcbPlcfendRef;
- rSt >> fcPlcfendTxt;
- rSt >> lcbPlcfendTxt;
- rSt >> fcPlcffldEdn;
- rSt >> lcbPlcffldEdn;
- rSt >> fcPlcfpgdEdn;
- rSt >> lcbPlcfpgdEdn;
- rSt >> fcDggInfo;
- rSt >> lcbDggInfo;
- rSt >> fcSttbfRMark;
- rSt >> lcbSttbfRMark;
- rSt >> fcSttbfCaption;
- rSt >> lcbSttbfCaption;
- rSt >> fcSttbAutoCaption;
- rSt >> lcbSttbAutoCaption;
- rSt >> fcPlcfwkb;
- rSt >> lcbPlcfwkb;
- rSt >> fcPlcfspl;
- rSt >> lcbPlcfspl;
- rSt >> fcPlcftxbxTxt;
- rSt >> lcbPlcftxbxTxt;
- rSt >> fcPlcffldTxbx;
- rSt >> lcbPlcffldTxbx;
- rSt >> fcPlcfHdrtxbxTxt;
- rSt >> lcbPlcfHdrtxbxTxt;
- rSt >> fcPlcffldHdrTxbx;
- rSt >> lcbPlcffldHdrTxbx;
-
- if( 0 == rSt.GetError() )
- {
- // Bit-Flags setzen
- fDot = aBits1 & 0x01 ;
- fGlsy = ( aBits1 & 0x02 ) >> 1;
- fComplex = ( aBits1 & 0x04 ) >> 2;
- fHasPic = ( aBits1 & 0x08 ) >> 3;
- cQuickSaves = ( aBits1 & 0xf0 ) >> 4;
- fEncrypted = aBits2 & 0x01 ;
- fWhichTblStm= ( aBits2 & 0x02 ) >> 1;
- // dummy = ( aBits2 & 0x0e ) >> 1;
- fExtChar = ( aBits2 & 0x10 ) >> 4;
- // dummy = ( aBits2 & 0xe0 ) >> 5;
-
- /*
- ggfs. Ziel-Varaiblen, aus xxx_Ver67 fuellen
- oder Flags setzen
- */
- if (bVer67)
- {
- pnChpFirst = pnChpFirst_Ver67;
- pnPapFirst = pnPapFirst_Ver67;
- cpnBteChp = cpnBteChp_Ver67;
- cpnBtePap = cpnBtePap_Ver67;
- }
- else if( bVer8 )
- {
- fMac = aVer8Bits1 & 0x01 ;
- fEmptySpecial = ( aVer8Bits1 & 0x02 ) >> 1;
- fLoadOverridePage = ( aVer8Bits1 & 0x04 ) >> 2;
- fFuturesavedUndo = ( aVer8Bits1 & 0x08 ) >> 3;
- fWord97Saved = ( aVer8Bits1 & 0x10 ) >> 4;
- fWord2000Saved = ( aVer8Bits1 & 0x20 ) >> 5;
-
- /*
- speziell fuer WW8:
- ermittle die Werte fuer PLCF LST und PLF LFO
- und PLCF fuer TextBox-Break-Deskriptoren
- */
- long nOldPos = rSt.Tell();
- rSt.Seek( 0x02e2 );
- rSt >> fcPlcfLst;
- rSt >> lcbPlcfLst;
- rSt >> fcPlfLfo;
- rSt >> lcbPlfLfo;
- rSt >> fcPlcftxbxBkd;
- rSt >> lcbPlcftxbxBkd;
- rSt >> fcPlcfHdrtxbxBkd;
- rSt >> lcbPlcfHdrtxbxBkd;
- if( 0 != rSt.GetError() )
- {
- nFibError = ERR_SWG_READ_ERROR;
- }
-
- rSt.Seek( 0x372 ); // fcSttbListNames
- rSt >> fcSttbListNames;
- rSt >> lcbSttbListNames;
- rSt.Seek( 0x382 ); // MagicTables
- rSt >> fcMagicTable;
- rSt >> lcbMagicTable;
- if( 0 != rSt.GetError() )
- nFibError = ERR_SWG_READ_ERROR;
-
- rSt.Seek( nOldPos );
- }
- }
- else
- {
- nFibError = ERR_SWG_READ_ERROR; // Error melden
- }
-}
-
-
-WW8Fib::WW8Fib(sal_uInt8 nVer)
-{
- memset(this, 0, sizeof(*this));
- nVersion = nVer;
- if (8 == nVer)
- {
- fcMin = 0x400;
- wIdent = 0xa5ec;
- nFib = 0xc2;
- nFibBack = 0xbf;
- nProduct = 0x204D;
-
- csw = 0x0e; // muss das sein ???
- cfclcb = 0x6c; // -""-
- clw = 0x16; // -""-
- pnFbpChpFirst = pnFbpPapFirst = pnFbpLvcFirst = 0x000fffff;
- fExtChar = true;
- fWord97Saved = fWord2000Saved = true;
-
- // diese Flags muessen nicht gesetzt werden; koennen aber.
- // wMagicCreated = wMagicRevised = 0x6a62;
- // wMagicCreatedPrivate = wMagicRevisedPrivate = 0xb3b2;
- //
-
- wMagicCreated = 0x6143;
- wMagicRevised = 0x6C6F;
- wMagicCreatedPrivate = 0x6E61;
- wMagicRevisedPrivate = 0x3136;
- }
- else
- {
- fcMin = 0x300;
- wIdent = 0xa5dc;
- nFib = nFibBack = 0x65;
- nProduct = 0xc02d;
- }
-
- lid = lidFE = 0x407;
-}
-
-bool WW8Fib::Write(SvStream& rStrm)
-{
- sal_uInt8 *pDataPtr = new sal_uInt8[ fcMin ];
- sal_uInt8 *pData = pDataPtr;
- memset( pData, 0, fcMin );
-
- bool bVer8 = 8 == nVersion;
-
- sal_uLong nPos = rStrm.Tell();
- cbMac = rStrm.Seek( STREAM_SEEK_TO_END );
- rStrm.Seek( nPos );
-
- Set_UInt16( pData, wIdent );
- Set_UInt16( pData, nFib );
- Set_UInt16( pData, nProduct );
- Set_UInt16( pData, lid );
- Set_UInt16( pData, pnNext );
-
- sal_uInt16 nBits16 = 0;
- if( fDot ) nBits16 |= 0x0001;
- if( fGlsy) nBits16 |= 0x0002;
- if( fComplex ) nBits16 |= 0x0004;
- if( fHasPic ) nBits16 |= 0x0008;
- nBits16 |= (0xf0 & ( cQuickSaves << 4 ));
- if( fEncrypted ) nBits16 |= 0x0100;
- if( fWhichTblStm ) nBits16 |= 0x0200;
- if( fExtChar ) nBits16 |= 0x1000;
- Set_UInt16( pData, nBits16 );
-
- Set_UInt16( pData, nFibBack );
- Set_UInt16( pData, lKey1 );
- Set_UInt16( pData, lKey2 );
- Set_UInt8( pData, envr );
-
- sal_uInt8 nBits8 = 0;
- if( bVer8 )
- {
- if( fMac ) nBits8 |= 0x0001;
- if( fEmptySpecial ) nBits8 |= 0x0002;
- if( fLoadOverridePage ) nBits8 |= 0x0004;
- if( fFuturesavedUndo ) nBits8 |= 0x0008;
- if( fWord97Saved ) nBits8 |= 0x0010;
- if( fWord2000Saved ) nBits8 |= 0x0020;
- }
- // unter Ver67 these are only reserved
- Set_UInt8( pData, nBits8 );
-
- Set_UInt16( pData, chse );
- Set_UInt16( pData, chseTables );
- Set_UInt32( pData, fcMin );
- Set_UInt32( pData, fcMac );
-
-// Einschub fuer WW8 *****************************************************
-
- // Marke: "rgsw" Beginning of the array of shorts
- if( bVer8 )
- {
- Set_UInt16( pData, csw );
- Set_UInt16( pData, wMagicCreated );
- Set_UInt16( pData, wMagicRevised );
- Set_UInt16( pData, wMagicCreatedPrivate );
- Set_UInt16( pData, wMagicRevisedPrivate );
- pData += 9 * sizeof( sal_Int16 );
- Set_UInt16( pData, lidFE );
- Set_UInt16( pData, clw );
- }
-
-// Ende des Einschubs fuer WW8 *******************************************
-
- // Marke: "rglw" Beginning of the array of longs
- Set_UInt32( pData, cbMac );
-
- // 2 Longs uebergehen, da unwichtiger Quatsch
- pData += 2 * sizeof( sal_Int32);
-
- // weitere 2 Longs nur bei Ver67 ueberspringen
- if( !bVer8 )
- pData += 2 * sizeof( sal_Int32);
-
- Set_UInt32( pData, ccpText );
- Set_UInt32( pData, ccpFtn );
- Set_UInt32( pData, ccpHdr );
- Set_UInt32( pData, ccpMcr );
- Set_UInt32( pData, ccpAtn );
- Set_UInt32( pData, ccpEdn );
- Set_UInt32( pData, ccpTxbx );
- Set_UInt32( pData, ccpHdrTxbx );
-
- // weiteres Long nur bei Ver67 ueberspringen
- if( !bVer8 )
- pData += 1 * sizeof( sal_Int32);
-
-// Einschub fuer WW8 *****************************************************
- if( bVer8 )
- {
- Set_UInt32( pData, pnFbpChpFirst );
- Set_UInt32( pData, pnChpFirst );
- Set_UInt32( pData, cpnBteChp );
- Set_UInt32( pData, pnFbpPapFirst );
- Set_UInt32( pData, pnPapFirst );
- Set_UInt32( pData, cpnBtePap );
- Set_UInt32( pData, pnFbpLvcFirst );
- Set_UInt32( pData, pnLvcFirst );
- Set_UInt32( pData, cpnBteLvc );
- Set_UInt32( pData, fcIslandFirst );
- Set_UInt32( pData, fcIslandLim );
- Set_UInt16( pData, cfclcb );
- }
-// Ende des Einschubs fuer WW8 *******************************************
-
- // Marke: "rgfclcb" Beginning of array of FC/LCB pairs.
- Set_UInt32( pData, fcStshfOrig );
- Set_UInt32( pData, lcbStshfOrig );
- Set_UInt32( pData, fcStshf );
- Set_UInt32( pData, lcbStshf );
- Set_UInt32( pData, fcPlcffndRef );
- Set_UInt32( pData, lcbPlcffndRef );
- Set_UInt32( pData, fcPlcffndTxt );
- Set_UInt32( pData, lcbPlcffndTxt );
- Set_UInt32( pData, fcPlcfandRef );
- Set_UInt32( pData, lcbPlcfandRef );
- Set_UInt32( pData, fcPlcfandTxt );
- Set_UInt32( pData, lcbPlcfandTxt );
- Set_UInt32( pData, fcPlcfsed );
- Set_UInt32( pData, lcbPlcfsed );
- Set_UInt32( pData, fcPlcfpad );
- Set_UInt32( pData, lcbPlcfpad );
- Set_UInt32( pData, fcPlcfphe );
- Set_UInt32( pData, lcbPlcfphe );
- Set_UInt32( pData, fcSttbfglsy );
- Set_UInt32( pData, lcbSttbfglsy );
- Set_UInt32( pData, fcPlcfglsy );
- Set_UInt32( pData, lcbPlcfglsy );
- Set_UInt32( pData, fcPlcfhdd );
- Set_UInt32( pData, lcbPlcfhdd );
- Set_UInt32( pData, fcPlcfbteChpx );
- Set_UInt32( pData, lcbPlcfbteChpx );
- Set_UInt32( pData, fcPlcfbtePapx );
- Set_UInt32( pData, lcbPlcfbtePapx );
- Set_UInt32( pData, fcPlcfsea );
- Set_UInt32( pData, lcbPlcfsea );
- Set_UInt32( pData, fcSttbfffn );
- Set_UInt32( pData, lcbSttbfffn );
- Set_UInt32( pData, fcPlcffldMom );
- Set_UInt32( pData, lcbPlcffldMom );
- Set_UInt32( pData, fcPlcffldHdr );
- Set_UInt32( pData, lcbPlcffldHdr );
- Set_UInt32( pData, fcPlcffldFtn );
- Set_UInt32( pData, lcbPlcffldFtn );
- Set_UInt32( pData, fcPlcffldAtn );
- Set_UInt32( pData, lcbPlcffldAtn );
- Set_UInt32( pData, fcPlcffldMcr );
- Set_UInt32( pData, lcbPlcffldMcr );
- Set_UInt32( pData, fcSttbfbkmk );
- Set_UInt32( pData, lcbSttbfbkmk );
- Set_UInt32( pData, fcPlcfbkf );
- Set_UInt32( pData, lcbPlcfbkf );
- Set_UInt32( pData, fcPlcfbkl );
- Set_UInt32( pData, lcbPlcfbkl );
- Set_UInt32( pData, fcCmds );
- Set_UInt32( pData, lcbCmds );
- Set_UInt32( pData, fcPlcfmcr );
- Set_UInt32( pData, lcbPlcfmcr );
- Set_UInt32( pData, fcSttbfmcr );
- Set_UInt32( pData, lcbSttbfmcr );
- Set_UInt32( pData, fcPrDrvr );
- Set_UInt32( pData, lcbPrDrvr );
- Set_UInt32( pData, fcPrEnvPort );
- Set_UInt32( pData, lcbPrEnvPort );
- Set_UInt32( pData, fcPrEnvLand );
- Set_UInt32( pData, lcbPrEnvLand );
- Set_UInt32( pData, fcWss );
- Set_UInt32( pData, lcbWss );
- Set_UInt32( pData, fcDop );
- Set_UInt32( pData, lcbDop );
- Set_UInt32( pData, fcSttbfAssoc );
- Set_UInt32( pData, cbSttbfAssoc );
- Set_UInt32( pData, fcClx );
- Set_UInt32( pData, lcbClx );
- Set_UInt32( pData, fcPlcfpgdFtn );
- Set_UInt32( pData, lcbPlcfpgdFtn );
- Set_UInt32( pData, fcAutosaveSource );
- Set_UInt32( pData, lcbAutosaveSource );
- Set_UInt32( pData, fcGrpStAtnOwners );
- Set_UInt32( pData, lcbGrpStAtnOwners );
- Set_UInt32( pData, fcSttbfAtnbkmk );
- Set_UInt32( pData, lcbSttbfAtnbkmk );
-
- // weiteres short nur bei Ver67 ueberspringen
- if( !bVer8 )
- {
- pData += 1*sizeof( sal_Int16);
- Set_UInt16( pData, (sal_uInt16)pnChpFirst );
- Set_UInt16( pData, (sal_uInt16)pnPapFirst );
- Set_UInt16( pData, (sal_uInt16)cpnBteChp );
- Set_UInt16( pData, (sal_uInt16)cpnBtePap );
- }
-
- Set_UInt32( pData, fcPlcfdoaMom ); // nur bei Ver67, in Ver8 unused
- Set_UInt32( pData, lcbPlcfdoaMom ); // nur bei Ver67, in Ver8 unused
- Set_UInt32( pData, fcPlcfdoaHdr ); // nur bei Ver67, in Ver8 unused
- Set_UInt32( pData, lcbPlcfdoaHdr ); // nur bei Ver67, in Ver8 unused
-
- Set_UInt32( pData, fcPlcfspaMom ); // in Ver67 leere Reserve
- Set_UInt32( pData, lcbPlcfspaMom ); // in Ver67 leere Reserve
- Set_UInt32( pData, fcPlcfspaHdr ); // in Ver67 leere Reserve
- Set_UInt32( pData, lcbPlcfspaHdr ); // in Ver67 leere Reserve
-
- Set_UInt32( pData, fcPlcfAtnbkf );
- Set_UInt32( pData, lcbPlcfAtnbkf );
- Set_UInt32( pData, fcPlcfAtnbkl );
- Set_UInt32( pData, lcbPlcfAtnbkl );
- Set_UInt32( pData, fcPms );
- Set_UInt32( pData, lcbPMS );
- Set_UInt32( pData, fcFormFldSttbf );
- Set_UInt32( pData, lcbFormFldSttbf );
- Set_UInt32( pData, fcPlcfendRef );
- Set_UInt32( pData, lcbPlcfendRef );
- Set_UInt32( pData, fcPlcfendTxt );
- Set_UInt32( pData, lcbPlcfendTxt );
- Set_UInt32( pData, fcPlcffldEdn );
- Set_UInt32( pData, lcbPlcffldEdn );
- Set_UInt32( pData, fcPlcfpgdEdn );
- Set_UInt32( pData, lcbPlcfpgdEdn );
- Set_UInt32( pData, fcDggInfo ); // in Ver67 leere Reserve
- Set_UInt32( pData, lcbDggInfo ); // in Ver67 leere Reserve
- Set_UInt32( pData, fcSttbfRMark );
- Set_UInt32( pData, lcbSttbfRMark );
- Set_UInt32( pData, fcSttbfCaption );
- Set_UInt32( pData, lcbSttbfCaption );
- Set_UInt32( pData, fcSttbAutoCaption );
- Set_UInt32( pData, lcbSttbAutoCaption );
- Set_UInt32( pData, fcPlcfwkb );
- Set_UInt32( pData, lcbPlcfwkb );
- Set_UInt32( pData, fcPlcfspl ); // in Ver67 leere Reserve
- Set_UInt32( pData, lcbPlcfspl ); // in Ver67 leere Reserve
- Set_UInt32( pData, fcPlcftxbxTxt );
- Set_UInt32( pData, lcbPlcftxbxTxt );
- Set_UInt32( pData, fcPlcffldTxbx );
- Set_UInt32( pData, lcbPlcffldTxbx );
- Set_UInt32( pData, fcPlcfHdrtxbxTxt );
- Set_UInt32( pData, lcbPlcfHdrtxbxTxt );
- Set_UInt32( pData, fcPlcffldHdrTxbx );
- Set_UInt32( pData, lcbPlcffldHdrTxbx );
-
- if( bVer8 )
- {
- pData += 0x2e2 - 0x27a; // Pos + Offset (fcPlcfLst - fcStwUser)
- Set_UInt32( pData, fcPlcfLst );
- Set_UInt32( pData, lcbPlcfLst );
- Set_UInt32( pData, fcPlfLfo );
- Set_UInt32( pData, lcbPlfLfo );
- Set_UInt32( pData, fcPlcftxbxBkd );
- Set_UInt32( pData, lcbPlcftxbxBkd );
- Set_UInt32( pData, fcPlcfHdrtxbxBkd );
- Set_UInt32( pData, lcbPlcfHdrtxbxBkd );
-
- pData += 0x372 - 0x302; // Pos + Offset (fcSttbListNames - fcDocUndo)
- Set_UInt32( pData, fcSttbListNames );
- Set_UInt32( pData, lcbSttbListNames );
-
- pData += 0x382 - 0x37A;
- Set_UInt32( pData, fcMagicTable );
- Set_UInt32( pData, lcbMagicTable );
-
- pData += 0x3FA - 0x38A;
- Set_UInt16( pData, (sal_uInt16)0x0002);
- Set_UInt16( pData, (sal_uInt16)0x00D9);
- }
-
- rStrm.Write( pDataPtr, fcMin );
- delete[] pDataPtr;
- return 0 == rStrm.GetError();
-}
-
-rtl_TextEncoding WW8Fib::GetFIBCharset(sal_uInt16 chs)
-{
- ASSERT(chs <= 0x100, "overflowed winword charset set");
- rtl_TextEncoding eCharSet =
- (0x0100 == chs)
- ? RTL_TEXTENCODING_APPLE_ROMAN
- : rtl_getTextEncodingFromWindowsCharset( static_cast<sal_uInt8>(chs) );
- return eCharSet;
-}
-
-WW8Style::WW8Style(SvStream& rStream, WW8Fib& rFibPara)
- : rFib(rFibPara), rSt(rStream), cstd(0), cbSTDBaseInFile(0),
- stiMaxWhenSaved(0), istdMaxFixedWhenSaved(0), nVerBuiltInNamesWhenSaved(0),
- ftcStandardChpStsh(0), ftcStandardChpCJKStsh(0), ftcStandardChpCTLStsh(0)
-{
- nStyleStart = rFib.fcStshf;
- nStyleLen = rFib.lcbStshf;
-
- rSt.Seek(nStyleStart);
-
- sal_uInt16 cbStshi = 0; // 2 bytes size of the following STSHI structure
-
- // alte Version ?
- if (rFib.nFib < 67)
- cbStshi = 4; // -> Laengenfeld fehlt
- else // neue Version:
- // lies die Laenge der in der Datei gespeicherten Struktur
- rSt >> cbStshi;
-
- sal_uInt16 nRead = cbStshi;
- do
- {
- sal_uInt16 a16Bit;
-
- if( 2 > nRead ) break;
- rSt >> cstd;
-
- if( 4 > nRead ) break;
- rSt >> cbSTDBaseInFile;
-
- if( 6 > nRead ) break;
- rSt >> a16Bit;
- fStdStylenamesWritten = a16Bit & 0x0001;
-
- if( 8 > nRead ) break;
- rSt >> stiMaxWhenSaved;
-
- if( 10 > nRead ) break;
- rSt >> istdMaxFixedWhenSaved;
-
- if( 12 > nRead ) break;
- rSt >> nVerBuiltInNamesWhenSaved;
-
- if( 14 > nRead ) break;
- rSt >> ftcStandardChpStsh;
-
- if( 16 > nRead ) break;
- rSt >> ftcStandardChpCJKStsh;
-
- if ( 18 > nRead ) break;
- rSt >> ftcStandardChpCTLStsh;
-
- // ggfs. den Rest ueberlesen
- if( 18 < nRead )
- rSt.SeekRel( nRead-18 );
- }
- while( !this ); // Trick: obiger Block wird genau einmal durchlaufen
- // und kann vorzeitig per "break" verlassen werden.
-
- if( 0 != rSt.GetError() )
- {
- // wie denn nun den Error melden?
- }
-}
-
-// Read1STDFixed() liest ein Style ein. Wenn der Style vollstaendig vorhanden
-// ist, d.h. kein leerer Slot, dann wird Speicher alloziert und ein Pointer auf
-// die ( evtl. mit Nullen aufgefuellten ) STD geliefert. Ist es ein leerer
-// Slot, dann wird ein Nullpointer zurueckgeliefert.
-WW8_STD* WW8Style::Read1STDFixed( short& rSkip, short* pcbStd )
-{
- WW8_STD* pStd = 0;
-
- sal_uInt16 cbStd;
- rSt >> cbStd; // lies Laenge
-
- sal_uInt16 nRead = cbSTDBaseInFile;
- if( cbStd >= cbSTDBaseInFile )
- {
- // Fixed part vollst. vorhanden
-
- // read fixed part of STD
- pStd = new WW8_STD;
- memset( pStd, 0, sizeof( *pStd ) );
-
- do
- {
- sal_uInt16 a16Bit;
-
- if( 2 > nRead ) break;
- rSt >> a16Bit;
- pStd->sti = a16Bit & 0x0fff ;
- pStd->fScratch = 0 != ( a16Bit & 0x1000 );
- pStd->fInvalHeight = 0 != ( a16Bit & 0x2000 );
- pStd->fHasUpe = 0 != ( a16Bit & 0x4000 );
- pStd->fMassCopy = 0 != ( a16Bit & 0x8000 );
-
- if( 4 > nRead ) break;
- rSt >> a16Bit;
- pStd->sgc = a16Bit & 0x000f ;
- pStd->istdBase = ( a16Bit & 0xfff0 ) >> 4;
-
- if( 6 > nRead ) break;
- rSt >> a16Bit;
- pStd->cupx = a16Bit & 0x000f ;
- pStd->istdNext = ( a16Bit & 0xfff0 ) >> 4;
-
- if( 8 > nRead ) break;
- rSt >> pStd->bchUpe;
-
- // ab Ver8 sollten diese beiden Felder dazukommen:
- if(10 > nRead ) break;
- rSt >> a16Bit;
- pStd->fAutoRedef = a16Bit & 0x0001 ;
- pStd->fHidden = ( a16Bit & 0x0002 ) >> 2;
-
- // man kann nie wissen: vorsichtshalber ueberlesen
- // wir eventuelle Fuellsel, die noch zum BASE-Part gehoeren...
- if( 10 < nRead )
- rSt.SeekRel( nRead-10 );
- }
- while( !this ); // Trick: obiger Block wird genau einmal durchlaufen
- // und kann vorzeitig per "break" verlassen werden.
-
- if( (0 != rSt.GetError()) || !nRead )
- DELETEZ( pStd ); // per NULL den Error melden
-
- rSkip = cbStd - cbSTDBaseInFile;
- }
- else
- { // Fixed part zu kurz
- if( cbStd )
- rSt.SeekRel( cbStd ); // ueberlies Reste
- rSkip = 0;
- }
- if( pcbStd )
- *pcbStd = cbStd;
- return pStd;
-}
-
-WW8_STD* WW8Style::Read1Style( short& rSkip, String* pString, short* pcbStd )
-{
- // Attention: MacWord-Documents have their Stylenames
- // always in ANSI, even if eStructCharSet == CHARSET_MAC !!
-
- WW8_STD* pStd = Read1STDFixed( rSkip, pcbStd ); // lese STD
-
- // String gewuenscht ?
- if( pString )
- { // echter Style ?
- if ( pStd )
- {
- switch( rFib.nVersion )
- {
- case 6:
- case 7:
- // lies Pascal-String
- *pString = WW8ReadPString( rSt, RTL_TEXTENCODING_MS_1252 );
- // leading len and trailing zero --> 2
- rSkip -= 2+ pString->Len();
- break;
- case 8:
- // handle Unicode-String with leading length short and
- // trailing zero
- if (ww8String::TestBeltAndBraces(rSt))
- {
- *pString = WW8Read_xstz(rSt, 0, true);
- rSkip -= (pString->Len() + 2) * 2;
- }
- else
- {
- /*
- #i8114#
- This is supposed to be impossible, its just supposed
- to be 16 bit count followed by the string and ending
- in a 0 short. But "Lotus SmartSuite Product: Word Pro"
- is creating invalid style names in ww7- format. So we
- use the belt and braces of the ms strings to see if
- they are not corrupt. If they are then we try them as
- 8bit ones
- */
- *pString = WW8ReadPString(rSt,RTL_TEXTENCODING_MS_1252);
- // leading len and trailing zero --> 2
- rSkip -= 2+ pString->Len();
- }
- break;
- default:
- ASSERT(!this, "Es wurde vergessen, nVersion zu kodieren!");
- break;
- }
- }
- else
- *pString = aEmptyStr; // Kann keinen Namen liefern
- }
- return pStd;
-}
-
-
-//-----------------------------------------
-
-
-struct WW8_FFN_Ver6 : public WW8_FFN_BASE
-{
- // ab Ver6
- sal_Char szFfn[65]; // 0x6 bzw. 0x40 ab Ver8 zero terminated string that
- // records name of font.
- // Maximal size of szFfn is 65 characters.
- // Vorsicht: Dieses Array kann auch kleiner sein!!!
- // Possibly followed by a second sz which records the
- // name of an alternate font to use if the first named
- // font does not exist on this system.
-};
-struct WW8_FFN_Ver8 : public WW8_FFN_BASE
-{
- // ab Ver8 sind folgende beiden Felder eingeschoben,
- // werden von uns ignoriert.
- sal_Char panose[ 10 ]; // 0x6 PANOSE
- sal_Char fs[ 24 ]; // 0x10 FONTSIGNATURE
-
- // ab Ver8 als Unicode
- sal_uInt16 szFfn[65]; // 0x6 bzw. 0x40 ab Ver8 zero terminated string that
- // records name of font.
- // Maximal size of szFfn is 65 characters.
- // Vorsicht: Dieses Array kann auch kleiner sein!!!
- // Possibly followed by a second sz which records the
- // name of an alternate font to use if the first named
- // font does not exist on this system.
-};
-
-WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
-{
- // Attention: MacWord-Documents have their Fontnames
- // always in ANSI, even if eStructCharSet == CHARSET_MAC !!
- if( rFib.lcbSttbfffn <= 2 )
- {
- ASSERT( !this, "Fonttabelle kaputt! (rFib.lcbSttbfffn < 2)" );
- pFontA = 0;
- nMax = 0;
- return;
- }
-
- bool bVer67 = (8 > rFib.nVersion);
-
- rSt.Seek( rFib.fcSttbfffn );
-
- // allocate Font Array
- sal_uInt8* pA = new sal_uInt8[ rFib.lcbSttbfffn - 2 ];
- WW8_FFN* p = (WW8_FFN*)pA;
-
- if( !bVer67 )
- {
- // bVer8: read the count of strings in nMax
- rSt >> nMax;
- }
-
- // Ver8: skip undefined uint16
- // Ver67: skip the herein stored total byte of structure
- // - we already got that information in rFib.lcbSttbfffn
- rSt.SeekRel( 2 );
-
- // read all font information
- rSt.Read( pA, rFib.lcbSttbfffn - 2 );
-
- if( bVer67 )
- {
- // try to figure out how many fonts are defined here
- nMax = 0;
- long nLeft = rFib.lcbSttbfffn - 2;
- for(;;)
- {
- short nNextSiz;
-
- nNextSiz = p->cbFfnM1 + 1;
- if( nNextSiz > nLeft )
- break;
- nMax++;
- nLeft -= nNextSiz;
- if( nLeft < 1 ) // can we read the given ammount of bytes ?
- break;
- // increase p by nNextSiz Bytes
- p = (WW8_FFN *)( ( (sal_uInt8*)p ) + nNextSiz );
- }
- }
-
- if( nMax )
- {
- // allocate Index Array
- pFontA = new WW8_FFN[ nMax ];
- p = pFontA;
-
- if( bVer67 )
- {
- WW8_FFN_Ver6* pVer6 = (WW8_FFN_Ver6*)pA;
- sal_uInt8 c2;
- for(sal_uInt16 i=0; i<nMax; ++i, ++p)
- {
- p->cbFfnM1 = pVer6->cbFfnM1;
- c2 = *(((sal_uInt8*)pVer6) + 1);
-
- p->prg = c2 & 0x02;
- p->fTrueType = (c2 & 0x04) >> 2;
- // ein Reserve-Bit ueberspringen
- p->ff = (c2 & 0x70) >> 4;
-
- p->wWeight = SVBT16ToShort( *(SVBT16*)&pVer6->wWeight );
- p->chs = pVer6->chs;
- p->ibszAlt = pVer6->ibszAlt;
- /*
- #i8726# 7- seems to encode the name in the same encoding as
- the font, e.g load the doc in 97 and save to see the unicode
- ver of the asian fontnames in that example to confirm.
- */
- rtl_TextEncoding eEnc = WW8Fib::GetFIBCharset(p->chs);
- if ((eEnc == RTL_TEXTENCODING_SYMBOL) || (eEnc == RTL_TEXTENCODING_DONTKNOW))
- eEnc = RTL_TEXTENCODING_MS_1252;
- p->sFontname = String(pVer6->szFfn, eEnc);
-// p->sFontname = String(pVer6->szFfn, RTL_TEXTENCODING_MS_1252);
- if (p->ibszAlt)
- {
- p->sFontname.Append(';');
- p->sFontname += String(pVer6->szFfn+p->ibszAlt, eEnc);
-// RTL_TEXTENCODING_MS_1252 );
- }
- pVer6 = (WW8_FFN_Ver6*)( ((sal_uInt8*)pVer6) + pVer6->cbFfnM1 + 1 );
- }
- }
- else
- {
- WW8_FFN_Ver8* pVer8 = (WW8_FFN_Ver8*)pA;
- sal_uInt8 c2;
- for(sal_uInt16 i=0; i<nMax; ++i, ++p)
- {
- p->cbFfnM1 = pVer8->cbFfnM1;
- c2 = *(((sal_uInt8*)pVer8) + 1);
-
- p->prg = c2 & 0x02;
- p->fTrueType = (c2 & 0x04) >> 2;
- // ein Reserve-Bit ueberspringen
- p->ff = (c2 & 0x70) >> 4;
-
- p->wWeight = SVBT16ToShort( *(SVBT16*)&pVer8->wWeight );
- p->chs = pVer8->chs;
- p->ibszAlt = pVer8->ibszAlt;
-
-#ifdef __WW8_NEEDS_COPY
- {
- sal_uInt8 nLen = 0x28;
- for( sal_uInt16* pTmp = pVer8->szFfn;
- nLen < pVer8->cbFfnM1 + 1 ; ++pTmp, nLen+=2 )
- {
- *pTmp = SVBT16ToShort( *(SVBT16*)pTmp );
- }
- }
-#endif // defined __WW8_NEEDS_COPY
-
- p->sFontname = pVer8->szFfn;
- if (p->ibszAlt)
- {
- p->sFontname.Append(';');
- p->sFontname.Append(pVer8->szFfn+p->ibszAlt);
- }
-
- // Zeiger auf Ursprungsarray einen Font nach hinten setzen
- pVer8 = (WW8_FFN_Ver8*)( ((sal_uInt8*)pVer8) + pVer8->cbFfnM1 + 1 );
- }
- }
- }
- delete[] pA;
-}
-
-const WW8_FFN* WW8Fonts::GetFont( sal_uInt16 nNum ) const
-{
- if( !pFontA || nNum >= nMax )
- return 0;
-
- return &pFontA[ nNum ];
-}
-
-
-
-//-----------------------------------------
-
-
-// Suche zu einem Header / Footer den Index in der WW-Liste von Headern / Footern
-//
-// Pferdefuesse bei WinWord6 und -7:
-// 1) Am Anfang des Einlesens muss WWPLCF_HdFt mit Fib und Dop konstruiert werden
-// 2) Der Haupttext muss sequentiell ueber alle Sections gelesen werden
-// 3) Fuer jedes vorkommende Header / Footer - Attribut des Haupttextes
-// ( Darf pro Section maximal eins sein ) muss UpdateIndex() genau einmal
-// mit dem Parameter des Attributes gerufen werden. Dieser Aufruf muss *nach*
-// dem letzten Aufruf von GetTextPos() passieren.
-// 4) GetTextPos() darf mit genau einem der obenstehen WW_... aufgerufen werden
-// ( nicht verodern ! )
-// -> dann liefert GetTextPos() vielleicht auch ein richtiges Ergebnis
-
-WW8PLCF_HdFt::WW8PLCF_HdFt( SvStream* pSt, WW8Fib& rFib, WW8Dop& rDop )
- : aPLCF( pSt, rFib.fcPlcfhdd , rFib.lcbPlcfhdd , 0 )
-{
- nIdxOffset = 0;
-
- /*
- cmc 23/02/2000: This dop.grpfIhdt has a bit set for each special
- footnote *and endnote!!* seperator,continuation seperator, and
- continuation notice entry, the documentation does not mention the
- endnote seperators, the documentation also gets the index numbers
- backwards when specifiying which bits to test. The bottom six bits
- of this value must be tested and skipped over. Each section's
- grpfIhdt is then tested for the existence of the appropiate headers
- and footers, at the end of each section the nIdxOffset must be updated
- to point to the beginning of the next section's group of headers and
- footers in this PLCF, UpdateIndex does that task.
- */
- for( sal_uInt8 nI = 0x1; nI <= 0x20; nI <<= 1 )
- if( nI & rDop.grpfIhdt ) // Bit gesetzt ?
- nIdxOffset++;
-
- nTextOfs = rFib.ccpText + rFib.ccpFtn; // Groesse des Haupttextes
- // und der Fussnoten
-}
-
-bool WW8PLCF_HdFt::GetTextPos(sal_uInt8 grpfIhdt, sal_uInt8 nWhich, WW8_CP& rStart,
- long& rLen)
-{
- sal_uInt8 nI = 0x01;
- short nIdx = nIdxOffset;
- while (true)
- {
- if( nI & nWhich )
- break; // found
- if( grpfIhdt & nI )
- nIdx++; // uninteresting Header / Footer
- nI <<= 1; // text next bit
- if( nI > 0x20 )
- return false; // not found
- }
- // nIdx ist HdFt-Index
- WW8_CP nEnd;
- void* pData;
-
- aPLCF.SetIdx( nIdx ); // Lookup suitable CP
- aPLCF.Get( rStart, nEnd, pData );
- rLen = nEnd - rStart;
- aPLCF++;
-
- return true;
-}
-
-bool WW8PLCF_HdFt::GetTextPosExact(short nIdx, WW8_CP& rStart, long& rLen)
-{
- WW8_CP nEnd;
- void* pData;
-
- aPLCF.SetIdx( nIdx ); // Lookup suitable CP
- aPLCF.Get( rStart, nEnd, pData );
- rLen = nEnd - rStart;
- return true;
-}
-
-void WW8PLCF_HdFt::UpdateIndex( sal_uInt8 grpfIhdt )
-{
- // Caution: Description is not correct
- for( sal_uInt8 nI = 0x01; nI <= 0x20; nI <<= 1 )
- if( nI & grpfIhdt )
- nIdxOffset++;
-}
-
-//-----------------------------------------
-// WW8Dop
-//-----------------------------------------
-
-WW8Dop::WW8Dop( SvStream& rSt, sal_Int16 nFib, sal_Int32 nPos, sal_Int32 nSize )
-{
- sal_uInt8* pDataPtr = new sal_uInt8[ 500 ];
- sal_uInt8* pData = pDataPtr;
-
- sal_uInt32 nRead = 500 < nSize ? 500 : nSize;
- rSt.Seek( nPos );
- if( 2 > nSize || nRead != rSt.Read( pData, nRead ))
- {
- memset( &nDataStart, 0, (&nDataEnd - &nDataStart) );
- nDopError = ERR_SWG_READ_ERROR; // Error melden
- }
- else
- {
- if( 500 > nRead )
- memset( pData + nRead, 0, 500 - nRead );
-
- // dann mal die Daten auswerten
- sal_uInt32 a32Bit;
- sal_uInt16 a16Bit;
- sal_uInt8 a8Bit;
-
- a16Bit = Get_UShort( pData );
- fFacingPages = 0 != ( a16Bit & 0x0001 ) ;
- fWidowControl = 0 != ( a16Bit & 0x0002 ) ;
- fPMHMainDoc = 0 != ( a16Bit & 0x0004 ) ;
- grfSuppression = ( a16Bit & 0x0018 ) >> 3;
- fpc = ( a16Bit & 0x0060 ) >> 5;
- grpfIhdt = ( a16Bit & 0xff00 ) >> 8;
-
- a16Bit = Get_UShort( pData );
- rncFtn = a16Bit & 0x0003 ;
- nFtn = ( a16Bit & ~0x0003 ) >> 2 ;
-
- a8Bit = Get_Byte( pData );
- fOutlineDirtySave = 0 != ( a8Bit & 0x01 );
-
- a8Bit = Get_Byte( pData );
- fOnlyMacPics = 0 != ( a8Bit & 0x01 );
- fOnlyWinPics = 0 != ( a8Bit & 0x02 );
- fLabelDoc = 0 != ( a8Bit & 0x04 );
- fHyphCapitals = 0 != ( a8Bit & 0x08 );
- fAutoHyphen = 0 != ( a8Bit & 0x10 );
- fFormNoFields = 0 != ( a8Bit & 0x20 );
- fLinkStyles = 0 != ( a8Bit & 0x40 );
- fRevMarking = 0 != ( a8Bit & 0x80 );
-
- a8Bit = Get_Byte( pData );
- fBackup = 0 != ( a8Bit & 0x01 );
- fExactCWords = 0 != ( a8Bit & 0x02 );
- fPagHidden = 0 != ( a8Bit & 0x04 );
- fPagResults = 0 != ( a8Bit & 0x08 );
- fLockAtn = 0 != ( a8Bit & 0x10 );
- fMirrorMargins = 0 != ( a8Bit & 0x20 );
- fReadOnlyRecommended = 0 != ( a8Bit & 0x40 );
- fDfltTrueType = 0 != ( a8Bit & 0x80 );
-
- a8Bit = Get_Byte( pData );
- fPagSuppressTopSpacing = 0 != ( a8Bit & 0x01 );
- fProtEnabled = 0 != ( a8Bit & 0x02 );
- fDispFormFldSel = 0 != ( a8Bit & 0x04 );
- fRMView = 0 != ( a8Bit & 0x08 );
- fRMPrint = 0 != ( a8Bit & 0x10 );
- fWriteReservation = 0 != ( a8Bit & 0x20 );
- fLockRev = 0 != ( a8Bit & 0x40 );
- fEmbedFonts = 0 != ( a8Bit & 0x80 );
-
-
- a8Bit = Get_Byte( pData );
- copts_fNoTabForInd = 0 != ( a8Bit & 0x01 );
- copts_fNoSpaceRaiseLower = 0 != ( a8Bit & 0x02 );
- copts_fSupressSpbfAfterPgBrk = 0 != ( a8Bit & 0x04 );
- copts_fWrapTrailSpaces = 0 != ( a8Bit & 0x08 );
- copts_fMapPrintTextColor = 0 != ( a8Bit & 0x10 );
- copts_fNoColumnBalance = 0 != ( a8Bit & 0x20 );
- copts_fConvMailMergeEsc = 0 != ( a8Bit & 0x40 );
- copts_fSupressTopSpacing = 0 != ( a8Bit & 0x80 );
-
- a8Bit = Get_Byte( pData );
- copts_fOrigWordTableRules = 0 != ( a8Bit & 0x01 );
- copts_fTransparentMetafiles = 0 != ( a8Bit & 0x02 );
- copts_fShowBreaksInFrames = 0 != ( a8Bit & 0x04 );
- copts_fSwapBordersFacingPgs = 0 != ( a8Bit & 0x08 );
-
- dxaTab = Get_Short( pData );
- wSpare = Get_UShort( pData );
- dxaHotZ = Get_UShort( pData );
- cConsecHypLim = Get_UShort( pData );
- wSpare2 = Get_UShort( pData );
- dttmCreated = Get_Long( pData );
- dttmRevised = Get_Long( pData );
- dttmLastPrint = Get_Long( pData );
- nRevision = Get_Short( pData );
- tmEdited = Get_Long( pData );
- cWords = Get_Long( pData );
- cCh = Get_Long( pData );
- cPg = Get_Short( pData );
- cParas = Get_Long( pData );
-
- a16Bit = Get_UShort( pData );
- rncEdn = a16Bit & 0x0003 ;
- nEdn = ( a16Bit & ~0x0003 ) >> 2;
-
- a16Bit = Get_UShort( pData );
- epc = a16Bit & 0x0003 ;
- nfcFtnRef = ( a16Bit & 0x003c ) >> 2;
- nfcEdnRef = ( a16Bit & 0x03c0 ) >> 6;
- fPrintFormData = 0 != ( a16Bit & 0x0400 );
- fSaveFormData = 0 != ( a16Bit & 0x0800 );
- fShadeFormData = 0 != ( a16Bit & 0x1000 );
- fWCFtnEdn = 0 != ( a16Bit & 0x8000 );
-
- cLines = Get_Long( pData );
- cWordsFtnEnd = Get_Long( pData );
- cChFtnEdn = Get_Long( pData );
- cPgFtnEdn = Get_Short( pData );
- cParasFtnEdn = Get_Long( pData );
- cLinesFtnEdn = Get_Long( pData );
- lKeyProtDoc = Get_Long( pData );
-
- a16Bit = Get_UShort( pData );
- wvkSaved = a16Bit & 0x0007 ;
- wScaleSaved = ( a16Bit & 0x0ff8 ) >> 3 ;
- zkSaved = ( a16Bit & 0x3000 ) >> 12;
- fRotateFontW6 = ( a16Bit & 0x4000 ) >> 14;
- iGutterPos = ( a16Bit & 0x8000 ) >> 15;
- /*
- bei nFib >= 103 gehts weiter:
- */
- if( nFib >= 103 )
- {
- a32Bit = Get_ULong( pData );
- fNoTabForInd = ( a32Bit & 0x00000001 ) ;
- fNoSpaceRaiseLower = ( a32Bit & 0x00000002 ) >> 1 ;
- fSupressSpbfAfterPageBreak = ( a32Bit & 0x00000004 ) >> 2 ;
- fWrapTrailSpaces = ( a32Bit & 0x00000008 ) >> 3 ;
- fMapPrintTextColor = ( a32Bit & 0x00000010 ) >> 4 ;
- fNoColumnBalance = ( a32Bit & 0x00000020 ) >> 5 ;
- fConvMailMergeEsc = ( a32Bit & 0x00000040 ) >> 6 ;
- fSupressTopSpacing = ( a32Bit & 0x00000080 ) >> 7 ;
- fOrigWordTableRules = ( a32Bit & 0x00000100 ) >> 8 ;
- fTransparentMetafiles = ( a32Bit & 0x00000200 ) >> 9 ;
- fShowBreaksInFrames = ( a32Bit & 0x00000400 ) >> 10 ;
- fSwapBordersFacingPgs = ( a32Bit & 0x00000800 ) >> 11 ;
- fSuppressTopSpacingMac5 = ( a32Bit & 0x00010000 ) >> 16 ;
- fTruncDxaExpand = ( a32Bit & 0x00020000 ) >> 17 ;
- fPrintBodyBeforeHdr = ( a32Bit & 0x00040000 ) >> 18 ;
- fNoLeading = ( a32Bit & 0x00080000 ) >> 19 ;
- fMWSmallCaps = ( a32Bit & 0x00200000 ) >> 21 ;
-
- fUsePrinterMetrics = ( a32Bit & 0x80000000 ) >> 31 ;
- }
-
- /*
- bei nFib > 105 gehts weiter:
- */
- if( nFib > 105 )
- {
- adt = Get_Short( pData );
-
- doptypography.ReadFromMem(pData);
-
- memcpy( &dogrid, pData, sizeof( WW8_DOGRID ));
- pData += sizeof( WW8_DOGRID );
-
- a16Bit = Get_UShort( pData );
- // die untersten 9 Bit sind uninteressant
- fHtmlDoc = ( a16Bit & 0x0200 ) >> 9 ;
- fSnapBorder = ( a16Bit & 0x0800 ) >> 11 ;
- fIncludeHeader = ( a16Bit & 0x1000 ) >> 12 ;
- fIncludeFooter = ( a16Bit & 0x2000 ) >> 13 ;
- fForcePageSizePag = ( a16Bit & 0x4000 ) >> 14 ;
- fMinFontSizePag = ( a16Bit & 0x8000 ) >> 15 ;
-
- a16Bit = Get_UShort( pData );
- fHaveVersions = 0 != ( a16Bit & 0x0001 );
- fAutoVersion = 0 != ( a16Bit & 0x0002 );
-
- pData += 12;
-
- cChWS = Get_Long( pData );
- cChWSFtnEdn = Get_Long( pData );
- grfDocEvents = Get_Long( pData );
-
- pData += 4+30+8;
-
- cDBC = Get_Long( pData );
- cDBCFtnEdn = Get_Long( pData );
-
- pData += 1 * sizeof( long );
-
- nfcFtnRef = Get_Short( pData );
- nfcEdnRef = Get_Short( pData );
- hpsZoonFontPag = Get_Short( pData );
- dywDispPag = Get_Short( pData );
- }
- }
- delete[] pDataPtr;
-}
-
-WW8Dop::WW8Dop()
-{
- // first set everything to a default of 0
- memset( &nDataStart, 0, (&nDataEnd - &nDataStart) );
-
- fWidowControl = 1;
- fpc = 1;
- nFtn = 1;
- fOutlineDirtySave = 1;
- fHyphCapitals = 1;
- fBackup = 1;
- fPagHidden = 1;
- fPagResults = 1;
- fDfltTrueType = 1;
-
- /*
- Writer acts like this all the time at the moment, ideally we need an
- option for these two as well to import word docs that are not like
- this by default
- */
- fNoLeading = 1;
- fUsePrinterMetrics = 1;
-
- fRMView = 1;
- fRMPrint = 1;
- dxaTab = 0x2d0;
- dxaHotZ = 0x168;
- dttmCreated = 0x45FBAC69;
- dttmRevised = 0x45FBAC69;
- nRevision = 1;
- nEdn = 1;
-
- epc = 3;
- nfcEdnRef = 2;
- fShadeFormData = 1;
-
- wvkSaved = 2;
- wScaleSaved = 100;
- zkSaved = 0;
-
- lvl = 9;
- fIncludeHeader = 1;
- fIncludeFooter = 1;
-
- cChWS = /**!!**/ 0;
- cChWSFtnEdn = /**!!**/ 0;
-
- cDBC = /**!!**/ 0;
- cDBCFtnEdn = /**!!**/ 0;
-}
-
-sal_uInt32 WW8Dop::GetCompatabilityOptions() const
-{
- sal_uInt32 a32Bit = 0;
- if (fNoTabForInd) a32Bit |= 0x00000001;
- if (fNoSpaceRaiseLower) a32Bit |= 0x00000002;
- if (fSupressSpbfAfterPageBreak) a32Bit |= 0x00000004;
- if (fWrapTrailSpaces) a32Bit |= 0x00000008;
- if (fMapPrintTextColor) a32Bit |= 0x00000010;
- if (fNoColumnBalance) a32Bit |= 0x00000020;
- if (fConvMailMergeEsc) a32Bit |= 0x00000040;
- if (fSupressTopSpacing) a32Bit |= 0x00000080;
- if (fOrigWordTableRules) a32Bit |= 0x00000100;
- if (fTransparentMetafiles) a32Bit |= 0x00000200;
- if (fShowBreaksInFrames) a32Bit |= 0x00000400;
- if (fSwapBordersFacingPgs) a32Bit |= 0x00000800;
- if (fSuppressTopSpacingMac5) a32Bit |= 0x00010000;
- if (fTruncDxaExpand) a32Bit |= 0x00020000;
- if (fPrintBodyBeforeHdr) a32Bit |= 0x00040000;
- if (fNoLeading) a32Bit |= 0x00080000;
- if (fMWSmallCaps) a32Bit |= 0x00200000;
- if (fUsePrinterMetrics) a32Bit |= 0x80000000;
- return a32Bit;
-}
-
-bool WW8Dop::Write(SvStream& rStrm, WW8Fib& rFib) const
-{
- sal_Int32 nLen = 8 == rFib.nVersion ? 0x220 : 84;
- rFib.fcDop = rStrm.Tell();
- rFib.lcbDop = nLen;
-
- sal_uInt8 aData[ 0x220 ];
- memset( aData, 0, 0x220 );
- sal_uInt8* pData = aData;
-
- // dann mal die Daten auswerten
- sal_uInt16 a16Bit;
- sal_uInt8 a8Bit;
-
- a16Bit = 0;
- if (fFacingPages)
- a16Bit |= 0x0001;
- if (fWidowControl)
- a16Bit |= 0x0002;
- if (fPMHMainDoc)
- a16Bit |= 0x0004;
- a16Bit |= ( 0x0018 & (grfSuppression << 3));
- a16Bit |= ( 0x0060 & (fpc << 5));
- a16Bit |= ( 0xff00 & (grpfIhdt << 8));
- Set_UInt16( pData, a16Bit );
-
- a16Bit = 0;
- a16Bit |= ( 0x0003 & rncFtn );
- a16Bit |= ( ~0x0003 & (nFtn << 2));
- Set_UInt16( pData, a16Bit );
-
- a8Bit = 0;
- if( fOutlineDirtySave ) a8Bit |= 0x01;
- Set_UInt8( pData, a8Bit );
-
- a8Bit = 0;
- if( fOnlyMacPics ) a8Bit |= 0x01;
- if( fOnlyWinPics ) a8Bit |= 0x02;
- if( fLabelDoc ) a8Bit |= 0x04;
- if( fHyphCapitals ) a8Bit |= 0x08;
- if( fAutoHyphen ) a8Bit |= 0x10;
- if( fFormNoFields ) a8Bit |= 0x20;
- if( fLinkStyles ) a8Bit |= 0x40;
- if( fRevMarking ) a8Bit |= 0x80;
- Set_UInt8( pData, a8Bit );
-
- a8Bit = 0;
- if( fBackup ) a8Bit |= 0x01;
- if( fExactCWords ) a8Bit |= 0x02;
- if( fPagHidden ) a8Bit |= 0x04;
- if( fPagResults ) a8Bit |= 0x08;
- if( fLockAtn ) a8Bit |= 0x10;
- if( fMirrorMargins ) a8Bit |= 0x20;
- if( fReadOnlyRecommended ) a8Bit |= 0x40;
- if( fDfltTrueType ) a8Bit |= 0x80;
- Set_UInt8( pData, a8Bit );
-
- a8Bit = 0;
- if( fPagSuppressTopSpacing ) a8Bit |= 0x01;
- if( fProtEnabled ) a8Bit |= 0x02;
- if( fDispFormFldSel ) a8Bit |= 0x04;
- if( fRMView ) a8Bit |= 0x08;
- if( fRMPrint ) a8Bit |= 0x10;
- if( fWriteReservation ) a8Bit |= 0x20;
- if( fLockRev ) a8Bit |= 0x40;
- if( fEmbedFonts ) a8Bit |= 0x80;
- Set_UInt8( pData, a8Bit );
-
-
- a8Bit = 0;
- if( copts_fNoTabForInd ) a8Bit |= 0x01;
- if( copts_fNoSpaceRaiseLower ) a8Bit |= 0x02;
- if( copts_fSupressSpbfAfterPgBrk ) a8Bit |= 0x04;
- if( copts_fWrapTrailSpaces ) a8Bit |= 0x08;
- if( copts_fMapPrintTextColor ) a8Bit |= 0x10;
- if( copts_fNoColumnBalance ) a8Bit |= 0x20;
- if( copts_fConvMailMergeEsc ) a8Bit |= 0x40;
- if( copts_fSupressTopSpacing ) a8Bit |= 0x80;
- Set_UInt8( pData, a8Bit );
-
- a8Bit = 0;
- if( copts_fOrigWordTableRules ) a8Bit |= 0x01;
- if( copts_fTransparentMetafiles ) a8Bit |= 0x02;
- if( copts_fShowBreaksInFrames ) a8Bit |= 0x04;
- if( copts_fSwapBordersFacingPgs ) a8Bit |= 0x08;
- Set_UInt8( pData, a8Bit );
-
- Set_UInt16( pData, dxaTab );
- Set_UInt16( pData, wSpare );
- Set_UInt16( pData, dxaHotZ );
- Set_UInt16( pData, cConsecHypLim );
- Set_UInt16( pData, wSpare2 );
- Set_UInt32( pData, dttmCreated );
- Set_UInt32( pData, dttmRevised );
- Set_UInt32( pData, dttmLastPrint );
- Set_UInt16( pData, nRevision );
- Set_UInt32( pData, tmEdited );
- Set_UInt32( pData, cWords );
- Set_UInt32( pData, cCh );
- Set_UInt16( pData, cPg );
- Set_UInt32( pData, cParas );
-
- a16Bit = 0;
- a16Bit |= ( 0x0003 & rncEdn );
- a16Bit |= (~0x0003 & ( nEdn << 2));
- Set_UInt16( pData, a16Bit );
-
- a16Bit = 0;
- a16Bit |= (0x0003 & epc );
- a16Bit |= (0x003c & (nfcFtnRef << 2));
- a16Bit |= (0x03c0 & (nfcEdnRef << 6));
- if( fPrintFormData ) a16Bit |= 0x0400;
- if( fSaveFormData ) a16Bit |= 0x0800;
- if( fShadeFormData ) a16Bit |= 0x1000;
- if( fWCFtnEdn ) a16Bit |= 0x8000;
- Set_UInt16( pData, a16Bit );
-
- Set_UInt32( pData, cLines );
- Set_UInt32( pData, cWordsFtnEnd );
- Set_UInt32( pData, cChFtnEdn );
- Set_UInt16( pData, cPgFtnEdn );
- Set_UInt32( pData, cParasFtnEdn );
- Set_UInt32( pData, cLinesFtnEdn );
- Set_UInt32( pData, lKeyProtDoc );
-
- a16Bit = 0;
- if (wvkSaved)
- a16Bit |= 0x0007;
- a16Bit |= (0x0ff8 & (wScaleSaved << 3));
- a16Bit |= (0x3000 & (zkSaved << 12));
- Set_UInt16( pData, a16Bit );
-
- if( 8 == rFib.nVersion )
- {
- Set_UInt32(pData, GetCompatabilityOptions());
-
- Set_UInt16( pData, adt );
-
- doptypography.WriteToMem(pData);
-
- memcpy( pData, &dogrid, sizeof( WW8_DOGRID ));
- pData += sizeof( WW8_DOGRID );
-
- a16Bit = 0x12; // lvl auf 9 setzen
- if( fHtmlDoc ) a16Bit |= 0x0200;
- if( fSnapBorder ) a16Bit |= 0x0800;
- if( fIncludeHeader ) a16Bit |= 0x1000;
- if( fIncludeFooter ) a16Bit |= 0x2000;
- if( fForcePageSizePag ) a16Bit |= 0x4000;
- if( fMinFontSizePag ) a16Bit |= 0x8000;
- Set_UInt16( pData, a16Bit );
-
- a16Bit = 0;
- if( fHaveVersions ) a16Bit |= 0x0001;
- if( fAutoVersion ) a16Bit |= 0x0002;
- Set_UInt16( pData, a16Bit );
-
- pData += 12;
-
- Set_UInt32( pData, cChWS );
- Set_UInt32( pData, cChWSFtnEdn );
- Set_UInt32( pData, grfDocEvents );
-
- pData += 4+30+8;
-
- Set_UInt32( pData, cDBC );
- Set_UInt32( pData, cDBCFtnEdn );
-
- pData += 1 * sizeof( long );
-
- Set_UInt16( pData, nfcFtnRef );
- Set_UInt16( pData, nfcEdnRef );
- Set_UInt16( pData, hpsZoonFontPag );
- Set_UInt16( pData, dywDispPag );
-
- //500 -> 508, Appear to be repeated here in 2000+
- pData += 8;
- Set_UInt32(pData, GetCompatabilityOptions());
- }
- rStrm.Write( aData, nLen );
- return 0 == rStrm.GetError();
-}
-
-void WW8DopTypography::ReadFromMem(sal_uInt8 *&pData)
-{
- sal_uInt16 a16Bit = Get_UShort(pData);
- fKerningPunct = (a16Bit & 0x0001);
- iJustification = (a16Bit & 0x0006) >> 1;
- iLevelOfKinsoku = (a16Bit & 0x0018) >> 3;
- f2on1 = (a16Bit & 0x0020) >> 5;
- reserved1 = (a16Bit & 0x03C0) >> 6;
- reserved2 = (a16Bit & 0xFC00) >> 10;
-
- cchFollowingPunct = Get_Short(pData);
- cchLeadingPunct = Get_Short(pData);
-
- sal_Int16 i;
- for (i=0; i < nMaxFollowing; ++i)
- rgxchFPunct[i] = Get_Short(pData);
- for (i=0; i < nMaxLeading; ++i)
- rgxchLPunct[i] = Get_Short(pData);
-
- rgxchFPunct[cchFollowingPunct]=0;
- rgxchLPunct[cchLeadingPunct]=0;
-}
-
-void WW8DopTypography::WriteToMem(sal_uInt8 *&pData) const
-{
- sal_uInt16 a16Bit = fKerningPunct;
- a16Bit |= (iJustification << 1) & 0x0006;
- a16Bit |= (iLevelOfKinsoku << 3) & 0x0018;
- a16Bit |= (f2on1 << 5) & 0x002;
- a16Bit |= (reserved1 << 6) & 0x03C0;
- a16Bit |= (reserved2 << 10) & 0xFC00;
- Set_UInt16(pData,a16Bit);
-
- Set_UInt16(pData,cchFollowingPunct);
- Set_UInt16(pData,cchLeadingPunct);
-
- sal_Int16 i;
- for (i=0; i < nMaxFollowing; ++i)
- Set_UInt16(pData,rgxchFPunct[i]);
- for (i=0; i < nMaxLeading; ++i)
- Set_UInt16(pData,rgxchLPunct[i]);
-}
-
-sal_uInt16 WW8DopTypography::GetConvertedLang() const
-{
- sal_uInt16 nLang;
- //I have assumed peoples republic/taiwan == simplified/traditional
-
- //This isn't a documented issue, so we might have it all wrong,
- //i.e. i.e. whats with the powers of two ?
-
- /*
- #84082#
- One example of 3 for reserved1 which was really Japanese, perhaps last bit
- is for some other use ?, or redundant. If more examples trigger the assert
- we might be able to figure it out.
- */
- switch(reserved1 & 0xE)
- {
- case 2: //Japan
- nLang = LANGUAGE_JAPANESE;
- break;
- case 4: //Chinese (Peoples Republic)
- nLang = LANGUAGE_CHINESE_SIMPLIFIED;
- break;
- case 6: //Korean
- nLang = LANGUAGE_KOREAN;
- break;
- case 8: //Chinese (Taiwan)
- nLang = LANGUAGE_CHINESE_TRADITIONAL;
- break;
- default:
- ASSERT(!this, "Unknown MS Asian Typography language, report");
- nLang = LANGUAGE_CHINESE;
- break;
- case 0:
- //And here we have the possibility that it says 2, but its really
- //a bug and only japanese level 2 has been selected after a custom
- //version was chosen on last save!
- nLang = LANGUAGE_JAPANESE;
- break;
- }
- return nLang;
-}
-
-//-----------------------------------------
-// Sprms
-//-----------------------------------------
-sal_uInt16 wwSprmParser::GetSprmTailLen(sal_uInt16 nId, const sal_uInt8* pSprm)
- const
-{
- SprmInfo aSprm = GetSprmInfo(nId);
- sal_uInt16 nL = 0; // number of Bytes to read
-
- //sprmPChgTabs
- switch( nId )
- {
- case 23:
- case 0xC615:
- if( pSprm[1 + mnDelta] != 255 )
- nL = pSprm[1 + mnDelta] + aSprm.nLen;
- else
- {
- sal_uInt8 nDel = pSprm[2 + mnDelta];
- sal_uInt8 nIns = pSprm[3 + mnDelta + 4 * nDel];
-
- nL = 2 + 4 * nDel + 3 * nIns;
- }
- break;
- case 0xD608:
- nL = SVBT16ToShort( &pSprm[1 + mnDelta] );
- break;
- default:
- switch (aSprm.nVari)
- {
- case L_FIX:
- nL = aSprm.nLen; // Excl. Token
- break;
- case L_VAR:
- // Variable 1-Byte Length?
- // Excl. Token + Var-Lengthbyte
- nL = pSprm[1 + mnDelta] + aSprm.nLen;
- break;
- case L_VAR2:
- // Variable 2-Byte Length?
- // Excl. Token + Var-Lengthbyte
- nL = SVBT16ToShort( &pSprm[1 + mnDelta] ) + aSprm.nLen - 1;
- break;
- default:
- ASSERT(!this, "Unknown sprm varient");
- break;
- }
- break;
- }
- return nL;
-}
-
-int wwSprmParser::CountSprms(const sal_uInt8* pSp, long nSprmSiz,
- const wwSprmSequence* pIgnoreSprms) const
-{
- sal_uInt16 nMySprms = 0;
- sal_uInt16 i=0;
- while (i+1+mnDelta < nSprmSiz)
- {
- sal_uInt16 nSpId = GetSprmId(pSp);
-
- if( !nSpId )
- break;
-
- sal_uInt16 nSpLen = GetSprmSize(nSpId, pSp);
- // increase pointers so to point to next sprm
- i += nSpLen;
- pSp += nSpLen;
-
- if (!pIgnoreSprms || !pIgnoreSprms->search(nSpId))
- ++nMySprms;
- }
- return nMySprms;
-}
-
-// one or two bytes at the beginning at the sprm id
-sal_uInt16 wwSprmParser::GetSprmId(const sal_uInt8* pSp) const
-{
- ASSERT_RET_ON_FAIL(pSp, "Why GetSprmId with pSp of 0", 0);
-
- sal_uInt16 nId = 0;
- switch (mnVersion) // 6 stands for "6 OR 7", 7 stands for "ONLY 7"
- {
- case 6:
- case 7:
- nId = *pSp;
- if (0x0100 < nId)
- nId = 0;
- break;
- default:
- case 8:
- nId = SVBT16ToShort(pSp);
- if (0x0800 > nId)
- nId = 0;
- break;
- }
- return nId;
-}
-
-// with tokens and length byte
-sal_uInt16 wwSprmParser::GetSprmSize(sal_uInt16 nId, const sal_uInt8* pSprm) const
-{
- return GetSprmTailLen(nId, pSprm) + 1 + mnDelta + SprmDataOfs(nId);
-}
-
-sal_uInt8 wwSprmParser::SprmDataOfs(sal_uInt16 nId) const
-{
- return GetSprmInfo(nId).nVari;
-}
-
-sal_uInt16 wwSprmParser::DistanceToData(sal_uInt16 nId) const
-{
- return 1 + mnDelta + SprmDataOfs(nId);
-}
-
-SEPr::SEPr() :
- bkc(2), fTitlePage(0), fAutoPgn(0), nfcPgn(0), fUnlocked(0), cnsPgn(0),
- fPgnRestart(0), fEndNote(1), lnc(0), grpfIhdt(0), nLnnMod(0), dxaLnn(0),
- dxaPgn(720), dyaPgn(720), fLBetween(0), vjc(0), dmBinFirst(0),
- dmBinOther(0), dmPaperReq(0), fPropRMark(0), ibstPropRMark(0),
- dttmPropRMark(0), dxtCharSpace(0), dyaLinePitch(0), clm(0), reserved1(0),
- dmOrientPage(0), iHeadingPgn(0), pgnStart(1), lnnMin(0), wTextFlow(0),
- reserved2(0), pgbApplyTo(0), pgbPageDepth(0), pgbOffsetFrom(0),
- xaPage(12242), yaPage(15842), xaPageNUp(12242), yaPageNUp(15842),
- dxaLeft(1800), dxaRight(1800), dyaTop(1440), dyaBottom(1440), dzaGutter(0),
- dyaHdrTop(720), dyaHdrBottom(720), ccolM1(0), fEvenlySpaced(1),
- reserved3(0), fBiDi(0), fFacingCol(0), fRTLGutter(0), fRTLAlignment(0),
- dxaColumns(720), dxaColumnWidth(0), dmOrientFirst(0), fLayout(0),
- reserved4(0)
-{
- memset(rgdxaColumnWidthSpacing, 0, sizeof(rgdxaColumnWidthSpacing));
-}
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/dump/ww8scan.hxx b/sw/source/filter/ww8/dump/ww8scan.hxx
deleted file mode 100644
index 02eba9b6a8e6..000000000000
--- a/sw/source/filter/ww8/dump/ww8scan.hxx
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _WW8SCAN_HXX
-#define _WW8SCAN_HXX
-
-
-#ifndef LONG_MAX
-#include <limits.h>
-#endif
-#ifndef _SAL_TYPES_H
-#include <sal/types.h>
-#endif
-#include <tools/solar.h> // UINTXX
-#ifndef _TABLE_HXX //autogen
-#include <tools/table.hxx>
-#endif
-#include <tools/datetime.hxx>
-#include <tools/stream.hxx>
-#include <tools/string.hxx>
-
-
-#define _SVSTDARR_STRINGS
-#include <svl/svstdarr.hxx>
-
-#ifndef WW8STRUC_HXX
-#include <ww8struc.hxx> // FIB, STSHI, STD
-#endif
-
-#include <ww8scan.hxx>
-
-using namespace nsHdFtFlags;
-
-
-#ifndef DELETEZ
-#define DELETEZ( p ) ( delete( p ), p = 0 )
-#endif
-
-
-//class SvStream;
-class UShortStk;
-class WW8Fib;
-class WW8ScannerBase;
-class WW8PLCFspecial;
-struct WW8PLCFxDesc;
-class WW8PLCFx_PCD;
-class SvUShortsSort;
-
-
-String WW8ReadPString( SvStream& rStrm, rtl_TextEncoding eEnc,
- sal_Bool bAtEndSeekRel1 = sal_True );
-
-// Folgende Methode liest einen 2-byter-UNICODE-String ein:
-// - falls bAtEndSeekRel1 gesetzt ist, wird am Ende genau EIN Byte uebersprungen,
-// - falls nChars (die Zeichen-Anzahl, NICHT die Byte-Anzahl) nicht gesetzt ist,
-// wird das erste sal_uInt16 als Lannengenangabe interpretiert,
-// ansonsten als erstes String-Zeichen genommen.
-String WW8Read_xstz(SvStream& rStrm,
- sal_uInt16 nChars,
- sal_Bool bAtEndSeekRel1);
-
-
-// read array of strings (see MS documentation: STring TaBle stored in File)
-// returns NOT the original pascal strings but an array of converted char*
-//
-// attention: the *extra data* of each string are SKIPPED and ignored
-
-/* to be optimized like this: */
-void WW8ReadSTTBF( sal_Bool bVer8, SvStream& rStrm,
- sal_uInt32 nStart, sal_Int32 nLen, sal_uInt16 nSkip,
- rtl_TextEncoding eCS,
- SvStrings &rArray, SvStrings* pExtraArray = 0 );
-
-
-
-sal_uInt16 WW8GetSprmId( sal_uInt8 nVersion, sal_uInt8* pSp, sal_uInt8* pDelta = 0 );
-short WW8GetSprmSizeNetto( sal_uInt8 nVersion, sal_uInt8* pSprm, sal_uInt16* pId );
-short WW8GetSprmSizeBrutto( sal_uInt8 nVersion, sal_uInt8* pSprm, sal_uInt16* pId );
-sal_uInt8 WW8SprmDataOfs( sal_uInt16 nId );
-
-struct WW8FieldDesc
-{
- long nLen; // Gesamtlaenge ( zum Text ueberlesen )
- WW8_CP nSCode; // Anfang Befehlscode
- long nLCode; // Laenge
- WW8_CP nSRes; // Anfang Ergebnis
- long nLRes; // Laenge ( == 0, falls kein Ergebnis )
- sal_uInt16 nId; // WW-Id fuer Felder
- sal_uInt8 nOpt; // WW-Flags ( z.B.: vom User geaendert )
- sal_Bool bCodeNest:1; // Befehl rekursiv verwendet
- sal_Bool bResNest:1; // Befehl in Resultat eingefuegt
-};
-
-sal_Bool WW8GetFieldPara( sal_uInt8 nVersion, WW8PLCFspecial& rPLCF, WW8FieldDesc& rF );
-
-
-struct WW8PLCFxSave1
-{
- sal_uLong nPLCFxPos;
- sal_uLong nPLCFxPos2; // fuer PLCF_Cp_Fkp: PieceIter-Pos
- long nPLCFxMemOfs;
- WW8_CP nAttrStart;
- WW8_CP nAttrEnd;
- sal_Bool bLineEnd;
-};
-
-
-/*
- u.a. fuer Felder, also genausoviele Attr wie Positionen,
- falls Ctor-Param bNoEnd = false
-*/
-class WW8PLCFspecial // Iterator fuer PLCFs
-{
- sal_Int32* pPLCF_PosArray; // Pointer auf Pos-Array und auf ganze Struktur
- sal_uInt8* pPLCF_Contents; // Pointer auf Inhalts-Array-Teil des Pos-Array
- long nIMax; // Anzahl der Elemente
- long nIdx; // Merker, wo wir gerade sind
- long nStru;
-
-public:
- WW8PLCFspecial( SvStream* pSt, long nFilePos, long nPLCF,
- long nStruct, long nStartPos = -1, sal_Bool bNoEnd = sal_False );
- ~WW8PLCFspecial(){ delete( pPLCF_PosArray ); pPLCF_PosArray = 0; }
- sal_uLong GetIdx() const { return (sal_uLong)nIdx; }
- void SetIdx( sal_uLong nI ) { nIdx = (long)nI; } // geht ueber Nummer
- long GetIMax(){ return nIMax; }
- sal_Bool SeekPos( long nPos ); // geht ueber FC- bzw. CP-Wert
- // bzw. naechste groesseren Wert
- sal_Bool SeekPosExact( long nPos );
- long Where() { return ( nIdx >= nIMax ) ? LONG_MAX : pPLCF_PosArray[nIdx]; }
- sal_Bool Get( long& rStart, void*& rpValue );
- sal_Bool GetData( long nIdx, long& rPos, void*& rpValue );
-
- const void* GetData( long nIdx ) const {
- return ( nIdx >= nIMax ) ? 0 : (const void*)&pPLCF_Contents[nIdx * nStru]; }
- long GetPos( long nIdx ){
- return ( nIdx >= nIMax ) ? LONG_MAX : pPLCF_PosArray[nIdx]; }
-
- WW8PLCFspecial& operator ++( int ) { nIdx++; return *this; }
- WW8PLCFspecial& operator --( int ) { nIdx--; return *this; }
-};
-
-
-
-
-/*
- simple Iterator for SPRMs
-*/
-class WW8SprmIter
-{
- // these members will be updated
- sal_uInt8* pSprms; // remaining part of the SPRMs ( == start of akt. SPRM)
- sal_uInt8* pAktParams; // start of akt. SPRM's parameters
- sal_uInt16 nAktId;
- short nAktSizeBrutto;
-
- // these members will *not* be updated by UpdateMyMembers()
- sal_uInt8 nVersion;
- sal_uInt8 nDelta;
- short nRemLen; // length of remaining SPRMs (including akt. SPRM)
-
- void UpdateMyMembers();
-public:
- WW8SprmIter( sal_uInt8* pSprms_, short nLen_, sal_uInt8 nVersion_ );
- void SetSprms( sal_uInt8* pSprms_, short nLen_ );
- sal_uInt8* operator ++( int );
- sal_uInt8* GetSprms() const { return ( pSprms && (0 < nRemLen) )
- ? pSprms
- : 0; }
- sal_uInt8* GetAktParams() const { return pAktParams; }
- sal_uInt16 GetAktId() const { return nAktId; }
-};
-
-
-
-/*
- u.a. fuer FKPs auf normale Attr., also ein Attr weniger als Positionen
-*/
-class WW8PLCF // Iterator fuer PLCFs
-{
- sal_Int32* pPLCF_PosArray; // Pointer auf Pos-Array und auf ganze Struktur
- sal_uInt8* pPLCF_Contents; // Pointer auf Inhalts-Array-Teil des Pos-Array
- long nIMax; // Anzahl der Elemente
- long nIdx;
- long nStru;
-
- void ReadPLCF( SvStream* pSt, long nFilePos, long nPLCF );
-
- /*
- Falls im Dok ein PLC fehlt und die FKPs solo dastehen,
- machen wir uns hiermit einen PLC:
- */
- void GeneratePLCF( SvStream* pSt, long nPN, long ncpN );
-
-public:
- WW8PLCF( SvStream* pSt, long nFilePos, long nPLCF,
- long nStruct, long nStartPos = -1 );
-
- /*
- folgender Ctor generiert ggfs. einen PLC aus nPN und ncpN
- */
- WW8PLCF( SvStream* pSt, long nFilePos, long nPLCF,
- long nStruct, long nStartPos, long nPN, long ncpN );
-
- ~WW8PLCF(){ delete( pPLCF_PosArray ); pPLCF_PosArray = 0; }
- sal_uLong GetIdx() const { return (sal_uLong)nIdx; }
- void SetIdx( sal_uLong nI ) { nIdx = (long)nI; }
- long GetIMax(){ return nIMax; }
- sal_Bool SeekPos( long nPos );
- long Where();
- sal_Bool Get( long& rStart, long& rEnd, void*& rpValue );
- WW8PLCF& operator ++( int ) { if( nIdx < nIMax ) nIdx++; return *this; }
-
- const void* GetData( long nIdx ) const {
- return ( nIdx >= nIMax ) ? 0 : (const void*)&pPLCF_Contents[nIdx * nStru]; }
-};
-
-
-DECLARE_TABLE( WW8Pcd_FC_sortArr, sal_Int32 )
-
-
-/*
- fuer Piece Table (bei Schnellspeicherung)
-*/
-class WW8PLCFpcd
-{
-friend class WW8PLCFpcd_Iter;
- WW8Pcd_FC_sortArr aFC_sort; // sorted PCD entries by FC
- sal_Int32* pPLCF_PosArray; // Pointer auf Pos-Array und auf ganze Struktur
- sal_uInt8* pPLCF_Contents; // Pointer auf Inhalts-Array-Teil des Pos-Array
- long nIMax;
- long nStru;
-
-public:
- WW8PLCFpcd( SvStream* pSt, long nFilePos, long nPLCF, long nStruct );
- ~WW8PLCFpcd(){ delete( pPLCF_PosArray ); }
- sal_uLong FindIdx( WW8_FC nFC ) const;
-};
-
-/*
- mehrere WW8PLCFpcd_Iter koennen auf die gleiche WW8PLCFpcd zeigen !!!
-*/
-class WW8PLCFpcd_Iter
-{
- WW8PLCFpcd& rPLCF;
- long nIdx;
-
-public:
- WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, long nStartPos = -1 );
-// ~WW8PLCFpcd_Iter() {}
- sal_uLong GetIdx() const { return (sal_uLong)nIdx; }
- void SetIdx( sal_uLong nI ) { nIdx = (long)nI; }
- long GetIMax(){ return rPLCF.nIMax; }
- sal_Bool SeekPos( long nPos );
-// sal_Bool SeekMaxMainFC( WW8Fib& rWwF, long& rMaxPosData );
- long Where();
- sal_Bool Get( long& rStart, long& rEnd, void*& rpValue );
- sal_uLong FindIdx( WW8_FC nFC ) const { return rPLCF.FindIdx( nFC ); }
- WW8PLCFpcd_Iter& operator ++( int ) { if( nIdx < rPLCF.nIMax ) nIdx++; return *this; }
-};
-
-// PLCF-Typ:
-enum ePLCFT{ CHP=0, PAP, SEP, /*HED, FNR, ENR,*/ PLCF_END };
-
-/*
- pure virtual:
-*/
-class WW8PLCFx // virtueller Iterator fuer Piece Table Exceptions
-{
- sal_uInt8 nVersion; // Versionsnummer des FIB
- sal_Bool bIsSprm; // PLCF von Sprms oder von anderem ( Footnote, ... )
-
-public:
- WW8PLCFx( sal_uInt8 nFibVersion, sal_Bool bSprm )
- { bIsSprm = bSprm; nVersion = nFibVersion; }
- virtual ~WW8PLCFx() {}
- sal_Bool IsSprm() { return bIsSprm; }
- virtual sal_uLong GetIdx() const = 0;
- virtual void SetIdx( sal_uLong nIdx ) = 0;
- virtual sal_uLong GetIdx2() const;
- virtual void SetIdx2( sal_uLong nIdx );
- virtual sal_Bool SeekPos( WW8_CP nCpPos ) = 0;
- virtual long Where() = 0;
-// virtual sal_uInt8* GetSprms( long& rStart, long& rEnd, long& rLen );
- virtual void GetSprms( WW8PLCFxDesc* p );
- virtual long GetNoSprms( long& rStart, long&, long& rLen );
- virtual WW8PLCFx& operator ++( int ) = 0;
- virtual sal_uInt16 GetIstd() const { return 0xffff; }
- virtual void Save( WW8PLCFxSave1& rSave ) const;
- virtual void Restore( const WW8PLCFxSave1& rSave );
- sal_uInt8 GetVersion() const { return nVersion; }
-};
-
-enum eCutT { CUT_NONE = 0, CUT_START, CUT_END, CUT_BOTH };
-
-class WW8PLCFx_PCDAttrs : public WW8PLCFx
-{
- WW8PLCFpcd_Iter* pPcdI;
- WW8PLCFx_PCD* pPcd;
- sal_uInt8** pGrpprls; // Attribute an Piece-Table
- SVBT32 aShortSprm; // mini storage: can contain ONE sprm with
- // 1 byte param
- sal_uInt16 nGrpprls; // Attribut Anzahl davon
-
-public:
- WW8PLCFx_PCDAttrs( sal_uInt8 nVersion, WW8PLCFx_PCD* pPLCFx_PCD, WW8ScannerBase* pBase );
- virtual ~WW8PLCFx_PCDAttrs();
- virtual sal_uLong GetIdx() const;
- virtual void SetIdx( sal_uLong nI );
- virtual sal_Bool SeekPos( WW8_CP nCpPos );
- virtual long Where();
- virtual void GetSprms( WW8PLCFxDesc* p );
- virtual WW8PLCFx& operator ++( int );
-
- WW8PLCFpcd_Iter* GetIter() const { return pPcdI; }
-};
-
-class WW8PLCFx_PCD : public WW8PLCFx // Iterator fuer Piece Table
-{
- WW8PLCFpcd_Iter* pPcdI;
- sal_Bool bVer67;
-
-public:
- WW8PLCFx_PCD( sal_uInt8 nVersion, WW8PLCFpcd* pPLCFpcd, WW8_CP nStartCp, sal_Bool bVer67P );
- virtual ~WW8PLCFx_PCD();
- virtual sal_uLong GetIMax() const;
- virtual sal_uLong GetIdx() const;
- virtual void SetIdx( sal_uLong nI );
- virtual sal_Bool SeekPos( WW8_CP nCpPos );
- virtual long Where();
-// virtual void GetSprms( WW8PLCFxDesc* p );
- virtual long GetNoSprms( long& rStart, long&, long& rLen );
- virtual WW8PLCFx& operator ++( int );
- WW8_CP AktPieceStartFc2Cp( WW8_FC nStartPos );
- WW8_FC AktPieceStartCp2Fc( WW8_CP nCp );
- eCutT AktPieceFc2Cp( long& rStartPos, long& rEndPos );
- WW8PLCFpcd_Iter* GetPLCFIter() { return pPcdI; }
-
- static sal_Int32 TransformPieceAddress(long nfc, sal_Bool& bIsUnicodeAddress)
- {
- bIsUnicodeAddress = 0 == (0x40000000 & nfc);
- return bIsUnicodeAddress
- ? nfc
- : (nfc & 0x3fffFFFF) / 2;
- }
- sal_Bool IsVersion67() const { return bVer67; }
-};
-
-
-class WW8PLCFx_Fc_FKP : public WW8PLCFx // Iterator fuer Piece Table Exceptions of Fkps
- // arbeitet nur auf FCs, nicht auf CPs !
- // ( Low-Level )
-{
-
-
- class WW8Fkp // Iterator fuer Formatted Disk Page
- {
- struct WW8Grpprl
- {
- sal_uInt8* pData;
- sal_uInt16 nLen;
- sal_uInt16 nIStd; // nur bei Fkp.Papx gueltig (aktuelle Style-Nr)
- sal_Bool bMustDelete;
- };
-
- WW8Grpprl* pGrpprl; // Pointer of Meta Array (pointing
-
- sal_uInt8* pFkp; // gesamter Fkp
-
- long nItemSize; // entweder 1 Byte oder ein komplettes BX
- long nFilePos; // Offset in Stream where last read of 52 bytes took place
- short nIdx; // Pos-Merker
- ePLCFT ePLCF;
- sal_uInt8 nIMax; // Anzahl der Eintraege
- sal_uInt8 nVersion;
-
- public:
- WW8Fkp( sal_uInt8 nFibVer, SvStream* pFKPStrm, SvStream* pDataStrm,
- long _nFilePos, long nItemSiz,
- ePLCFT ePl, WW8_FC nStartFc = -1 );
- ~WW8Fkp();
- long GetFilePos() const { return nFilePos; }
- sal_uLong GetIdx() const { return (sal_uLong)nIdx; }
- void SetIdx( sal_uLong nI );
- sal_Bool SeekPos( long nPos );
- WW8_FC Where() { return ( nIdx<nIMax)
- ? ((WW8_FC*)pFkp)[nIdx]
- : LONG_MAX; }
- WW8Fkp& operator ++( int ) { if( nIdx < nIMax ) nIdx++;
- return *this; }
- sal_uInt8* Get( WW8_FC& rStart, WW8_FC& rEnd, short& rLen );
- sal_uInt16 GetIstd() const { return pGrpprl[ nIdx ].nIStd; }
-
- /*
- liefert einen echten Pointer auf das Sprm vom Typ nId,
- falls ein solches im Fkp drin ist.
- */
- sal_uInt8* GetLenAndIStdAndSprms(short& rLen);
-
- /*
- ruft GetLenAndIStdAndSprms() auf...
- */
- sal_uInt8* HasSprm( sal_uInt16 nId );
-
- sal_uLong GetParaHeight() const; // fuer Header/Footer bei Papx-Fkps
-
- sal_uInt8 GetVersion() const { return nVersion; }
- };
-
-
- WW8PLCFx_PCDAttrs* pPCDAttrs;
- SvStream* pFKPStrm; // Input-File
- SvStream* pDataStrm; // Input-File
- WW8PLCF* pPLCF;
- WW8Fkp* pFkp;
- WW8_FC nStartFc;
-
- sal_Bool NewFkp();
-
-protected:
- ePLCFT ePLCF;
-
-public:
- WW8PLCFx_Fc_FKP( SvStream* pSt, SvStream* pTblSt, SvStream* pDataSt,
- WW8Fib& rFib, ePLCFT ePl, WW8_FC nStartFcL,
- WW8PLCFx_PCDAttrs* pPLCFx_PCD );
- virtual ~WW8PLCFx_Fc_FKP();
- virtual sal_uLong GetIdx() const;
- virtual void SetIdx( sal_uLong nIdx );
- virtual sal_Bool SeekPos( WW8_FC nFcPos );
- virtual WW8_FC Where();
- sal_uInt8* GetSprms( WW8_FC& rStart, WW8_FC& rEnd, long& rLen );
- virtual WW8PLCFx& operator ++( int );
- virtual sal_uInt16 GetIstd() const;
- void GetPCDSprms( WW8PLCFxDesc& rDesc );
- sal_uInt8* HasSprm( sal_uInt16 nId );
- sal_uLong GetParaHeight() const;
- sal_Bool HasFkp() { return (0 != pFkp); }
-};
-
-// Iterator fuer Piece Table Exceptions of Fkps arbeitet auf CPs (High-Level)
-class WW8PLCFx_Cp_FKP : public WW8PLCFx_Fc_FKP
-{
- const WW8ScannerBase& rSBase;
- WW8PLCFx_PCD* pPcd;
- WW8_CP nAttrStart, nAttrEnd;
- sal_Bool bLineEnd : 1;
- sal_Bool bComplex : 1;
-
- void SearchParaEnd( long nOldEndCp );
-
-public:
- WW8PLCFx_Cp_FKP( SvStream* pSt, SvStream* pTblSt, SvStream* pDataSt, const WW8ScannerBase&
- rBase, ePLCFT ePl );
- virtual ~WW8PLCFx_Cp_FKP();
- void ResetAttrStartEnd();
- sal_uLong GetPCDIMax() const;
- sal_uLong GetPCDIdx() const;
- void SetPCDIdx( sal_uLong nIdx );
- virtual sal_uLong GetIdx2() const;
- virtual void SetIdx2( sal_uLong nIdx );
- virtual sal_Bool SeekPos( WW8_CP nCpPos );
- virtual WW8_CP Where();
- virtual void GetSprms( WW8PLCFxDesc* p );
- virtual WW8PLCFx& operator ++( int );
- virtual void Save( WW8PLCFxSave1& rSave ) const;
- virtual void Restore( const WW8PLCFxSave1& rSave );
-};
-
-
-
-class WW8PLCFx_SEPX : public WW8PLCFx // Iterator fuer Piece Table Exceptions of Sepx
-{
- SvStream* pStrm;
- WW8PLCF* pPLCF;
- sal_uInt8* pSprms;
- sal_uInt16 nArrMax;
- sal_uInt16 nSprmSiz;
-
-public:
- WW8PLCFx_SEPX( SvStream* pSt, SvStream* pTblxySt, WW8Fib& rFib, WW8_CP nStartCp );
- virtual ~WW8PLCFx_SEPX();
- virtual sal_uLong GetIdx() const;
- virtual void SetIdx( sal_uLong nIdx );
- long GetIMax() const { return ( pPLCF ) ? pPLCF->GetIMax() : 0; }
- virtual sal_Bool SeekPos( WW8_CP nCpPos );
- virtual long Where();
- virtual void GetSprms( WW8PLCFxDesc* p );
- virtual WW8PLCFx& operator ++( int );
- sal_uInt8* HasSprm( sal_uInt16 nId ) const;
- sal_uInt8* HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const;
- sal_uInt8* HasSprm( sal_uInt16 nId, sal_uInt8* pOtherSprms, long nOtherSprmSiz ) const;
- sal_Bool Find4Sprms(sal_uInt16 nId1, sal_uInt16 nId2, sal_uInt16 nId3, sal_uInt16 nId4,
- sal_uInt8*& p1, sal_uInt8*& p2, sal_uInt8*& p3, sal_uInt8*& p4 ) const;
- sal_Bool CompareSprms( sal_uInt8* pOtherSprms,
- long nOtherSprmSiz,
- const SvUShortsSort* pIgnoreSprms = 0 ) const;
-};
-
-// Iterator fuer Fuss-/Endnoten und Anmerkungen
-class WW8PLCFx_SubDoc : public WW8PLCFx
-{
- WW8PLCF* pRef;
- WW8PLCF* pTxt;
-
-public:
- WW8PLCFx_SubDoc( SvStream* pSt, sal_uInt8 nVersion, WW8_CP nStartCp,
- long nFcRef, long nLenRef,
- long nFcTxt, long nLenTxt, long nStruc = 0 );
- virtual ~WW8PLCFx_SubDoc();
- virtual sal_uLong GetIdx() const;
- virtual void SetIdx( sal_uLong nIdx );
- virtual sal_Bool SeekPos( WW8_CP nCpPos );
- virtual long Where();
-
- // liefert Reference Descriptoren
- const void* GetData( long nIdx = -1 ) const
- {
- return pRef ? pRef->GetData( -1L == nIdx ? pRef->GetIdx()
- : nIdx ) : 0;
- }
-
- /*
- liefert Angabe, wo Kopf und Fusszeilen-Text zu finden ist
- */
- sal_Bool Get( long& rStart, void*& rpValue );
- virtual long GetNoSprms( long& rStart, long&, long& rLen );
- virtual WW8PLCFx& operator ++( int );
- long Count() { return ( pRef ) ? pRef->GetIMax() : 0; }
-};
-
-class WW8PLCFx_FLD : public WW8PLCFx // Iterator fuer Fuss- und Endnoten
-{
- WW8PLCFspecial* pPLCF;
- WW8Fib& rFib;
-
-public:
- WW8PLCFx_FLD( SvStream* pSt, WW8Fib& rMyFib, short nType, WW8_CP nStartCp );
- virtual ~WW8PLCFx_FLD();
- virtual sal_uLong GetIdx() const;
- virtual void SetIdx( sal_uLong nIdx );
- virtual sal_Bool SeekPos( WW8_CP nCpPos );
- virtual long Where();
- virtual long GetNoSprms( long& rStart, long&, long& rLen );
- virtual WW8PLCFx& operator ++( int );
- sal_Bool GetPara( long nIdx, WW8FieldDesc& rF );
-};
-
-enum eBookStatus { BOOK_NORMAL = 0, BOOK_IGNORE = 0x1, BOOK_ONLY_REF = 0x2 };
-
-class WW8PLCFx_Book : public WW8PLCFx // Iterator fuer Booknotes
-{
- WW8PLCFspecial* pBook[2]; // Start- und EndPosition
- SvStrings aBookNames; // Name
- eBookStatus* pStatus;
- long nIMax; // Anzahl der Booknotes
- sal_uInt16 nIsEnd;
-public:
- WW8PLCFx_Book( SvStream* pSt, SvStream* pTblSt, WW8Fib& rFib, WW8_CP nStartCp );
- virtual ~WW8PLCFx_Book();
- long GetIMax(){ return nIMax; }
- virtual sal_uLong GetIdx() const;
- virtual void SetIdx( sal_uLong nI );
- virtual sal_uLong GetIdx2() const;
- virtual void SetIdx2( sal_uLong nIdx );
- virtual sal_Bool SeekPos( WW8_CP nCpPos );
- virtual long Where();
- virtual long GetNoSprms( long& rStart, long& rEnd, long& rLen );
- virtual WW8PLCFx& operator ++( int );
- const String* GetName() const
- { return ( !nIsEnd && ( (long)(pBook[0]->GetIdx()) < nIMax ) )
- ? aBookNames[ pBook[0]->GetIdx() ]
- : 0;
- }
- WW8_CP GetStartPos() const
- { return ( nIsEnd ) ? LONG_MAX : pBook[0]->Where(); }
- long GetLen() const;
- sal_Bool GetIsEnd() const { return ( nIsEnd ) ? sal_True : sal_False; }
- long GetHandle() const;
- sal_Bool SetStatus( WW8_CP nStartRegion, WW8_CP nEndRegion, const String& rName,
- eBookStatus eStat );
- eBookStatus GetStatus() const;
-};
-
-/*
- hiermit arbeiten wir draussen:
-*/
-struct WW8PLCFManResult
-{
- WW8_CP nCpPos; // Attribut-Anfangsposition
- long nMemLen; // Laenge dazu
- long nCp2OrIdx; // footnote-textpos oder Index in PLCF
- WW8_CP nAktCp; // wird nur vom Aufrufer benutzt
- sal_uInt8* pMemPos; // Mem-Pos fuer Sprms
- sal_uInt16 nSprmId; // Sprm-Id ( 0 = ungueltige Id -> ueberspringen! )
- // (2..255) oder Pseudo-Sprm-Id (256..260)
- // bzw. ab Winword-Ver8 die Sprm-Id (800..)
- sal_uInt8 nFlags; // Absatz- oder Section-Anfang
-};
-
-#define MAN_ANZ_PLCF 12
-
-#define MAN_MASK_NEW_PAP 1 // neue Zeile
-#define MAN_MASK_NEW_SEP 2 // neue Section
-
-
-#define MAN_MAINTEXT 0 // Defines fuer PLCFMan-ctor
-#define MAN_FTN 1
-#define MAN_EDN 2
-#define MAN_HDFT 3
-#define MAN_AND 4
-#define MAN_TXBX 5
-#define MAN_TXBX_HDFT 6
-
-struct WW8PLCFxSaveAll
-{
- WW8PLCFxSave1 aS[MAN_ANZ_PLCF];
-};
-
-/*
- hiermit arbeitet der Manager drinnen:
-*/
-struct WW8PLCFxDesc
-{
- WW8PLCFx* pPLCFx;
- UShortStk* pIdStk;// Speicher fuer Attr-Id fuer Attr-Ende(n)
- sal_uInt8* pMemPos; // wo liegen die Sprm(s)
- long nStartPos;
- long nEndPos;
- long nCp2OrIdx; // wo liegen die NoSprm(s)
- long nSprmsLen; // wie viele Bytes fuer weitere Sprms / Laenge Fussnote
- long nCpOfs; // fuer Offset Header .. Footnote
- sal_Bool bFirstSprm; // fuer Erkennung erster Sprm einer Gruppe
- sal_Bool bRealLineEnd; // sal_False bei Pap-Piece-Ende
- void Save( WW8PLCFxSave1& rSave ) const;
- void Restore( const WW8PLCFxSave1& rSave );
-};
-
-
-#ifndef DUMP
-
-class WW8PLCFMan
-{
- long nCpO; // Origin Cp -- the basis for nNewCp
-
- long nLineEnd; // zeigt *hinter* das <CR>
- long nLastWhereIdxCp; // last result of WhereIdx()
- sal_uInt16 nPLCF; // so viele PLCFe werden verwaltet
- short nManType;
-
- WW8PLCFxDesc aD[MAN_ANZ_PLCF];
- WW8PLCFxDesc *pChp, *pPap, *pSep, *pFld, *pFldTxbx, *pFldTxbxHdft,
- *pFtn, *pEdn,
- *pBkm, *pPcd, *pPcdA, *pAnd;
- WW8PLCFspecial *pFdoa, *pTxbx, *pTxbxBkd;
-
- WW8Fib* pWwFib;
- sal_uInt16* pNoAttrScan; // Attribute komplett(!) ignorieren, die ueber n CPs
- // aufgespannt sind; z.B. bei Char #7 (Zellen-/Zeilenende)
-
- short WhereIdx( sal_Bool* pbStart, long* pPos );
- void AdjustEnds( WW8PLCFxDesc& rDesc );
- void GetNewSprms( WW8PLCFxDesc& rDesc );
- void GetNewNoSprms( WW8PLCFxDesc& rDesc );
- void GetSprmStart( short nIdx, WW8PLCFManResult* pRes );
- void GetSprmEnd( short nIdx, WW8PLCFManResult* pRes );
- void GetNoSprmStart( short nIdx, WW8PLCFManResult* pRes );
- void GetNoSprmEnd( short nIdx, WW8PLCFManResult* pRes );
- void AdvSprm( short nIdx, sal_Bool bStart );
- void AdvNoSprm( short nIdx, sal_Bool bStart );
-
-public:
- WW8PLCFMan( WW8ScannerBase* pBase, short nType, long nStartCp );
- ~WW8PLCFMan();
-
- /*
- Where fragt, an welcher naechsten Position sich irgendein
- Attr aendert...
- */
- long Where();
-
- sal_Bool Get( WW8PLCFManResult* pResult );
- WW8PLCFMan& operator ++( int );
- sal_uInt16 GetColl() const; // liefert aktuellen Style
- WW8PLCFx_FLD* GetFld() const;
- WW8PLCFx_SubDoc* GetEdn() const { return (WW8PLCFx_SubDoc*)pEdn->pPLCFx; }
- WW8PLCFx_SubDoc* GetFtn() const { return (WW8PLCFx_SubDoc*)pFtn->pPLCFx; }
- WW8PLCFx_SubDoc* GetAtn() const { return (WW8PLCFx_SubDoc*)pAnd->pPLCFx; }
- WW8PLCFx_Book* GetBook() const { return (WW8PLCFx_Book*)pBkm->pPLCFx; }
- long GetCpOfs() const { return pChp->nCpOfs; } // fuer Header/Footer...
-
- /*
- fragt, ob *aktueller Absatz* einen Sprm diesen Typs hat
- */
- sal_uInt8* HasParaSprm( sal_uInt16 nId ) const;
-
- /*
- fragt, ob *aktueller Textrun* einen Sprm diesen Typs hat
- */
- sal_uInt8* HasCharSprm( sal_uInt16 nId ) const;
-
- WW8PLCFx_Cp_FKP* GetChpPLCF(){ return (WW8PLCFx_Cp_FKP*)pChp->pPLCFx; }
- WW8PLCFx_Cp_FKP* GetPapPLCF(){ return (WW8PLCFx_Cp_FKP*)pPap->pPLCFx; }
- WW8PLCFx_SEPX* GetSepPLCF(){ return (WW8PLCFx_SEPX*)pSep->pPLCFx; }
- WW8PLCFxDesc* GetPap(){ return pPap; }
- void SeekPos( long nNewCp );
- void SaveAllPLCFx( WW8PLCFxSaveAll& rSave ) const;
- void RestoreAllPLCFx( const WW8PLCFxSaveAll& rSave );
- WW8PLCFspecial* GetFdoa() { return pFdoa; }
- WW8PLCFspecial* GetTxbx() { return pTxbx; }
- WW8PLCFspecial* GetTxbxBkd(){ return pTxbxBkd; }
- short GetManType() { return nManType; }
-};
-
-#endif // !DUMP
-
-class WW8ScannerBase
-{
-friend WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs( sal_uInt8 nVersion, WW8PLCFx_PCD* pPLCFx_PCD, WW8ScannerBase* pBase );
-friend WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP( SvStream*, SvStream*, SvStream*,
- const WW8ScannerBase&, ePLCFT );
-
-#ifdef DUMP
-friend static void DumpPLCFText( WW8_FC nPos, long nLen, long nOfs, sal_Char* pName,
- WW8ScannerBase* pBase );
-friend static void DumpFtnShort( short nId, long nPos, long nFieldLen );
-#else
-friend WW8PLCFMan::WW8PLCFMan( WW8ScannerBase*, short, long );
-friend class SwWw8ImplReader;
-#endif
-
- WW8Fib* pWw8Fib;
- WW8PLCFx_Cp_FKP* pChpPLCF; // Character-Attrs
- WW8PLCFx_Cp_FKP* pPapPLCF; // Para-Attrs
- WW8PLCFx_SEPX* pSepPLCF; // Section-Attrs
- WW8PLCFx_SubDoc* pFtnPLCF; // Footnotes
- WW8PLCFx_SubDoc* pEdnPLCF; // EndNotes
- WW8PLCFx_SubDoc* pAndPLCF; // Anmerkungen
- WW8PLCFx_FLD* pFldPLCF; // Fields in Main Text
- WW8PLCFx_FLD* pFldHdFtPLCF; // Fields in Header / Footer
- WW8PLCFx_FLD* pFldTxbxPLCF; // Fields in Textboxes in Main Text
- WW8PLCFx_FLD* pFldTxbxHdFtPLCF; // Fields in Textboxes in Header / Footer
- WW8PLCFx_FLD* pFldFtnPLCF; // Fields in Footnotes
- WW8PLCFx_FLD* pFldEdnPLCF; // Fields in Endnotes
- WW8PLCFx_FLD* pFldAndPLCF; // Fields in Anmerkungen
- WW8PLCFspecial* pMainFdoa; // Graphic Primitives in Main Text
- WW8PLCFspecial* pHdFtFdoa; // Graphic Primitives in Header / Footer
- WW8PLCFspecial* pMainTxbx; // Textboxen in Main Text
- WW8PLCFspecial* pMainTxbxBkd; // Break-Deskriptoren fuer diese
- WW8PLCFspecial* pHdFtTxbx; // TextBoxen in Header / Footer
- WW8PLCFspecial* pHdFtTxbxBkd; // Break-Deskriptoren fuer diese
- WW8PLCFx_Book* pBook; // Bookmarks
-
- WW8PLCFpcd* pPiecePLCF; // fuer FastSave ( Basis-PLCF ohne Iterator )
- WW8PLCFpcd_Iter* pPieceIter; // fuer FastSave ( Iterator dazu )
- WW8PLCFx_PCD* pPLCFx_PCD; // dito
- WW8PLCFx_PCDAttrs* pPLCFx_PCDAttrs;
- sal_uInt8** pPieceGrpprls; // Attribute an Piece-Table
- sal_uInt16 nPieceGrpprls; // Anzahl davon
- sal_uInt16 nNoAttrScan; // Attribute komplett(!) ignorieren, die ueber n CPs
- // aufgespannt sind; z.B. bei Char #7 (Zellen-/Zeilenende)
-
- WW8PLCFpcd* OpenPieceTable( SvStream* pStr, WW8Fib* pWwF );
- void DeletePieceTable();
-
-public:
- WW8ScannerBase( SvStream* pSt, SvStream* pTblSt, SvStream* pDataSt,
- WW8Fib* pWwF );
- ~WW8ScannerBase();
- sal_Bool AreThereFootnotes() { return pFtnPLCF->Count() > 0; };
- sal_Bool AreThereEndnotes() { return pEdnPLCF->Count() > 0; };
- static DateTime WW8DTTM2DateTime(long lDTTM);
-
- WW8_CP WW8Fc2Cp( WW8_FC nFcPos ) const ;
- WW8_FC WW8Cp2Fc( WW8_CP nCpPos, sal_Bool* pIsUnicode = 0,
- WW8_CP* pNextPieceCp = 0, sal_Bool* pTestFlag = 0 ) const;
- void SetNoAttrScan( sal_uInt16 nValue ) { nNoAttrScan = nValue; };
-
- sal_uInt16 WW8ReadString( SvStream& rStrm, String& rStr,
- WW8_CP nAktStartCp, long nTotalLen,
- rtl_TextEncoding eEnc ) const;
-};
-
-
-
-/** FIB - File Information Block
-*/
-class WW8Fib
-{
-public:
- /*
- von uns verlangte Programm-Version:
- in Ctor wird geprueft, ob sie zu nFib passt
- */
- sal_uInt8 nVersion; // 6 steht fuer "WinWord 6 oder WinWord 95",
- // 7 steht fuer "nur WinWord 95"
- // 8 steht fuer "nur WinWord 97"
- /*
- Fehlerstatus
- */
- sal_uLong nFibError;
- /*
- vom Ctor aus dem FIB gelesene Daten
- (entspricht nur ungefaehr der tatsaechlichen Struktur
- des Winword-FIB)
- */
- sal_uInt16 wIdent; // 0x0 int magic number
- sal_uInt16 nFib; // 0x2 FIB version written
- sal_uInt16 nProduct; // 0x4 product version written by
- sal_Int16 lid; // 0x6 language stamp---localized version;
- WW8_PN pnNext; // 0x8
-
- sal_uInt16 fDot :1; // 0xa 0001
- sal_uInt16 fGlsy :1;
- sal_uInt16 fComplex :1; // 0004 when 1, file is in complex, fast-saved format.
- sal_uInt16 fHasPic :1; // 0008 file contains 1 or more pictures
- sal_uInt16 cQuickSaves :4; // 00F0 count of times file was quicksaved
- sal_uInt16 fEncrypted :1; //0100 1 if file is encrypted, 0 if not
- sal_uInt16 fWhichTblStm :1; //0200 When 0, this fib refers to the table stream
- // named "0Table", when 1, this fib refers to the
- // table stream named "1Table". Normally, a file
- // will have only one table stream, but under unusual
- // circumstances a file may have table streams with
- // both names. In that case, this flag must be used
- // to decide which table stream is valid.
- // sal_uInt16 u1 :2;
- sal_uInt16 fExtChar :1; // 1000 =1, when using extended character set in file
- // sal_uInt16 u2 :3;
-
- sal_uInt16 nFibBack; // 0xc
- sal_Int16 lKey1; // 0xe file encrypted key, only valid if fEncrypted.
- sal_Int16 lKey2; // 0x10 key in 2 Portionen wg. Misalignment
- sal_uInt8 envr; // 0x12 environment in which file was created
- // 0 created by Win Word / 1 created by Mac Word
- sal_uInt8 fMac :1; // 0x13 when 1, this file was last saved in the Mac environment
- sal_uInt8 fEmptySpecial :1;
- sal_uInt8 fLoadOverridePage :1;
- sal_uInt8 fFuturesavedUndo :1;
- sal_uInt8 fWord97Saved :1;
- sal_uInt8 :3;
-
- sal_uInt16 chse; // 0x14 default extended character set id for text in document stream. (overidden by chp.chse)
- // 0 = ANSI / 256 Macintosh character set.
- sal_uInt16 chseTables; // 0x16 default extended character set id for text in
- // internal data structures: 0 = ANSI, 256 = Macintosh
- WW8_FC fcMin; // 0x18 file offset of first character of text
- WW8_FC fcMac; // 0x1c file offset of last character of text + 1
-
- // Einschub fuer WW8 *****************************************************
- sal_uInt16 csw; // Count of fields in the array of "shorts"
-
- // Marke: "rgsw" Beginning of the array of shorts
- sal_uInt16 wMagicCreated; // unique number Identifying the File's creator
- // 0x6A62 is the creator ID for Word and is reserved.
- // Other creators should choose a different value.
- sal_uInt16 wMagicRevised; // identifies the File's last modifier
- sal_uInt16 wMagicCreatedPrivate; // private data
- sal_uInt16 wMagicRevisedPrivate; // private data
- /*
- sal_Int16 pnFbpChpFirst_W6; // not used
- sal_Int16 pnChpFirst_W6; // not used
- sal_Int16 cpnBteChp_W6; // not used
- sal_Int16 pnFbpPapFirst_W6; // not used
- sal_Int16 pnPapFirst_W6; // not used
- sal_Int16 cpnBtePap_W6; // not used
- sal_Int16 pnFbpLvcFirst_W6; // not used
- sal_Int16 pnLvcFirst_W6; // not used
- sal_Int16 cpnBteLvc_W6; // not used
- */
- sal_Int16 lidFE; // Language id if document was written by Far East version
- // of Word (i.e. FIB.fFarEast is on)
- sal_uInt16 clw; // Number of fields in the array of longs
-
- // Ende des Einschubs fuer WW8 *******************************************
-
- // Marke: "rglw" Beginning of the array of longs
- WW8_FC cbMac; // 0x20 file offset of last byte written to file + 1.
-
- // WW8_FC u4[4]; // 0x24
- WW8_CP ccpText; // 0x34 length of main document text stream
- WW8_CP ccpFtn; // 0x38 length of footnote subdocument text stream
- WW8_CP ccpHdr; // 0x3c length of header subdocument text stream
- WW8_CP ccpMcr; // 0x40 length of macro subdocument text stream
- WW8_CP ccpAtn; // 0x44 length of annotation subdocument text stream
- WW8_CP ccpEdn; // 0x48 length of endnote subdocument text stream
- WW8_CP ccpTxbx; // 0x4c length of textbox subdocument text stream
- WW8_CP ccpHdrTxbx; // 0x50 length of header textbox subdocument text stream
-
- // Einschub fuer WW8 *****************************************************
- sal_Int32 pnFbpChpFirst; // when there was insufficient memory for Word to expand
- // the PLCFbte at save time, the PLCFbte is written
- // to the file in a linked list of 512-byte pieces
- // starting with this pn.
- /*
- // folgende Felder existieren zwar so in der Datei,
- // wir benutzen jedoch unten deklarierte General-Variablen
- // fuer Ver67 und Ver8 gemeinsam.
- sal_Int32 pnChpFirst; // the page number of the lowest numbered page in the
- // document that records CHPX FKP information
- sal_Int32 cpnBteChp; // count of CHPX FKPs recorded in file. In non-complex
- // files if the number of entries in the PLCFbteChpx
- // is less than this, the PLCFbteChpx is incomplete.
- */
- sal_Int32 pnFbpPapFirst; // when there was insufficient memory for Word to expand
- // the PLCFbte at save time, the PLCFbte is written to
- // the file in a linked list of 512-byte pieces
- // starting with this pn
- /*
- // folgende Felder existieren zwar so in der Datei,
- // wir benutzen jedoch unten deklarierte General-Variablen
- // fuer Ver67 und Ver8 gemeinsam.
- sal_Int32 pnPapFirst; // the page number of the lowest numbered page in the
- // document that records PAPX FKP information
- sal_Int32 cpnBtePap; // count of PAPX FKPs recorded in file. In non-complex
- // files if the number of entries in the PLCFbtePapx is
- // less than this, the PLCFbtePapx is incomplete.
- */
- sal_Int32 pnFbpLvcFirst; // when there was insufficient memory for Word to expand
- // the PLCFbte at save time, the PLCFbte is written to
- // the file in a linked list of 512-byte pieces
- // starting with this pn
- sal_Int32 pnLvcFirst; // the page number of the lowest numbered page in the
- // document that records LVC FKP information
- sal_Int32 cpnBteLvc; // count of LVC FKPs recorded in file. In non-complex
- // files if the number of entries in the PLCFbtePapx is
- // less than this, the PLCFbtePapx is incomplete.
- sal_Int32 fcIslandFirst; // ?
- sal_Int32 fcIslandLim; // ?
- sal_uInt16 cfclcb; // Number of fields in the array of FC/LCB pairs.
-
- // Ende des Einschubs fuer WW8 *******************************************
-
- // Marke: "rgfclcb" Beginning of array of FC/LCB pairs.
- WW8_FC fcStshfOrig; // file offset of original allocation for STSH in table
- // stream. During fast save Word will attempt to reuse
- // this allocation if STSH is small enough to fit.
- sal_Int32 lcbStshfOrig; // 0x5c count of bytes of original STSH allocation
- WW8_FC fcStshf; // 0x60 file offset of STSH in file.
- sal_Int32 lcbStshf; // 0x64 count of bytes of current STSH allocation
- WW8_FC fcPlcffndRef; // 0x68 file offset of footnote reference PLCF.
- sal_Int32 lcbPlcffndRef; // 0x6c count of bytes of footnote reference PLCF
- // == 0 if no footnotes defined in document.
-
- WW8_FC fcPlcffndTxt; // 0x70 file offset of footnote text PLCF.
- sal_Int32 lcbPlcffndTxt; // 0x74 count of bytes of footnote text PLCF.
- // == 0 if no footnotes defined in document
-
- WW8_FC fcPlcfandRef; // 0x78 file offset of annotation reference PLCF.
- sal_Int32 lcbPlcfandRef; // 0x7c count of bytes of annotation reference PLCF.
-
- WW8_FC fcPlcfandTxt; // 0x80 file offset of annotation text PLCF.
- sal_Int32 lcbPlcfandTxt; // 0x84 count of bytes of the annotation text PLCF
-
- WW8_FC fcPlcfsed; // 8x88 file offset of section descriptor PLCF.
- sal_Int32 lcbPlcfsed; // 0x8c count of bytes of section descriptor PLCF.
-
- WW8_FC fcPlcfpad; // 0x90 file offset of paragraph descriptor PLCF
- sal_Int32 lcbPlcfpad; // 0x94 count of bytes of paragraph descriptor PLCF.
- // ==0 if file was never viewed in Outline view.
- // Should not be written by third party creators
-
- WW8_FC fcPlcfphe; // 0x98 file offset of PLCF of paragraph heights.
- sal_Int32 lcbPlcfphe; // 0x9c count of bytes of paragraph height PLCF.
- // ==0 when file is non-complex.
-
- WW8_FC fcSttbfglsy; // 0xa0 file offset of glossary string table.
- sal_Int32 lcbSttbfglsy; // 0xa4 count of bytes of glossary string table.
- // == 0 for non-glossary documents.
- // !=0 for glossary documents.
-
- WW8_FC fcPlcfglsy; // 0xa8 file offset of glossary PLCF.
- sal_Int32 lcbPlcfglsy; // 0xac count of bytes of glossary PLCF.
- // == 0 for non-glossary documents.
- // !=0 for glossary documents.
-
- WW8_FC fcPlcfhdd; // 0xb0 byte offset of header PLCF.
- sal_Int32 lcbPlcfhdd; // 0xb4 count of bytes of header PLCF.
- // == 0 if document contains no headers
-
- WW8_FC fcPlcfbteChpx; // 0xb8 file offset of character property bin table.PLCF.
- sal_Int32 lcbPlcfbteChpx;// 0xbc count of bytes of character property bin table PLCF.
-
- WW8_FC fcPlcfbtePapx; // 0xc0 file offset of paragraph property bin table.PLCF.
- sal_Int32 lcbPlcfbtePapx;// 0xc4 count of bytes of paragraph property bin table PLCF.
-
- WW8_FC fcPlcfsea; // 0xc8 file offset of PLCF reserved for private use. The SEA is 6 bytes long.
- sal_Int32 lcbPlcfsea; // 0xcc count of bytes of private use PLCF.
-
- WW8_FC fcSttbfffn; // 0xd0 file offset of font information STTBF. See the FFN file structure definition.
- sal_Int32 lcbSttbfffn; // 0xd4 count of bytes in sttbfffn.
-
- WW8_FC fcPlcffldMom; // 0xd8 offset in doc stream to the PLCF of field positions in the main document.
- sal_Int32 lcbPlcffldMom; // 0xdc
-
- WW8_FC fcPlcffldHdr; // 0xe0 offset in doc stream to the PLCF of field positions in the header subdocument.
- sal_Int32 lcbPlcffldHdr; // 0xe4
-
- WW8_FC fcPlcffldFtn; // 0xe8 offset in doc stream to the PLCF of field positions in the footnote subdocument.
- sal_Int32 lcbPlcffldFtn; // 0xec
-
- WW8_FC fcPlcffldAtn; // 0xf0 offset in doc stream to the PLCF of field positions in the annotation subdocument.
- sal_Int32 lcbPlcffldAtn; // 0xf4
-
- WW8_FC fcPlcffldMcr; // 0xf8 offset in doc stream to the PLCF of field positions in the macro subdocument.
- sal_Int32 lcbPlcffldMcr; // 9xfc
-
- WW8_FC fcSttbfbkmk; // 0x100 offset in document stream of the STTBF that records bookmark names in the main document
- sal_Int32 lcbSttbfbkmk; // 0x104
-
- WW8_FC fcPlcfbkf; // 0x108 offset in document stream of the PLCF that records the beginning CP offsets of bookmarks in the main document. See BKF
- sal_Int32 lcbPlcfbkf; // 0x10c
-
- WW8_FC fcPlcfbkl; // 0x110 offset in document stream of the PLCF that records the ending CP offsets of bookmarks recorded in the main document. See the BKL structure definition.
- sal_Int32 lcbPlcfbkl; // 0x114 sal_Int32
-
- WW8_FC fcCmds; // 0x118 FC
- sal_Int32 lcbCmds; // 0x11c
-
- WW8_FC fcPlcfmcr; // 0x120 FC
- sal_Int32 lcbPlcfmcr; // 0x124
-
- WW8_FC fcSttbfmcr; // 0x128 FC
- sal_Int32 lcbSttbfmcr; // 0x12c
-
- WW8_FC fcPrDrvr; // 0x130 file offset of the printer driver information (names of drivers, port etc...)
- sal_Int32 lcbPrDrvr; // 0x134 count of bytes of the printer driver information (names of drivers, port etc...)
-
- WW8_FC fcPrEnvPort; // 0x138 file offset of the print environment in portrait mode.
- sal_Int32 lcbPrEnvPort; // 0x13c count of bytes of the print environment in portrait mode.
-
- WW8_FC fcPrEnvLand; // 0x140 file offset of the print environment in landscape mode.
- sal_Int32 lcbPrEnvLand; // 0x144 count of bytes of the print environment in landscape mode.
-
- WW8_FC fcWss; // 0x148 file offset of Window Save State data structure. See WSS.
- sal_Int32 lcbWss; // 0x14c count of bytes of WSS. ==0 if unable to store the window state.
-
- WW8_FC fcDop; // 0x150 file offset of document property data structure.
- sal_Int32 lcbDop; // 0x154 count of bytes of document properties.
- // cbDOP is 84 when nFib < 103
-
-
- WW8_FC fcSttbfAssoc; // 0x158 offset to STTBF of associated strings. See STTBFASSOC.
- sal_Int32 cbSttbfAssoc; // 0x15C
-
- WW8_FC fcClx; // 0x160 file offset of beginning of information for complex files.
- sal_Int32 lcbClx; // 0x164 count of bytes of complex file information. 0 if file is non-complex.
-
- WW8_FC fcPlcfpgdFtn; // 0x168 file offset of page descriptor PLCF for footnote subdocument.
- sal_Int32 lcbPlcfpgdFtn; // 0x16C count of bytes of page descriptor PLCF for footnote subdocument.
- // ==0 if document has not been paginated. The length of the PGD is 8 bytes.
-
- WW8_FC fcAutosaveSource; // 0x170 file offset of the name of the original file.
- sal_Int32 lcbAutosaveSource; // 0x174 count of bytes of the name of the original file.
-
- WW8_FC fcGrpStAtnOwners; // 0x178 group of strings recording the names of the owners of annotations
- sal_Int32 lcbGrpStAtnOwners; // 0x17C count of bytes of the group of strings
-
- WW8_FC fcSttbfAtnbkmk; // 0x180 file offset of the sttbf that records names of bookmarks in the annotation subdocument
- sal_Int32 lcbSttbfAtnbkmk; // 0x184 length in bytes of the sttbf that records names of bookmarks in the annotation subdocument
-
- // Einschubs fuer WW67 ***************************************************
-
- // sal_Int16 wSpare4Fib; // Reserve, muss hier nicht deklariert werden
-
- /*
- // folgende Felder existieren zwar so in der Datei,
- // wir benutzen jedoch unten deklarierte General-Variablen
- // fuer Ver67 und Ver8 gemeinsam.
- WW8_PN pnChpFirst; // the page number of the lowest numbered page in
- // the document that records CHPX FKP information
- WW8_PN pnPapFirst; // the page number of the lowest numbered page in
- // the document that records PAPX FKP information
-
- WW8_PN cpnBteChp; // count of CHPX FKPs recorded in file. In non-complex
- // files if the number of entries in the PLCFbteChpx is
- // less than this, the PLCFbteChpx is incomplete.
- WW8_PN cpnBtePap; // count of PAPX FKPs recorded in file. In non-complex
- // files if the number of entries in the PLCFbtePapx is
- // less than this, the PLCFbtePapx is incomplete.
- */
-
- // Ende des Einschubs fuer WW67 ******************************************
-
- WW8_FC fcPlcfdoaMom; // 0x192 file offset of the FDOA (drawn object) PLCF for main document.
- // ==0 if document has no drawn objects. The length of the FDOA is 6 bytes.
- // ab Ver8 unused
- sal_Int32 lcbPlcfdoaMom; // 0x196 length in bytes of the FDOA PLCF of the main document
- // ab Ver8 unused
- WW8_FC fcPlcfdoaHdr; // 0x19A file offset of the FDOA (drawn object) PLCF for the header document.
- // ==0 if document has no drawn objects. The length of the FDOA is 6 bytes.
- // ab Ver8 unused
- sal_Int32 lcbPlcfdoaHdr; // 0x19E length in bytes of the FDOA PLCF of the header document
- // ab Ver8 unused
-
- WW8_FC fcPlcfspaMom; // offset in table stream of the FSPA PLCF for main document.
- // == 0 if document has no office art objects
- // war in Ver67 nur leere Reserve
- sal_Int32 lcbPlcfspaMom; // length in bytes of the FSPA PLCF of the main document
- // war in Ver67 nur leere Reserve
- WW8_FC fcPlcfspaHdr; // offset in table stream of the FSPA PLCF for header document.
- // == 0 if document has no office art objects
- // war in Ver67 nur leere Reserve
- sal_Int32 lcbPlcfspaHdr; // length in bytes of the FSPA PLCF of the header document
- // war in Ver67 nur leere Reserve
-
- WW8_FC fcPlcfAtnbkf; // 0x1B2 file offset of BKF (bookmark first) PLCF of the annotation subdocument
- sal_Int32 lcbPlcfAtnbkf; // 0x1B6 length in bytes of BKF (bookmark first) PLCF of the annotation subdocument
-
- WW8_FC fcPlcfAtnbkl; // 0x1BA file offset of BKL (bookmark last) PLCF of the annotation subdocument
- sal_Int32 lcbPlcfAtnbkl; // 0x1BE length in bytes of BKL (bookmark first) PLCF of the annotation subdocument
-
- WW8_FC fcPms; // 0x1C2 file offset of PMS (Print Merge State) information block
- sal_Int32 lcbPMS; // 0x1C6 length in bytes of PMS
-
- WW8_FC fcFormFldSttbf; // 0x1CA file offset of form field Sttbf which contains strings used in form field dropdown controls
- sal_Int32 lcbFormFldSttbf; // 0x1CE length in bytes of form field Sttbf
-
- WW8_FC fcPlcfendRef; // 0x1D2 file offset of PLCFendRef which points to endnote references in the main document stream
- sal_Int32 lcbPlcfendRef; // 0x1D6
-
- WW8_FC fcPlcfendTxt; // 0x1DA file offset of PLCFendRef which points to endnote text in the endnote document
- // stream which corresponds with the PLCFendRef
- sal_Int32 lcbPlcfendTxt; // 0x1DE
-
- WW8_FC fcPlcffldEdn; // 0x1E2 offset to PLCF of field positions in the endnote subdoc
- sal_Int32 lcbPlcffldEdn; // 0x1E6
-
- WW8_FC fcPlcfpgdEdn; // 0x1EA offset to PLCF of page boundaries in the endnote subdoc.
- sal_Int32 lcbPlcfpgdEdn; // 0x1EE
-
-
- WW8_FC fcDggInfo; // offset in table stream of the office art object table data.
- // The format of office art object table data is found in a separate document.
- // war in Ver67 nur leere Reserve
- sal_Int32 lcbDggInfo; // length in bytes of the office art object table data
- // war in Ver67 nur leere Reserve
-
- WW8_FC fcSttbfRMark; // 0x1fa offset to STTBF that records the author abbreviations...
- sal_Int32 lcbSttbfRMark; // 0x1fe
- WW8_FC fcSttbfCaption; // 0x202 offset to STTBF that records caption titles...
- sal_Int32 lcbSttbfCaption; // 0x206
- WW8_FC fcSttbAutoCaption; // offset in table stream to the STTBF that records the object names and
- // indices into the caption STTBF for objects which get auto captions.
- sal_Int32 lcbSttbAutoCaption; // 0x20e
-
- WW8_FC fcPlcfwkb; // 0x212 offset to PLCF that describes the boundaries of contributing documents...
- sal_Int32 lcbPlcfwkb; // 0x216
-
- WW8_FC fcPlcfspl; // offset in table stream of PLCF (of SPLS structures) that records spell check state
- // war in Ver67 nur leere Reserve
- sal_Int32 lcbPlcfspl; // war in Ver67 nur leere Reserve
-
- WW8_FC fcPlcftxbxTxt; // 0x222 ...PLCF of beginning CP in the text box subdoc
- sal_Int32 lcbPlcftxbxTxt; // 0x226
- WW8_FC fcPlcffldTxbx; // 0x22a ...PLCF of field boundaries recorded in the textbox subdoc.
- sal_Int32 lcbPlcffldTxbx; // 0x22e
- WW8_FC fcPlcfHdrtxbxTxt;// 0x232 ...PLCF of beginning CP in the header text box subdoc
- sal_Int32 lcbPlcfHdrtxbxTxt;// 0x236
- WW8_FC fcPlcffldHdrTxbx;// 0x23a ...PLCF of field boundaries recorded in the header textbox subdoc.
- sal_Int32 lcbPlcffldHdrTxbx;// 0x23e
-
- /*
- spezielle Listenverwaltung fuer WW8
- */
- WW8_FC fcPlcfLst; // 0x02e2 offset in the table stream of list format information.
- sal_Int32 lcbPlcfLst; // 0x02e6 length
- WW8_FC fcPlfLfo; // 0x02ea offset in the table stream of list format override information.
- sal_Int32 lcbPlfLfo; // 0x02ee length
- /*
- spezielle Break-Verwaltung fuer Text-Box-Stories in WW8
- */
- WW8_FC fcPlcftxbxBkd; // 0x02f2 PLCF fuer TextBox-Break-Deskriptoren im Maintext
- sal_Int32 lcbPlcftxbxBkd; // 0x02f6
- WW8_FC fcPlcfHdrtxbxBkd;// 0x02fa PLCF fuer TextBox-Break-Deskriptoren im Header-/Footer-Bereich
- sal_Int32 lcbPlcfHdrtxbxBkd;// 0x02fe
-
- // 0x302 - 372 == ignore
- /*
- ListNames (skip to here!)
- */
- WW8_FC fcSttbListNames;// 0x0372 PLCF for Listname Table
- sal_Int32 lcbSttbListNames;// 0x0376
- /*
- General-Varaiblen, die fuer Ver67 und Ver8 verwendet werden,
- obwohl sie in der jeweiligen DATEI verschiedene Groesse haben:
- */
- sal_Int32 pnChpFirst;
- sal_Int32 pnPapFirst;
- sal_Int32 cpnBteChp;
- sal_Int32 cpnBtePap;
- /*
- nun wird lediglich noch ein Ctor benoetigt
- */
- WW8Fib( SvStream& rStrm, sal_uInt8 nWantedVersion,sal_uInt32 nOffset=0 );
-
- /* leider falsch, man braucht auch noch einen fuer den Export */
- WW8Fib( sal_uInt8 nVersion = 6 );
- sal_Bool Write( SvStream& rStrm );
-};
-
-
-class WW8Style
-{
-protected:
- WW8Fib& rFib;
- SvStream& rSt;
- long nStyleStart;
- long nStyleLen;
-// WW8_STSHI* pStishi;
-
- sal_uInt16 cstd; // Count of styles in stylesheet
- sal_uInt16 cbSTDBaseInFile; // Length of STD Base as stored in a file
- sal_uInt16 fStdStylenamesWritten : 1; // Are built-in stylenames stored?
- sal_uInt16 : 15; // Spare flags
- sal_uInt16 stiMaxWhenSaved; // Max sti known when this file was written
- sal_uInt16 istdMaxFixedWhenSaved; // How many fixed-index istds are there?
- sal_uInt16 nVerBuiltInNamesWhenSaved; // Current version of built-in stylenames
- sal_uInt16 ftcStandardChpStsh; // ftc used by StandardChpStsh for this document
-
-public:
- WW8Style( SvStream& rSt, WW8Fib& rFibPara );
-// ~WW8Style(){ delete( pStishi ); pStishi = 0; }
- WW8_STD* Read1STDFixed( short& rSkip, short* pcbStd );
- WW8_STD* Read1Style( short& rSkip, String* pString, short* pcbStd );
- const sal_uInt16 GetCount() const { return cstd; }
-};
-
-
-class WW8Fonts
-{
-protected:
- WW8_FFN* pFontA; // Array of Pointers to Font Description
- // Hilfs-Vari
- sal_uInt16 nMax; // Array-Groesse
-public:
- WW8Fonts( SvStream& rSt, WW8Fib& rFib );
- ~WW8Fonts(){ if( pFontA ) delete [] pFontA; }
- const WW8_FFN* GetFont( sal_uInt16 nNum ) const;
- sal_uInt16 GetMax() const { return nMax; }
-};
-
-
-/** Document Properties
-*/
-class WW8Dop
-{
-public:
- /*
- Fehlerstatus
- */
- sal_uLong nDopError;
- /*
- vom Ctor aus dem FIB gelesene Daten
- (entspricht nur ungefaehr der tatsaechlichen Struktur
- des Winword-FIB)
- */
- // Initialisier-Dummy:
- sal_uInt8 nDataStart;
- //-------------------------
- sal_uInt16 fFacingPages : 1; // 1 when facing pages should be printed
- sal_uInt16 fWidowControl : 1; // 1 when widow control is in effect. 0 when widow control disabled.
- sal_uInt16 fPMHMainDoc : 1; // 1 when doc is a main doc for Print Merge Helper, 0 when not; default=0
- sal_uInt16 grfSuppression : 2; // 0 Default line suppression storage; 0= form letter line suppression; 1= no line suppression; default=0
- sal_uInt16 fpc : 2; // 1 footnote position code: 0 as endnotes, 1 at bottom of page, 2 immediately beneath text
- sal_uInt16 : 1; // 0 unused
- //-------------------------
- sal_uInt16 grpfIhdt : 8; // 0 specification of document headers and footers. See explanation under Headers and Footers topic.
- //-------------------------
- sal_uInt16 rncFtn : 2; // 0 restart index for footnotes, 0 don't restart note numbering, 1 section, 2 page
- sal_uInt16 nFtn : 14; // 1 initial footnote number for document
- sal_uInt16 fOutlineDirtySave : 1; // when 1, indicates that information in the hPLCFpad should be refreshed since outline has been dirtied
- sal_uInt16 : 7; // reserved
- sal_uInt16 fOnlyMacPics : 1; // when 1, Word believes all pictures recorded in the document were created on a Macintosh
- sal_uInt16 fOnlyWinPics : 1; // when 1, Word believes all pictures recorded in the document were created in Windows
- sal_uInt16 fLabelDoc : 1; // when 1, document was created as a print merge labels document
- sal_uInt16 fHyphCapitals : 1; // when 1, Word is allowed to hyphenate words that are capitalized. When 0, capitalized may not be hyphenated
- sal_uInt16 fAutoHyphen : 1; // when 1, Word will hyphenate newly typed text as a background task
- sal_uInt16 fFormNoFields : 1;
- sal_uInt16 fLinkStyles : 1; // when 1, Word will merge styles from its template
- sal_uInt16 fRevMarking : 1; // when 1, Word will mark revisions as the document is edited
- sal_uInt16 fBackup : 1; // always make backup when document saved when 1.
- sal_uInt16 fExactCWords : 1;
- sal_uInt16 fPagHidden : 1; //
- sal_uInt16 fPagResults : 1;
- sal_uInt16 fLockAtn : 1; // when 1, annotations are locked for editing
- sal_uInt16 fMirrorMargins : 1; // swap margins on left/right pages when 1.
- sal_uInt16 fReadOnlyRecommended : 1;// user has recommended that this doc be opened read-only when 1
- sal_uInt16 fDfltTrueType : 1; // when 1, use TrueType fonts by default (flag obeyed only when doc was created by WinWord 2.x)
- sal_uInt16 fPagSuppressTopSpacing : 1;//when 1, file created with SUPPRESSTOPSPACING=YES in win.ini. (flag obeyed only when doc was created by WinWord 2.x).
- sal_uInt16 fProtEnabled : 1; // when 1, document is protected from edit operations
- sal_uInt16 fDispFormFldSel : 1;// when 1, restrict selections to occur only within form fields
- sal_uInt16 fRMView : 1; // when 1, show revision markings on screen
- sal_uInt16 fRMPrint : 1; // when 1, print revision marks when document is printed
- sal_uInt16 fWriteReservation : 1;
- sal_uInt16 fLockRev : 1; // when 1, the current revision marking state is locked
- sal_uInt16 fEmbedFonts : 1; // when 1, document contains embedded True Type fonts
- // compatability options
- sal_uInt16 copts_fNoTabForInd : 1; // when 1, don�t add automatic tab stops for hanging indent
- sal_uInt16 copts_fNoSpaceRaiseLower : 1; // when 1, don�t add extra space for raised or lowered characters
- sal_uInt16 copts_fSupressSpbfAfterPgBrk : 1; // when 1, supress the paragraph Space Before and Space After options after a page break
- sal_uInt16 copts_fWrapTrailSpaces : 1; // when 1, wrap trailing spaces at the end of a line to the next line
- sal_uInt16 copts_fMapPrintTextColor : 1; // when 1, print colors as black on non-color printers
- sal_uInt16 copts_fNoColumnBalance : 1; // when 1, don�t balance columns for Continuous Section starts
- sal_uInt16 copts_fConvMailMergeEsc : 1;
- sal_uInt16 copts_fSupressTopSpacing : 1; // when 1, supress extra line spacing at top of page
- sal_uInt16 copts_fOrigWordTableRules : 1; // when 1, combine table borders like Word 5.x for the Macintosh
- sal_uInt16 copts_fTransparentMetafiles : 1; // when 1, don�t blank area between metafile pictures
- sal_uInt16 copts_fShowBreaksInFrames : 1; // when 1, show hard page or column breaks in frames
- sal_uInt16 copts_fSwapBordersFacingPgs : 1; // when 1, swap left and right pages on odd facing pages
-
- sal_Int16 dxaTab; // 720 twips default tab width
- sal_uInt16 wSpare; //
- sal_uInt16 dxaHotZ; // width of hyphenation hot zone measured in twips
- sal_uInt16 cConsecHypLim; // number of lines allowed to have consecutive hyphens
- sal_uInt16 wSpare2; // reserved
- sal_Int32 dttmCreated; // DTTM date and time document was created
- sal_Int32 dttmRevised; // DTTM date and time document was last revised
- sal_Int32 dttmLastPrint; // DTTM date and time document was last printed
- sal_Int16 nRevision; // number of times document has been revised since its creation
- sal_Int32 tmEdited; // time document was last edited
- sal_Int32 cWords; // count of words tallied by last Word Count execution
- sal_Int32 cCh; // count of characters tallied by last Word Count execution
- sal_Int16 cPg; // count of pages tallied by last Word Count execution
- sal_Int32 cParas; // count of paragraphs tallied by last Word Count execution
- sal_uInt16 rncEdn : 2; // restart endnote number code: 0 don�t restart endnote numbering, 1 section, 2 page
- sal_uInt16 nEdn : 14; // beginning endnote number
- sal_uInt16 epc : 2; // endnote position code: 0 at end of section, 3 at end of document
- // sal_uInt16 nfcFtnRef : 4; // number format code for auto footnotes: 0 Arabic, 1 Upper case Roman, 2 Lower case Roman
- // 3 Upper case Letter, 4 Lower case Letter
- // ersetzt durch gleichlautendes Feld unten
- // sal_uInt16 nfcEdnRef : 4; // number format code for auto endnotes: 0 Arabic, 1 Upper case Roman, 2 Lower case Roman
- // 3 Upper case Letter, 4 Lower case Letter
- // ersetzt durch gleichlautendes Feld unten
- sal_uInt16 fPrintFormData : 1; // only print data inside of form fields
- sal_uInt16 fSaveFormData : 1; // only save document data that is inside of a form field.
- sal_uInt16 fShadeFormData : 1; // shade form fields
- sal_uInt16 : 2; // reserved
- sal_uInt16 fWCFtnEdn : 1; // when 1, include footnotes and endnotes in word count
- sal_Int32 cLines; // count of lines tallied by last Word Count operation
- sal_Int32 cWordsFtnEnd; // count of words in footnotes and endnotes tallied by last Word Count operation
- sal_Int32 cChFtnEdn; // count of characters in footnotes and endnotes tallied by last Word Count operation
- sal_Int16 cPgFtnEdn; // count of pages in footnotes and endnotes tallied by last Word Count operation
- sal_Int32 cParasFtnEdn; // count of paragraphs in footnotes and endnotes tallied by last Word Count operation
- sal_Int32 cLinesFtnEdn; // count of paragraphs in footnotes and endnotes tallied by last Word Count operation
- sal_Int32 lKeyProtDoc; // document protection password key, only valid if dop.fProtEnabled, dop.fLockAtn or dop.fLockRev are 1.
- sal_uInt16 wvkSaved : 3; // document view kind: 0 Normal view, 1 Outline view, 2 Page View
- sal_uInt16 wScaleSaved : 9; //
- sal_uInt16 zkSaved : 2;
-
- // hier sollte bei nFib < 103 Schluss sein, sonst ist Datei fehlerhaft!
-
- /*
- bei nFib >= 103 gehts weiter:
- */
- sal_uInt32 fNoTabForInd :1; // see above in compatability options
- sal_uInt32 fNoSpaceRaiseLower :1; // see above
- sal_uInt32 fSupressSpbfAfterPageBreak :1; // see above
- sal_uInt32 fWrapTrailSpaces :1; // see above
- sal_uInt32 fMapPrintTextColor :1; // see above
- sal_uInt32 fNoColumnBalance :1; // see above
- sal_uInt32 fConvMailMergeEsc :1; // see above
- sal_uInt32 fSupressTopSpacing :1; // see above
- sal_uInt32 fOrigWordTableRules :1; // see above
- sal_uInt32 fTransparentMetafiles :1; // see above
- sal_uInt32 fShowBreaksInFrames :1; // see above
- sal_uInt32 fSwapBordersFacingPgs :1; // see above
- sal_uInt32 :4; // reserved
- sal_uInt32 fSuppressTopSpacingMac5 :1; // Suppress extra line spacing at top
- // of page like MacWord 5.x
- sal_uInt32 fTruncDxaExpand :1; // Expand/Condense by whole number of points
- sal_uInt32 fPrintBodyBeforeHdr :1; // Print body text before header/footer
- sal_uInt32 fNoLeading :1; // Don't add extra spacebetween rows of text
- sal_uInt32 :1; // reserved
- sal_uInt32 fMWSmallCaps :1; // Use larger small caps like MacWord 5.x
- sal_uInt32 :10;// reserved
-
- // hier sollte bei nFib <= 105 Schluss sein, sonst ist Datei fehlerhaft!
-
- /*
- bei nFib > 105 gehts weiter:
- */
- sal_Int16 adt; // Autoformat Document Type:
- // 0 for normal. 1 for letter, and 2 for email.
- WW8_DOPTYPOGRAPHY doptypography; // siehe WW8STRUC.HXX
- WW8_DOGRID dogrid; // siehe WW8STRUC.HXX
- sal_uInt16 :1; // reserved
- sal_uInt16 lvl :4; // Which outline levels are showing in outline view
- sal_uInt16 :4; // reserved
- sal_uInt16 fHtmlDoc :1; // This file is based upon an HTML file
- sal_uInt16 :1; // reserved
- sal_uInt16 fSnapBorder :1; // Snap table and page borders to page border
- sal_uInt16 fIncludeHeader :1; // Place header inside page border
- sal_uInt16 fIncludeFooter :1; // Place footer inside page border
- sal_uInt16 fForcePageSizePag :1; // Are we in online view
- sal_uInt16 fMinFontSizePag :1; // Are we auto-promoting
- // fonts to >= hpsZoonFontPag?
- sal_uInt16 fHaveVersions :1; // versioning is turned on
- sal_uInt16 fAutoVersion :1; // autoversioning is enabled
- sal_uInt16 :14; // reserved
- // hier 12 Byte ueberspringen: ASUMI
- sal_Int32 cChWS;
- sal_Int32 cChWSFtnEdn;
- sal_Int32 grfDocEvents;
- // hier 4+30+8 Bytes ueberspringen
- sal_Int32 cDBC;
- sal_Int32 cDBCFtnEdn;
- // hier 4 Bytes ueberspringen
- sal_Int16 nfcFtnRef;
- sal_Int16 nfcEdnRef;
- sal_Int16 hpsZoonFontPag;
- sal_Int16 dywDispPag;
-
- // 2. Initialisier-Dummy:
- sal_uInt8 nDataEnd;
-
- /*
- nun wird lediglich noch ein Ctor benoetigt,
- dem die FIB-Nummer uebergeben werden muss
- */
- WW8Dop( SvStream& rSt, sal_Int16 nFib, sal_Int32 nPos, sal_Int32 nSize );
-
- /* leider falsch, man braucht auch noch einen fuer den Export */
- WW8Dop();
- sal_Bool Write( SvStream& rStrm, WW8Fib& rFib );
-};
-
-
-inline short WW8SkipOdd(SvStream* pSt )
-{
-#if defined HP9000 || defined SINIX
- short bRet = pSt->Tell() & 0x1;
- if (bRet) {
- sal_uInt8 c;
- pSt->Read( &c, 1 );
- }
- return bRet;
-#else
- if ( pSt->Tell() & 0x1 ){
- sal_uInt8 c;
- pSt->Read( &c, 1 );
- return 1;
- }
- return 0;
-#endif
-}
-
-
-class WW8PLCF_HdFt
-{
- WW8PLCF aPLCF;
- long nTextOfs;
- short nIdxOffset;
-
-public:
- WW8PLCF_HdFt( SvStream* pSt, WW8Fib& rFib, WW8Dop& rDop );
-// ~WW8PLCF_HdFt() {}
- sal_Bool GetTextPos( sal_uInt8 grpfIhdt, sal_uInt8 nWhich, WW8_CP& rStart, long& rLen );
- sal_Bool GetTextPosExact( short nIdx, WW8_CP& rStart, long& rLen );
- void UpdateIndex( sal_uInt8 grpfIhdt );
-};
-
-
-#endif
-
diff --git a/sw/source/filter/ww8/dump/ww8struc.hxx b/sw/source/filter/ww8/dump/ww8struc.hxx
deleted file mode 100644
index 6f86aa380f6d..000000000000
--- a/sw/source/filter/ww8/dump/ww8struc.hxx
+++ /dev/null
@@ -1,815 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _WW8STRUC_HXX
-#define _WW8STRUC_HXX
-
-#include <osl/endian.h>
-#include <tools/string.hxx>
-
-
-// max. Anzahl der Listen-Level in WW8: 1..9
-#define nWW8MaxListLevel 9
-
-
-inline sal_uInt8 Get_Byte( sal_uInt8 *& p )
- { sal_uInt8 n = SVBT8ToByte( *(SVBT8*)p ); p += 1; return n; }
-
-inline short Get_Short( sal_uInt8 *& p )
- { short n = SVBT16ToShort( *(SVBT16*)p ); p += 2; return n; }
-inline sal_uInt16 Get_UShort( sal_uInt8 *& p )
- { sal_uInt16 n = SVBT16ToShort( *(SVBT16*)p ); p += 2; return n; }
-
-inline long Get_Long( sal_uInt8 *& p )
- { long n = SVBT32ToUInt32( *(SVBT32*)p ); p += 4; return n; }
-inline sal_uLong Get_ULong( sal_uInt8 *& p )
- { sal_uLong n = SVBT32ToUInt32( *(SVBT32*)p ); p += 4; return n; }
-
-inline void Set_UInt8( sal_uInt8 *& p, sal_uInt8 n )
- { ByteToSVBT8( n, *(SVBT8*)p ); p+= 1; }
-
-inline void Set_UInt16( sal_uInt8 *& p, sal_uInt16 n )
- { ShortToSVBT16( n, *(SVBT16*)p ); p+= 2; }
-
-inline void Set_UInt32( sal_uInt8 *& p, sal_uInt32 n )
- { UInt32ToSVBT32( n, *(SVBT32*)p ); p+= 4; }
-
-
-#if defined OSL_BIGENDIAN || SAL_TYPES_ALIGNMENT4 > 2 || defined UNX
-#define __WW8_NEEDS_COPY
-#else
-#if defined WNT || defined OS2
-#define __WW8_NEEDS_PACK
-#pragma pack(2)
-#endif
-#endif
-
-typedef sal_Int16 WW8_PN;
-typedef sal_Int32 WW8_FC;
-typedef sal_Int32 WW8_CP;
-
-// STD: STyle Definition
-// The STD contains the entire definition of a style.
-// It has two parts, a fixed-length base (cbSTDBase bytes long)
-// and a variable length remainder holding the name, and the upx and upe
-// arrays (a upx and upe for each type stored in the style, std.cupx)
-// Note that new fields can be added to the BASE of the STD without
-// invalidating the file format, because the STSHI contains the length
-// that is stored in the file. When reading STDs from an older version,
-// new fields will be zero.
-struct WW8_STD
-{
- // Base part of STD:
- sal_uInt16 sti : 12; // invariant style identifier
- sal_uInt16 fScratch : 1; // spare field for any temporary use,
- // always reset back to zero!
- sal_uInt16 fInvalHeight : 1; // PHEs of all text with this style are wrong
- sal_uInt16 fHasUpe : 1; // UPEs have been generated
- sal_uInt16 fMassCopy : 1; // std has been mass-copied; if unused at
- // save time, style should be deleted
- sal_uInt16 sgc : 4; // style type code
- sal_uInt16 istdBase : 12; // base style
- sal_uInt16 cupx : 4; // # of UPXs (and UPEs)
- sal_uInt16 istdNext : 12; // next style
- sal_uInt16 bchUpe; // offset to end of upx's, start of upe's
- //-------- jetzt neu:
- // ab Ver8 gibts zwei Felder mehr:
- sal_uInt16 fAutoRedef : 1; /* auto redefine style when appropriate */
- sal_uInt16 fHidden : 1; /* hidden from UI? */
- sal_uInt16 : 14; /* unused bits */
-
- // Variable length part of STD:
- // sal_uInt8 stzName[2]; /* sub-names are separated by chDelimStyle
- // char grupx[];
- // the UPEs are not stored on the file; they are a cache of the based-on
- // chain
- // char grupe[];
-};
-
-/*
- Basis zum Einlesen UND zum Arbeiten (wird jeweils unter
- schiedlich beerbt)
-*/
-struct WW8_FFN_BASE // Font Descriptor
-{
- // ab Ver6
- sal_uInt8 cbFfnM1; // 0x0 total length of FFN - 1.
-
- sal_uInt8 prg: 2; // 0x1:03 pitch request
- sal_uInt8 fTrueType : 1; // 0x1:04 when 1, font is a TrueType font
- // 0x1:08 reserved
- sal_uInt8 ff : 3; // 0x1:70 font family id
- // 0x1:80 reserved
-
- short wWeight; // 0x2 base weight of font
- sal_uInt8 chs; // 0x4 character set identifier
- sal_uInt8 ibszAlt; // 0x5 index into ffn.szFfn to the name of the alternate font
-};
-
-/*
- Hiermit arbeiten wir im Parser (und Dumper)
-*/
-struct WW8_FFN : public WW8_FFN_BASE
-{
- // ab Ver8 als Unicode
- UniString sFontname;// 0x6 bzw. 0x40 ab Ver8 zero terminated string that
- // records name of font.
- // Maximal size of szFfn is 65 characters.
- // Vorsicht: Dieses Array kann auch kleiner sein!!!
- // Possibly followed by a second sz which records the
- // name of an alternate font to use if the first named
- // font does not exist on this system.
-};
-
-
-
-struct WW8_BRCVer6 // alter Border Code
-{
- SVBT16 aBits1;
-// sal_uInt16 dxpLineWidth : 3;// 0007 When dxpLineWidth is 0, 1, 2, 3, 4, or 5, this field is the width of
- // a single line of border in units of 0.75 points
- // Must be nonzero when brcType is nonzero.
- // 6 == dotted, 7 == dashed.
-// sal_uInt16 brcType : 2; // 0018 border type code: 0 == none, 1 == single, 2 == thick, 3 == double
-// sal_uInt16 fShadow : 1; // 0020 when 1, border is drawn with shadow. Must be 0 when BRC is a substructure of the TC
-// sal_uInt16 ico : 5; // 07C0 color code (see chp.ico)
-// sal_uInt16 dxpSpace : 5; // F800 width of space to maintain between border and text within border.
- // Must be 0 when BRC is a substructure of the TC. Stored in points for Windows.
-};
-
-struct WW8_BRC : public WW8_BRCVer6 // Border Code
-{
- SVBT16 aBits2;
-// sal_uInt16 dxpLineWidth : 3;// 0007 When dxpLineWidth is 0, 1, 2, 3, 4, or 5, this field is the width of
- // a single line of border in units of 0.75 points
- // Must be nonzero when brcType is nonzero.
- // 6 == dotted, 7 == dashed.
-// sal_uInt16 brcType : 2; // 0018 border type code: 0 == none, 1 == single, 2 == thick, 3 == double
-// sal_uInt16 fShadow : 1; // 0020 when 1, border is drawn with shadow. Must be 0 when BRC is a substructure of the TC
-// sal_uInt16 ico : 5; // 07C0 color code (see chp.ico)
-// sal_uInt16 dxpSpace : 5; // F800 width of space to maintain between border and text within border.
- // Must be 0 when BRC is a substructure of the TC. Stored in points for Windows.
-};
-
-typedef WW8_BRC WW8_BRC5[5]; // 5 * Border Code
-
-#define WW8_TOP 0
-#define WW8_LEFT 1
-#define WW8_BOT 2
-#define WW8_RIGHT 3
-#define WW8_BETW 4
-
-
-
-
-
-struct WW8_BordersSO // fuer StarOffice-Border Code
-{
- sal_uInt16 Out;
- sal_uInt16 In;
- sal_uInt16 Dist;
-};
-
-
-/*
-// Linien-Defaults in Twips: fruehere Writer-Defaults,
-// siehe auch <editeng/boxitem.hxx>
-#define DEF_LINE_WIDTH_0 1
-#define DEF_LINE_WIDTH_1 20
-#define DEF_LINE_WIDTH_2 50
-#define DEF_LINE_WIDTH_3 80
-#define DEF_LINE_WIDTH_4 100
-
-#define DEF_MAX_LINE_WIDHT DEF_LINE_WIDTH_4
-#define DEF_MAX_LINE_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE0_OUT DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE0_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE0_DIST DEF_LINE_WIDTH_1
-
-#define DEF_DOUBLE_LINE1_OUT DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE1_IN DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE1_DIST DEF_LINE_WIDTH_1
-
-#define DEF_DOUBLE_LINE2_OUT DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE2_IN DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE2_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE3_OUT DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE3_IN DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE3_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE4_OUT DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE4_IN DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE4_DIST DEF_LINE_WIDTH_1
-
-#define DEF_DOUBLE_LINE5_OUT DEF_LINE_WIDTH_3
-#define DEF_DOUBLE_LINE5_IN DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE5_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE6_OUT DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE6_IN DEF_LINE_WIDTH_3
-#define DEF_DOUBLE_LINE6_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE7_OUT DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE7_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE7_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE8_OUT DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE8_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE8_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE9_OUT DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE9_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE9_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE10_OUT DEF_LINE_WIDTH_3
-#define DEF_DOUBLE_LINE10_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE10_DIST DEF_LINE_WIDTH_2
-*/
-// Deklarationen gemaess BOXITEM.HXX
-#define WW8_DECL_LINETAB_ARRAY \
- static WW8_BordersSO __READONLY_DATA nLineTabVer8[] = \
- { \
-/* 0*/ { DEF_LINE_WIDTH_0, 0, 0 }, \
-/* 1*/ { DEF_LINE_WIDTH_1, 0, 0 }, \
-/* 2*/ { DEF_LINE_WIDTH_2, 0, 0 }, \
-/* 3*/ { DEF_LINE_WIDTH_3, 0, 0 }, \
-/* 4*/ { DEF_LINE_WIDTH_4, 0, 0 }, \
-/* 5*/ { DEF_DOUBLE_LINE0_OUT, DEF_DOUBLE_LINE0_IN, DEF_DOUBLE_LINE0_DIST },\
-/* 6*/ { DEF_DOUBLE_LINE1_OUT, DEF_DOUBLE_LINE1_IN, DEF_DOUBLE_LINE1_DIST },\
-/* 7*/ { DEF_DOUBLE_LINE2_OUT, DEF_DOUBLE_LINE2_IN, DEF_DOUBLE_LINE2_DIST },\
-/* 8*/ { DEF_DOUBLE_LINE3_OUT, DEF_DOUBLE_LINE3_IN, DEF_DOUBLE_LINE3_DIST },\
-/* 9*/ { DEF_DOUBLE_LINE4_OUT, DEF_DOUBLE_LINE4_IN, DEF_DOUBLE_LINE4_DIST },\
-/*10*/ { DEF_DOUBLE_LINE5_OUT, DEF_DOUBLE_LINE5_IN, DEF_DOUBLE_LINE5_DIST },\
-/*11*/ { DEF_DOUBLE_LINE6_OUT, DEF_DOUBLE_LINE6_IN, DEF_DOUBLE_LINE6_DIST },\
-/*12*/ { DEF_DOUBLE_LINE7_OUT, DEF_DOUBLE_LINE7_IN, DEF_DOUBLE_LINE7_DIST },\
-/*13*/ { DEF_DOUBLE_LINE8_OUT, DEF_DOUBLE_LINE8_IN, DEF_DOUBLE_LINE8_DIST },\
-/*14*/ { DEF_DOUBLE_LINE9_OUT, DEF_DOUBLE_LINE9_IN, DEF_DOUBLE_LINE9_DIST },\
-/*15*/ { DEF_DOUBLE_LINE10_OUT,DEF_DOUBLE_LINE10_IN,DEF_DOUBLE_LINE10_DIST} \
- };
-
-#define WW8_DECL_LINETAB_OFS_DOUBLE 5 // Beginn des DOUBLE_LINE Abschnitts in meiner Liste
-
-
-
-
-struct WW8_XCHAR // Hilfs-Konstrukt fuer WW8_DOPTYPOGRAPHY
-{
- sal_Char A;
- sal_Char B;
-};
-
-struct WW8_DOPTYPOGRAPHY
-{ /*
- Document Typography Info (DOPTYPOGRAPHY)
- These options are Far East only, and are accessible
- through the Typography tab of the Tools/Options dialog.
- */
-
-
-
- /* a c h t u n g : es duerfen keine solchen Bitfelder ueber einen eingelesenes Byte-Array
- gelegt werden!!
- stattdessen ist ein aBits1 darueber zu legen, das mit & auszulesen ist
- GRUND: Compiler auf Intel und Sparc sortieren die Bits unterschiedlich
- */
-
-
-
- short fKerningPunct : 1; // true if we're kerning punctuation
- short iJustification : 2; // Kinsoku method of justification:
- // 0 = always expand
- // 1 = compress punctuation
- // 2 = compress punctuation and kana.
- short iLevelOfKinsoku: 2; // Level of Kinsoku:
- // 0 = Level 1
- // 1 = Level 2
- // 2 = Custom
- short f2on1 : 1; // 2-page-on-1 feature is turned on.
- short :10; // reserved
- short cchFollowingPunct; // length of rgxchFPunct
- short cchLeadingPunct; // length of rgxchLPunct
-
- WW8_XCHAR rgxchFPunct[101]; // array of characters that should
- // never appear at the start of a line
- WW8_XCHAR rgxchLPunct[51]; // array of characters that should
- // never appear at the end of a line
-};
-
-struct WW8_DOGRID
-{
- short xaGrid; // x-coord of the upper left-hand corner of the grid
- short yaGrid; // y-coord of the upper left-hand corner of the grid
- short dxaGrid; // width of each grid square
- short dyaGrid; // height of each grid square
-
-
-
- /* a c h t u n g : es duerfen keine solchen Bitfelder ueber einen eingelesenes Byte-Array
- gelegt werden!!
- stattdessen ist ein aBits1 darueber zu legen, das mit & auszulesen ist
- GRUND: Compiler auf Intel und Sparc sortieren die Bits unterschiedlich
- */
-
-
-
- short dyGridDisplay:7; // the number of grid squares (in the y direction)
- // between each gridline drawn on the screen. 0 means
- // don't display any gridlines in the y direction.
- short fTurnItOff :1; // suppress display of gridlines
- short dxGridDisplay:7; // the number of grid squares (in the x direction)
- // between each gridline drawn on the screen. 0 means
- // don't display any gridlines in the y direction.
- short fFollowMargins:1; // if true, the grid will start at the left and top
- // margins and ignore xaGrid and yaGrid.
-};
-
-struct WW8_PIC
-{
- sal_Int32 lcb; // 0x0 number of bytes in the PIC structure plus size of following picture data which may be a Window's metafile, a bitmap, or the filename of a TIFF file.
- sal_uInt16 cbHeader; // 0x4 number of bytes in the PIC (to allow for future expansion).
- struct {
- sal_Int16 mm; // 0x6 int
- sal_Int16 xExt; // 0x8 int
- sal_Int16 yExt; // 0xa int
- sal_Int16 hMF; // 0xc int
- }MFP;
-// sal_uInt8 bm[14]; // 0xe BITMAP(14 bytes) Window's bitmap structure when PIC describes a BITMAP.
- sal_uInt8 rcWinMF[14]; // 0xe rc (rectangle - 8 bytes) rect for window origin
- // and extents when metafile is stored -- ignored if 0
- sal_Int16 dxaGoal; // 0x1c horizontal measurement in twips of the rectangle the picture should be imaged within.
- sal_Int16 dyaGoal; // 0x1e vertical measurement in twips of the rectangle the picture should be imaged within.
- sal_uInt16 mx; // 0x20 horizontal scaling factor supplied by user in .1% units.
- sal_uInt16 my; // 0x22 vertical scaling factor supplied by user in .1% units.
- sal_Int16 dxaCropLeft; // 0x24 the amount the picture has been cropped on the left in twips.
- sal_Int16 dyaCropTop; // 0x26 the amount the picture has been cropped on the top in twips.
- sal_Int16 dxaCropRight; // 0x28 the amount the picture has been cropped on the right in twips.
- sal_Int16 dyaCropBottom;// 0x2a the amount the picture has been cropped on the bottom in twips.
- sal_Int16 brcl : 4; // 000F Obsolete, superseded by brcTop, etc. In
- sal_Int16 fFrameEmpty : 1; // 0010 picture consists of a single frame
- sal_Int16 fBitmap : 1; // 0020 ==1, when picture is just a bitmap
- sal_Int16 fDrawHatch : 1; // 0040 ==1, when picture is an active OLE object
- sal_Int16 fError : 1; // 0080 ==1, when picture is just an error message
- sal_Int16 bpp : 8; // FF00 bits per pixel, 0 = unknown
- WW8_BRC rgbrc[4];
-// BRC brcTop; // 0x2e specification for border above picture
-// BRC brcLeft; // 0x30 specification for border to the left
-// BRC brcBottom; // 0x32 specification for border below picture
-// BRC brcRight; // 0x34 specification for border to the right
- sal_Int16 dxaOrigin; // 0x36 horizontal offset of hand annotation origin
- sal_Int16 dyaOrigin; // 0x38 vertical offset of hand annotation origin
-// sal_uInt8 rgb[]; // 0x3a variable array of bytes containing Window's metafile, bitmap or TIFF file filename.
-};
-
-struct WW8_PIC_SHADOW
-{
- SVBT32 lcb; // 0x0 number of bytes in the PIC structure plus size of following picture data which may be a Window's metafile, a bitmap, or the filename of a TIFF file.
- SVBT16 cbHeader; // 0x4 number of bytes in the PIC (to allow for future expansion).
- struct {
- SVBT16 mm; // 0x6 int
- SVBT16 xExt; // 0x8 int
- SVBT16 yExt; // 0xa int
- SVBT16 hMF; // 0xc int
- }MFP;
-// SVBT8 bm[14]; // 0xe BITMAP(14 bytes) Window's bitmap structure when PIC describes a BITMAP.
- SVBT8 rcWinMF[14]; // 0xe rc (rectangle - 8 bytes) rect for window origin
- // and extents when metafile is stored -- ignored if 0
- SVBT16 dxaGoal; // 0x1c horizontal measurement in twips of the rectangle the picture should be imaged within.
- SVBT16 dyaGoal; // 0x1e vertical measurement in twips of the rectangle the picture should be imaged within.
- SVBT16 mx; // 0x20 horizontal scaling factor supplied by user in .1% units.
- SVBT16 my; // 0x22 vertical scaling factor supplied by user in .1% units.
- SVBT16 dxaCropLeft; // 0x24 the amount the picture has been cropped on the left in twips.
- SVBT16 dyaCropTop; // 0x26 the amount the picture has been cropped on the top in twips.
- SVBT16 dxaCropRight; // 0x28 the amount the picture has been cropped on the right in twips.
- SVBT16 dyaCropBottom;// 0x2a the amount the picture has been cropped on the bottom in twips.
- SVBT8 aBits1; //0x2c
- SVBT8 aBits2;
- WW8_BRC rgbrc[4];
-// BRC brcTop; // 0x2e specification for border above picture
-// BRC brcLeft; // 0x30 specification for border to the left
-// BRC brcBottom; // 0x32 specification for border below picture
-// BRC brcRight; // 0x34 specification for border to the right
- SVBT16 dxaOrigin; // 0x36 horizontal offset of hand annotation origin
- SVBT16 dyaOrigin; // 0x38 vertical offset of hand annotation origin
-// SVBT8 rgb[]; // 0x3a variable array of bytes containing Window's metafile, bitmap or TIFF file filename.
-};
-
-
-struct WW8_TBD
-{
- SVBT8 aBits1;
-// sal_uInt8 jc : 3; // 0x07 justification code: 0=left tab, 1=centered tab, 2=right tab, 3=decimal tab, 4=bar
-// sal_uInt8 tlc : 3; // 0x38 tab leader code: 0=no leader, 1=dotted leader,
- // 2=hyphenated leader, 3=single line leader, 4=heavy line leader
-// * int :2 C0 reserved
-};
-
-struct WW8_TCell // hiermit wird weitergearbeitet (entspricht weitestgehend dem Ver8-Format)
-{
- sal_Bool bFirstMerged : 1;// 0001 set to 1 when cell is first cell of a range of cells that have been merged.
- sal_Bool bMerged : 1;// 0002 set to 1 when cell has been merged with preceding cell.
- sal_Bool bVertical : 1;// set to 1 when cell has vertical text flow
- sal_Bool bBackward : 1;// for a vertical table cell, text flow is bottom to top when 1 and is bottom to top when 0.
- sal_Bool bRotateFont : 1;// set to 1 when cell has rotated characters (i.e. uses @font)
- sal_Bool bVertMerge : 1;// set to 1 when cell is vertically merged with the cell(s) above and/or below. When cells are vertically merged, the display area of the merged cells are consolidated. The consolidated area is used to display the contents of the first vertically merged cell (the cell with fVertRestart set to 1), and all other vertically merged cells (those with fVertRestart set to 0) must be empty. Cells can only be merged vertically if their left and right boundaries are (nearly) identical (i.e. if corresponding entries in rgdxaCenter of the table rows differ by at most 3).
- sal_Bool bVertRestart : 1;// set to 1 when the cell is the first of a set of vertically merged cells. The contents of a cell with fVertStart set to 1 are displayed in the consolidated area belonging to the entire set of vertically merged cells. Vertically merged cells with fVertRestart set to 0 must be empty.
- sal_uInt8 nVertAlign : 2;// specifies the alignment of the cell contents relative to text flow (e.g. in a cell with bottom to top text flow and bottom vertical alignment, the text is shifted horizontally to match the cell's right boundary):
- // 0 top
- // 1 center
- // 2 bottom
- sal_uInt16 fUnused : 7;// reserved - nicht loeschen: macht das sal_uInt16 voll !!
-
- WW8_BRC rgbrc[4]; // border codes
-//notational convenience for referring to brcTop, brcLeft, etc fields.
-// BRC brcTop; // specification of the top border of a table cell
-// BRC brcLeft; // specification of left border of table row
-// BRC brcBottom; // specification of bottom border of table row
-// BRC brcRight; // specification of right border of table row.
-};
-// cbTC (count of bytes of a TC) is 18(decimal), 12(hex).
-
-
-struct WW8_TCellVer6 // wird aus der Datei gelesen
-{
- SVBT8 aBits1Ver6;
- SVBT8 aBits2Ver6;
-// sal_uInt16 fFirstMerged : 1;// 0001 set to 1 when cell is first cell of a range of cells that have been merged.
-// sal_uInt16 fMerged : 1; // 0002 set to 1 when cell has been merged with preceding cell.
-// sal_uInt16 fUnused : 14; // FFFC reserved
- WW8_BRCVer6 rgbrcVer6[4];
-// notational convenience for referring to brcTop, brcLeft, etc fields:
-// BRC brcTop; // specification of the top border of a table cell
-// BRC brcLeft; // specification of left border of table row
-// BRC brcBottom; // specification of bottom border of table row
-// BRC brcRight; // specification of right border of table row.
-};
-// cbTC (count of bytes of a TC) is 10(decimal), A(hex).
-
-struct WW8_TCellVer8 // wird aus der Datei gelesen
-{
- SVBT16 aBits1Ver8; // Dokumentation siehe oben unter WW8_TCell
- SVBT16 aUnused; // reserve
- WW8_BRC rgbrcVer8[4]; // Dokumentation siehe oben unter WW8_TCell
-};
-// cbTC (count of bytes of a TC) is 20(decimal), 14(hex).
-
-
-struct WW8_SHD // struct SHD fehlt in der Beschreibung
-{
-private:
- sal_uInt16 aBits;
-// sal_uInt16 nFore : 5; // 0x001f ForegroundColor
-// sal_uInt16 nBack : 5; // 0x03e0 BackgroundColor
-// sal_uInt16 nStyle : 5; // 0x7c00 Percentage and Style
-// sal_uInt16 nDontKnow : 1; // 0x8000 ??? ab Ver8: ebenfalls fuer Style
-
-public:
- WW8_SHD(){ aBits = 0; }
-
- sal_uInt8 GetFore() const { return (sal_uInt8)( aBits & 0x1f); }
- sal_uInt8 GetBack() const { return (sal_uInt8)((aBits >> 5 ) & 0x1f); }
- sal_uInt8 GetStyle(sal_Bool bVer67) const { return (sal_uInt8)((aBits >> 10) & ( bVer67?0x1f:0x3f ) ); }
-
- sal_uInt16 GetValue() const { return aBits; }
-
- void SetValue( sal_uInt16 nVal ){ aBits = nVal; }
- void SetWWValue( SVBT16 nVal ){ aBits = (sal_uInt16)SVBT16ToShort( nVal ); }
-
- void SetFore( sal_uInt8 nVal ){ aBits = (aBits & 0xffe0) | (nVal & 0x1f); }
- void SetBack( sal_uInt8 nVal ){ aBits = (aBits & 0xfc1f) | ((nVal & 0x1f)<<5); }
- void SetStyle( sal_Bool bVer67, sal_uInt8 nVal ){
- aBits = (aBits & ( bVer67?0x83ff:0x03ff ) )
- | ((nVal & ( bVer67?0x1f:0x2f ))<<10); }
-};
-
-
-struct WW8_ANLV
-{
- SVBT8 nfc; // 0 number format code, 0=Arabic, 1=Upper case Roman, 2=Lower case Roman
- // 3=Upper case Letter, 4=Lower case letter, 5=Ordinal
- SVBT8 cbTextBefore; // 1 offset into anld.rgch limit of prefix text
- SVBT8 cbTextAfter; // 2
- SVBT8 aBits1;
-// sal_uInt8 jc : 2; // 3 : 0x03 justification code, 0=left, 1=center, 2=right, 3=left and right justify
-// sal_uInt8 fPrev : 1; // 0x04 when ==1, include previous levels
-// sal_uInt8 fHang : 1; // 0x08 when ==1, number will be displayed using a hanging indent
-// sal_uInt8 fSetBold : 1; // 0x10 when ==1, boldness of number will be determined by anld.fBold.
-// sal_uInt8 fSetItalic : 1;// 0x20 when ==1, italicness of number will be determined by anld.fItalic
-// sal_uInt8 fSetSmallCaps : 1;// 0x40 when ==1, anld.fSmallCaps will determine whether number will be displayed in small caps or not.
-// sal_uInt8 fSetCaps : 1; // 0x80 when ==1, anld.fCaps will determine whether number will be displayed capitalized or not
- SVBT8 aBits2;
-// sal_uInt8 fSetStrike : 1;// 4 : 0x01 when ==1, anld.fStrike will determine whether the number will be displayed using strikethrough or not.
-// sal_uInt8 fSetKul : 1; // 0x02 when ==1, anld.kul will determine the underlining state of the autonumber.
-// sal_uInt8 fPrevSpace : 1;// 0x04 when ==1, autonumber will be displayed with a single prefixing space character
-// sal_uInt8 fBold : 1; // 0x08 determines boldness of autonumber when anld.fSetBold == 1.
-// sal_uInt8 fItalic : 1; // 0x10 determines italicness of autonumber when anld.fSetItalic == 1.
-// sal_uInt8 fSmallCaps : 1;// 0x20 determines whether autonumber will be displayed using small caps when anld.fSetSmallCaps == 1.
-// sal_uInt8 fCaps : 1; // 0x40 determines whether autonumber will be displayed using caps when anld.fSetCaps == 1.
-// sal_uInt8 fStrike : 1; // 0x80 determines whether autonumber will be displayed using caps when anld.fSetStrike == 1.
- SVBT8 aBits3;
-// sal_uInt8 kul : 3; // 5 : 0x07 determines whether autonumber will be displayed with underlining when anld.fSetKul == 1.
-// sal_uInt8 ico : 5; // 0xF1 color of autonumber
- SVBT16 ftc; // 6 font code of autonumber
- SVBT16 hps; // 8 font half point size (or 0=auto)
- SVBT16 iStartAt; // 0x0a starting value (0 to 65535)
- SVBT16 dxaIndent; // 0x0c *short?* *sal_uInt16?* width of prefix text (same as indent)
- SVBT16 dxaSpace; // 0x0e minimum space between number and paragraph
-};
-// *cbANLV (count of bytes of ANLV) is 16 (decimal), 10(hex).
-
-struct WW8_ANLD
-{
- WW8_ANLV eAnlv; // 0
- SVBT8 fNumber1; // 0x10 number only 1 item per table cell
- SVBT8 fNumberAcross; // 0x11 number across cells in table rows(instead of down)
- SVBT8 fRestartHdn; // 0x12 restart heading number on section boundary
- SVBT8 fSpareX; // 0x13 unused( should be 0)
- sal_uInt8 rgchAnld[32]; // 0x14 characters displayed before/after autonumber
-};
-
-
-struct WW8_OLST
-{
- WW8_ANLV rganlv[9]; // 0 an array of 9 ANLV structures (heading levels)
- SVBT8 fRestartHdr; // 0x90 when ==1, restart heading on section break
- SVBT8 fSpareOlst2; // 0x91 reserved
- SVBT8 fSpareOlst3; // 0x92 reserved
- SVBT8 fSpareOlst4; // 0x93 reserved
- sal_uInt8 rgch[64]; // 0x94 array of 64 chars text before/after number
-};
-// cbOLST is 212(decimal), D4(hex).
-
-struct WW8_FDOA
-{
- SVBT32 fc; // 0 FC pointing to drawing object data
- SVBT16 ctxbx; // 4 count of textboxes in the drawing object
-};
-
-struct WW8_DO
-{
- SVBT16 dok; // 0 Drawn Object Kind, currently this is always 0
- SVBT16 cb; // 2 size (count of bytes) of the entire DO
- SVBT8 bx; // 4 x position relative to anchor CP
- SVBT8 by; // 5 y position relative to anchor CP
- SVBT16 dhgt; // 6 height of DO
- SVBT16 aBits1;
-// sal_uInt16 fAnchorLock : 1; // 8 1 if the DO anchor is locked
-// sal_uInt8[] rgdp; // 0xa variable length array of drawing primitives
-};
-
-struct WW8_DPHEAD
-{
- SVBT16 dpk; // 0 Drawn Primitive Kind REVIEW davebu
- // 0=start of grouping, 1=line, 2=textbox, 3=rectangle,
- // 4=arc, 5=elipse, 6=polyline, 7=callout textbox,
- // 8=end of grouping, 9=sample primitve holding default values
- SVBT16 cb; // 2 size (count of bytes) of this DP
- SVBT16 xa; // 4 These 2 points describe the rectangle
- SVBT16 ya; // 6 enclosing this DP relative to the origin of
- SVBT16 dxa; // 8 the DO
- SVBT16 dya; // 0xa
-};
-
-
-struct WW8_DP_LINETYPE
-{
- SVBT32 lnpc; // LiNe Property Color -- RGB color value
- SVBT16 lnpw; // line property weight in twips
- SVBT16 lnps; // line property style : 0=Solid, 1=Dashed
- // 2=Dotted, 3=Dash Dot, 4=Dash Dot Dot, 5=Hollow
-};
-
-struct WW8_DP_SHADOW // Schattierung!
-{
- SVBT16 shdwpi; // Shadow Property Intensity
- SVBT16 xaOffset; // x offset of shadow
- SVBT16 yaOffset; // y offset of shadow
-};
-
-struct WW8_DP_FILL
-{
- SVBT32 dlpcFg; // FiLl Property Color ForeGround -- RGB color value
- SVBT32 dlpcBg; // Property Color BackGround -- RGB color value
- SVBT16 flpp; // FiLl Property Pattern REVIEW davebu
-};
-
-struct WW8_DP_LINEEND
-{
- SVBT16 aStartBits;
-// sal_uInt16 eppsStart : 2; // Start EndPoint Property Style
- // 0=None, 1=Hollow, 2=Filled
-// sal_uInt16 eppwStart : 2; // Start EndPoint Property Weight
-// sal_uInt16 epplStart : 2; // Start EndPoint Property length
-// sal_uInt16 dummyStart : 10; // Alignment
- SVBT16 aEndBits;
-// sal_uInt16 eppsEnd : 2; // End EndPoint Property Style
-// sal_uInt16 eppwEnd : 2; // End EndPoint Property Weight
-// sal_uInt16 epplEnd : 2; // End EndPoint Property length
-// sal_uInt16 dummyEnd : 10; // Alignment
-};
-
-struct WW8_DP_LINE
-{
-// WW8_DPHEAD dphead; // 0 Common header for a drawing primitive
- SVBT16 xaStart; // starting point for line
- SVBT16 yaStart; //
- SVBT16 xaEnd; // ending point for line
- SVBT16 yaEnd;
- WW8_DP_LINETYPE aLnt;
- WW8_DP_LINEEND aEpp;
- WW8_DP_SHADOW aShd;
-};
-
-struct WW8_DP_TXTBOX
-{
- WW8_DP_LINETYPE aLnt;
- WW8_DP_FILL aFill;
- WW8_DP_SHADOW aShd;
- SVBT16 aBits1;
-// sal_uInt16 fRoundCorners : 1; //0x24 0001 1 if the textbox has rounded corners
-// sal_uInt16 zaShape : 15; // 0x24 000e REVIEW davebu
- SVBT16 dzaInternalMargin; // 0x26 REVIEW davebu
-};
-
-struct WW8_DP_RECT
-{
- WW8_DP_LINETYPE aLnt;
- WW8_DP_FILL aFill;
- WW8_DP_SHADOW aShd;
- SVBT16 aBits1;
-// sal_uInt16 fRoundCorners : 1; // 0x24 0001 1 if the textbox has rounded corners
-// sal_uInt16 zaShape : 15; // 0x24 000e REVIEW davebu
-};
-
-struct WW8_DP_ARC
-{
- WW8_DP_LINETYPE aLnt;
- WW8_DP_FILL aFill;
- WW8_DP_SHADOW aShd;
- SVBT8 fLeft; // 0x24 00ff REVIEW davebu
- SVBT8 fUp; // 0x24 ff00 REVIEW davebu
-// sal_uInt16 fLeft : 8; // 0x24 00ff REVIEW davebu
-// sal_uInt16 fUp : 8; // 0x24 ff00 REVIEW davebu
-};
-
-struct WW8_DP_ELIPSE
-{
- WW8_DP_LINETYPE aLnt;
- WW8_DP_FILL aFill;
- WW8_DP_SHADOW aShd;
-};
-
-struct WW8_DP_POLYLINE
-{
- WW8_DP_LINETYPE aLnt;
- WW8_DP_FILL aFill;
- WW8_DP_LINEEND aEpp;
- WW8_DP_SHADOW aShd;
- SVBT16 aBits1;
-// sal_uInt16 fPolygon : 1; // 0x28 0001 1 if this is a polygon
-// sal_uInt16 cpt : 15; // 0x28 00fe count of points
-// short xaFirst; // 0x2a These are the endpoints of the first line.
-// short yaFirst; // 0x2c
-// short xaEnd; // 0x2e
-// short yaEnd; // 0x30
-// short rgpta[]; // 0x32 An array of xa,ya pairs for the remaining points
-};
-
-struct WW8_DP_CALLOUT_TXTBOX
-{
- SVBT16 flags; // 0x0c REVIEW davebu flags
- SVBT16 dzaOffset; // 0x0e REVIEW davebu
- SVBT16 dzaDescent; // 0x10 REVIEW davebu
- SVBT16 dzaLength; // 0x12 REVIEW davebu
- WW8_DPHEAD dpheadTxbx; // 0x14 DPHEAD for a textbox
- WW8_DP_TXTBOX dptxbx; // 0x20 DP for a textbox
- WW8_DPHEAD dpheadPolyLine; // 0x4c DPHEAD for a Polyline
- WW8_DP_POLYLINE dpPolyLine; // 0x48 DP for a polyline
-};
-
-struct WW8_DP_DEFAULTS
-{
- WW8_DP_LINETYPE aLnt;
- WW8_DP_FILL aFill;
- WW8_DP_LINEEND aEpp;
- WW8_DP_SHADOW aShd;
- SVBT16 dzaOffset; // 0x2a REVIEW davebu
- SVBT16 dzaDescent; // 0x2c REVIEW davebu
- SVBT16 dzaLength; // 0x2e REVIEW davebu
-
- SVBT16 aBits3;
-// sal_uInt16 fRoundCorners : 1; // 0x30 0001 1 if the textbox has rounded corners
-// sal_uInt16 zaShape : 15; // 0x30 000fe REVIEW davebu
- SVBT16 dzaInternalMargin; // 0x32 REVIEW davebu
-};
-
-
-struct WW8_PCD
-{
- SVBT8 aBits1;
-// sal_uInt8 fNoParaLast : 1; // when 1, means that piece contains no end of paragraph marks.
-// sal_uInt8 fPaphNil : 1; // used internally by Word
-// sal_uInt8 fCopied : 1; // used internally by Word
-// * int :5
- SVBT8 aBits2; // fn int:8, used internally by Word
- SVBT32 fc; // file offset of beginning of piece. The size of the
- // ithpiece can be determined by subtracting rgcp[i] of
- // the containing plcfpcd from its rgcp[i+1].
- SVBT16 prm; // PRM contains either a single sprm or else an index number
- // of the grpprl which contains the sprms that modify the
- // properties of the piece.
-};
-
-struct WW8_PHE_Base
-{
- sal_uInt8 aBits1; //
-// 0 0 fSpare int :1 0001 reserved
-// fUnk int :1 0002 phe entry is invalid
-// when == 1
-// fDiffLines int :1 0004 when 1, total
-// height of paragraph is known but lines in
-// paragraph have different heights.
-// * int :5 00F8 reserved
- sal_uInt8 nlMac; // when fDiffLines is 0 is number of lines in
-// // paragraph
- SVBT16 dxaCol; // width of lines in paragraph
- SVBT16 dyl;
-// 4 4 dylLine int when fDiffLines is 0,
-// is height of every line in paragraph.in pixels
-// 4 4 dylHeight uns when fDiffLines is 1,
-// is the total height in pixels of the paragraph
-};
-
-/*
-eigentlich muessten wir das jetzt in etwa *so* praezisieren:
-
- struct WW8_PHE_Ver6 : public WW8_PHE_Base
- {
- // 6 Bytes gross
- };
- struct WW8_PHE_Ver6 : public WW8_PHE_Base
- {
- SVBT16 a;
- SVBT16 b;
- SVBT16 c; // 12 Byte gross
- };
-*/
-
-// AnnoTation Refernce Descriptor (ATRD)
-struct WW8_ATRD // fuer die 8-Version
-{
- SVBT16 xstUsrInitl[ 10 ]; // pascal-style String holding initials
- // of annotation author
- SVBT16 ibst; // index into GrpXstAtnOwners
- SVBT16 ak; // not used
- SVBT16 grfbmc; // not used
- SVBT32 ITagBkmk; // when not -1, this tag identifies the
- // annotation bookmark that locates the
- // range of CPs in the main document which
- // this annotation references.
-};
-
-struct WW67_ATRD // fuer die 6/7-Version
-{
- sal_Char xstUsrInitl[ 10 ]; // pascal-style String holding initials
- // of annotation author
- SVBT16 ibst; // index into GrpXstAtnOwners
- SVBT16 ak; // not used
- SVBT16 grfbmc; // not used
- SVBT32 ITagBkmk; // when not -1, this tag identifies the
- // annotation bookmark that locates the
- // range of CPs in the main document which
- // this annotation references.
-};
-
-
-#ifdef __WW8_NEEDS_PACK
-#pragma pack()
-#endif
-
-#endif