[Libreoffice-commits] .: binfilter/bf_sw binfilter/prj
Joseph Powers
jpowers at kemper.freedesktop.org
Thu Oct 6 07:33:23 PDT 2011
binfilter/bf_sw/source/filter/basflt/makefile.mk | 5
binfilter/bf_sw/source/filter/basflt/sw_w4wflt.cxx | 336 -
binfilter/bf_sw/source/filter/inc/w4wflt.hxx | 48
binfilter/bf_sw/source/filter/inc/w4wpar.hxx | 866 ----
binfilter/bf_sw/source/filter/inc/w4wstk.hxx | 141
binfilter/bf_sw/source/filter/makefile.mk | 3
binfilter/bf_sw/source/filter/w4w/makefile.mk | 68
binfilter/bf_sw/source/filter/w4w/sw_w4wgraf.cxx | 1016 -----
binfilter/bf_sw/source/filter/w4w/sw_w4wpar1.cxx | 3732 --------------------
binfilter/bf_sw/source/filter/w4w/sw_w4wpar2.cxx | 3874 ---------------------
binfilter/bf_sw/source/filter/w4w/sw_w4wpar3.cxx | 1360 -------
binfilter/bf_sw/source/filter/w4w/sw_w4wstk.cxx | 592 ---
binfilter/bf_sw/source/filter/w4w/w4wgraf.hxx | 95
binfilter/bf_sw/source/filter/w4w/wrtw4w.hxx | 98
binfilter/bf_sw/util/makefile.mk | 3
binfilter/prj/build.lst | 6
16 files changed, 6 insertions(+), 12237 deletions(-)
New commits:
commit cdc51fd46746e0cffe3cb737db459fb145627f83
Author: Joseph Powers <jpowers27 at cox.net>
Date: Thu Oct 6 07:32:54 2011 -0700
Remove the rest of the W4W source
If we don't ship the W4W drivers and you can no longer select any of the
W4W filters, I don't see a need for for the code that allows you to load
and use the W4W drivers.
diff --git a/binfilter/bf_sw/source/filter/basflt/makefile.mk b/binfilter/bf_sw/source/filter/basflt/makefile.mk
index 5c217c0..03bf1eb 100644
--- a/binfilter/bf_sw/source/filter/basflt/makefile.mk
+++ b/binfilter/bf_sw/source/filter/basflt/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -49,8 +49,7 @@ CDEFS+=-Dmydebug
SLOFILES = \
$(SLO)$/sw_docfact.obj \
$(SLO)$/sw_fltini.obj \
- $(SLO)$/sw_shellio.obj \
- $(SLO)$/sw_w4wflt.obj
+ $(SLO)$/sw_shellio.obj
# --- Tagets -------------------------------------------------------
diff --git a/binfilter/bf_sw/source/filter/basflt/sw_w4wflt.cxx b/binfilter/bf_sw/source/filter/basflt/sw_w4wflt.cxx
deleted file mode 100644
index ad5d70d..0000000
--- a/binfilter/bf_sw/source/filter/basflt/sw_w4wflt.cxx
+++ /dev/null
@@ -1,336 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include <bf_svtools/pathoptions.hxx>
-#include <unotools/localfilehelper.hxx>
-
-// -------------------------------------------------------------------
-
-#ifdef MAC
-
-#include <mac_start.h>
-#include <Resources.h>
-#include <Memory.h>
-#include <Signal.h>
-#include <Types.h>
-#include <Strings.h>
-#include <mac_end.h>
-
-typedef int (*FNDisplay)(int);
-# define FNDisp int
-typedef int(**CHand)( void*, void*, void*, void*, void* );
-
-#endif
-
-// -------------------------------------------------------------------
-#if defined( WIN ) || defined( WNT )
-
-#include <bf_svtools/bf_prewin.h>
-#include <bf_svtools/bf_postwin.h>
-
-typedef int ( FAR PASCAL *FNDisplay)( int );
-
-#ifdef WIN
-#define FNDisp _loadds FAR PASCAL
-#else
-#define FNDisp FAR PASCAL
-#endif // WIN
-
-typedef int (FAR PASCAL *FNautorec)( LPSTR, int, LPINT );
-typedef int (FAR PASCAL *FNw4wt)( LPSTR, LPSTR, LPSTR, LPSTR, FNDisplay );
-typedef int (FAR PASCAL *FNw4wf)( LPSTR, LPSTR, LPSTR, LPSTR, FNDisplay );
-
-#endif // defined( WIN ) || defined( WNT )
-
-// ---------------------------------------------------------------------
-
-#ifdef UNX
-#include <stdlib.h>
-#endif
-
-// -------------------------------------------------------------------
-
-#ifdef PM2
-#define INCL_DOS // fuer bsedos.h <- os2.h <- svpm.h <- sysdep.hxx
-#endif
-
-// -------------------------------------------------------------------
-
-#include <bf_sfx2/app.hxx>
-#include <unotools/tempfile.hxx>
-
-#include <swtypes.hxx>
-#include <w4wflt.hxx>
-
-#include <swerror.h>
-
-namespace binfilter {
-
-#define ERR_DLL 9999
-
-// Handler fuer die Prozentanzeige
-
-#if defined( WIN ) || defined( WNT ) || defined( PM2 )
-
-int FNDisp W4WReadDisplayHandler( int nPercent )
-{
-// no progress display in binfilter!
-// ::binfilter::SetProgressState( nPercent / 3, 0 );
- return 0; // -1 fuehrt zu Abbruch
-}
-
-int FNDisp W4WWriteDisplayHandler( int nPercent )
-{
-// no progress display in binfilter!
-// ::binfilter::SetProgressState( 67 + nPercent / 3, 0 );
- return 0; // -1 fuehrt zu Abbruch
-}
-
-#endif
-
-// W4W speichert beim Laden vom File rFileName die Ausgabe in aTmpFile.
-// der Filter wird ueber nFilter bestimmt.
-
-ULONG LoadFile( const String& rFileName, USHORT nFilter,
- const String& rVersion, String & rTmpFile )
-{
- rTmpFile = utl::TempFile::CreateTempName( 0 );
- String sNativeFileName(rTmpFile);
- USHORT nError = 1;
-
- rtl_TextEncoding eEnc = ::gsl_getSystemTextEncoding();
- ByteString sFileName( rFileName, eEnc ), sVersion( rVersion, eEnc ),
- sTmpFile( rTmpFile, eEnc );
-
- {
- String sTmp;
- if( utl::LocalFileHelper::ConvertPhysicalNameToURL( rTmpFile, sTmp ))
- rTmpFile = sTmp;
- }
-
-#ifdef MAC
-
- nError = Call_MacRes( rFileName, nFilter, TRUE, rVersion, rTmpFile );
-
-#else //MAC
-
- String aFormat;
-
-#if defined( WIN ) || defined( WNT )
- aFormat += 'w';
- if( nFilter < 10 )
- aFormat += '0';
- if( nFilter < 100 )
- aFormat += '0';
- aFormat += String::CreateFromInt32( nFilter );
- aFormat += 'f';
-#if defined( WIN )
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "16W" ));
-#else // WIN
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "32W" ));
-#endif // WIN
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ".DLL" ));
-#endif // defined( WIN ) || defined( WNT )
-
-#ifdef PM2
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "w4w" ));
- if( nFilter < 10 )
- aFormat += '0';
- aFormat += String::CreateFromInt32( nFilter );
- aFormat += 'f';
-
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ".dll" ));
-#endif // PM2
-
-#ifdef UNX
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "w4w" ));
- if( nFilter < 10 )
- aFormat += '0';
- aFormat += String::CreateFromInt32( nFilter );
- aFormat += 'f';
-#endif // UNX
-
- SvtPathOptions aOpt;
- if( !aOpt.SearchFile( aFormat, SvtPathOptions::PATH_FILTER ) )
- return ERR_W4W_DLL_ERROR | ERROR_SW_READ_BASE;
-
- ByteString sFormat( aFormat, ::gsl_getSystemTextEncoding() );
-#if defined( WIN ) || defined( WNT )
-
- ByteString aEmptyByteStr;
- HANDLE hDLL = LoadLibrary( (LPSTR)sFormat.GetBuffer() );
- if( hDLL >= (HANDLE)HINSTANCE_ERROR )
- {
- FNw4wf fnRead = (FNw4wf)GetProcAddress( (HINSTANCE)hDLL, (LPSTR)"w4wf" );
- if( fnRead )
- nError = (*fnRead)( (LPSTR)sFileName.GetBuffer(),
- (LPSTR)sTmpFile.GetBuffer(),
- (LPSTR)sVersion.GetBuffer(),
- (LPSTR)aEmptyByteStr.GetBuffer(),
- (FNDisplay)&W4WReadDisplayHandler
- );
-
- FreeLibrary( (HINSTANCE)hDLL );
- }
-#ifndef WIN /* Bei Windows kommt schon eine System-Box hoch */
- else
- nError = ERR_DLL;
-#endif
-
-#endif //WIN || WNT
-
-#ifdef PM2
- HMODULE hDLL;
- ByteString aEmptyByteStr;
- CHAR sLoadError[ 100 ];
- APIRET rc = DosLoadModule( (PSZ)sLoadError, sizeof( sLoadError ),
- (PSZ)sFormat.GetBuffer(), &hDLL );
- if( !rc )
- {
- PFN ppFN;
- ULONG nBitVers;
-
- if( 0 == ( rc = DosQueryProcType( hDLL, 0L, (PSZ)"w4wf", &nBitVers )) &&
- 1 == nBitVers && // 32 Bit DLLs
- 0 == ( rc = DosQueryProcAddr( hDLL, 0L, (PSZ)"w4wf", &ppFN )))
- {
- // die neuen 32 Bit DLLs
- FN32w4wf fnRead = (FN32w4wf)ppFN;
- nError = (*fnRead)( (PSZ)sFileName.GetBuffer(),
- (PSZ)sTmpFile.GetBuffer(),
- (PSZ)sVersion.GetBuffer(),
- (PSZ)aEmptyByteStr.GetBuffer(),
- (FN32Display)&W4WReadDisplayHandler
- );
- }
-//Bug 33334: Modul wird von OS/2 nie aus dem Speicher entfernt,
-// W4W stoplter darueber --> also nie entfernen!
-//JP 23.04.98: fuer den DCF-RFT-Filter unter OS/2 muss aber die DLL
-// freigegeben werden.
- if( 15 == nFilter )
- DosFreeModule( hDLL );
- }
- else
- nError = ERR_DLL;
-#endif // PM2
-
-#ifdef UNX
-
- String aParam( aFormat );
- aParam += ' ';
- aParam += rFileName;
- aParam.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " -N -t=" ));
- aParam += sNativeFileName;
- aParam.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " -v" ));
- aParam += rVersion;
-
- ByteString sParam( aParam, ::gsl_getSystemTextEncoding() );
-
- nError = system( sParam.GetBuffer() );
-#endif // UNX
-#endif // MAC
-
-static const ULONG nErrors[18]={
- 0, ERR_SWG_READ_ERROR, ERR_SWG_READ_ERROR, ERR_W4W_WRITE_TMP_ERROR,
- ERR_W4W_WRITE_TMP_ERROR, ERR_SWG_FILE_FORMAT_ERROR,
- ERR_W4W_WRITE_TMP_ERROR, ERR_W4W_WRITE_TMP_ERROR,
- ERR_W4W_MEM | ERROR_SW_READ_BASE,
- ERR_SWG_FILE_FORMAT_ERROR, ERR_W4W_WRITE_FULL | ERROR_SW_READ_BASE,
- 0, 0, 0,
- 0, ERR_SW6_PASSWD, ERR_W4W_INTERNAL_ERROR | ERROR_SW_READ_BASE,
- 0 };
-
- if ( nError != 12 ) // 12 ist nur Warning
- {
- if ( nError == ERR_DLL )
- return ERR_W4W_DLL_ERROR | ERROR_SW_READ_BASE;
- if ( nError>0 && nError<=17 )
- return nErrors[ nError ];
- }
- return 0;
-}
-
-bool W4WDLLExist( W4WDLL_TYPE eType, USHORT nFilter )
-{
-#ifdef MAC
- return TRUE; // dann beim CallMacRes feststellen
-#else
-
- String aFormat;
- switch( eType )
- {
- case W4WDLL_EXPORT:
- case W4WDLL_IMPORT:
-#if defined( PM2 ) || defined( UNX )
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "w4w" ));
- if( nFilter < 10 )
- aFormat += '0';
- aFormat += String::CreateFromInt32( nFilter );
- aFormat += W4WDLL_IMPORT ? 'f' : 't';
-#endif // PM2 || UNX
-
-#if defined( WIN ) || defined( WNT )
- aFormat += 'w';
- if( nFilter < 10 )
- aFormat += '0';
- if( nFilter < 100 )
- aFormat += '0';
- aFormat += String::CreateFromInt32( nFilter );
- aFormat += W4WDLL_IMPORT ? 'f' : 't';
-#if defined( WIN )
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "16W" ));
-#else // WIN
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "32W" ));
-#endif // WIN
-
-#endif // WIN || WNT
- break;
-
- case W4WDLL_AUTODETEC:
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "autorec" ));
- break;
- }
-
-#ifndef UNX
- aFormat.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ".dll" ));
-#endif // UNX
-
- // Fehlerbehandlung oder fuer Systeme die keine W4W-Filter kennen
- SvtPathOptions aOpt;
-
- return aOpt.SearchFile( aFormat, SvtPathOptions::PATH_FILTER );
-#endif // MAC
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/filter/inc/w4wflt.hxx b/binfilter/bf_sw/source/filter/inc/w4wflt.hxx
deleted file mode 100644
index bca660f..0000000
--- a/binfilter/bf_sw/source/filter/inc/w4wflt.hxx
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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 _W4WFLT_HXX
-#define _W4WFLT_HXX
-
-#include <bf_svtools/bf_solar.h>
-class String;
-namespace binfilter {
-
-// W4W speichert beim Laden vom File pFileName die Ausgabe in pTmpFile.
-// (das Tempfile wird hier anleget!)
-// der Filter wird ueber nFilter bestimmt.
-ULONG LoadFile( const String& rFileName, USHORT nFilter,
- const String& rVersion, String & rTmpFile );
-
-enum W4WDLL_TYPE { W4WDLL_EXPORT, W4WDLL_IMPORT, W4WDLL_AUTODETEC };
-bool W4WDLLExist( W4WDLL_TYPE eType, USHORT nFilter = 0 );
-
-
-} //namespace binfilter
-#endif // _W4WFLT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/filter/inc/w4wpar.hxx b/binfilter/bf_sw/source/filter/inc/w4wpar.hxx
deleted file mode 100644
index f6e803b..0000000
--- a/binfilter/bf_sw/source/filter/inc/w4wpar.hxx
+++ /dev/null
@@ -1,866 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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 _W4WPAR_HXX
-#define _W4WPAR_HXX
-
-#include <bf_svtools/bf_solar.h>
-
-#include <tools/string.hxx>
-#include <tools/table.hxx>
-#include <tools/stream.hxx>
-
-#include <swtypes.hxx>
-#include <hintids.hxx>
-
-#include <swrect.hxx>
-#include <tblsel.hxx> // SwSelBoxes
-#include <numrule.hxx> // numerierte Listen
-
-class String;
-class Graphic;
-namespace binfilter {
-
-class SfxPoolItem;
-class SfxItemSet;
-
-// Konstanten fuer die internen Fehler-Codes beim Einlesen
-#define ERR_NOERROR 0
-#define ERR_CHAR 1
-#define ERR_RECORD 2
-#define ERR_NAMETOLONG 3
-
-// Konstanten fuer den Anfang und Ende der Records
-#define W4WR_BEGICF 0x1B
-#define W4WR_LED 0x1D
-#define W4WR_TXTERM 0x1F
-#define W4WR_RED 0x1E
-
-#define W4W_INVALID (USHORT)-1
-
-#define W4WFL_NO_FLY_IN_CNTNT 0x01
-#define W4WFL_NO_GRAF_IN_CNTNT 0x02
-#define W4WFL_EXACT_TABLES 0x04
-#define W4WFL_NO_DBL_TBL_BORDER_REMOVE 0x08
-#define W4WFL_NO_WW_SPECCHAR 0x10
-#define W4WFL_NO_APO_HNL_REMOVE 0x20
-#define W4WFL_NO_DBL_APO_BORDER_REMOVE 0x40
-#define W4WFL_NO_HDFT_DIST 0x80
-#define W4WFL_ALL_HDFT_DIST 0x100
-#define W4WFL_NO_PCTEXT4_124 0x200
-#define W4WFL_NO_PCTEXT4_INDENT 0x400
-#define W4WFL_ALL_HDFT_MAINATTR 0x800
-#define W4WFL_NO_PCTEXT4_HDFT_MAINATTR 0x1000
-#define W4WFL_NO_PCTEXT4_STP_DEC2 0x2000
-
-// ( Standardverhalten: analysieren, was Standard sein duerfte )
-// W4WFL_FrameMaker_cleverFrames 0x00000000;
-
-// ( keine Frames: blind einlesen )
-#define W4WFL_FM_neverFrames 0x00000001
-
-// ( ALLES als Frames einlesen:
-// kein Content fuer Header/Body/Footer )
-#define W4WFL_FM_onlyFrames 0x00000002
-
-
-
-
-typedef USHORT* UShortPtr;
-
-class SwDoc;
-class SwPaM;
-
-class SwTxtFmtColl;
-class SwPageDesc;
-class SvxBoxItem;
-
-class W4WTabBorders;
-
-class W4WMergeGroups; // enthaelt Sw_SelBoxes_SAR
-
-class W4WStyleIdTab;
-class W4WCtrlStack;
-class SwTable;
-class SwTableNode;
-class SwTableLines;
-class SwTableLine;
-class SwTableBoxes;
-class SwTableBox;
-
-class SwW4WGraf;
-class SvxLRSpaceItem;
-class SvxULSpaceItem;
-class swistream;
-class SwFlyFrmFmt;
-struct W4WRecord;
-
-
-struct W4WRecType
-{
- sal_Char c0, c1, c2;
- void Reset()
- {
- c0 = 0;
- c1 = 0;
- c2 = 0;
- }
- BOOL IsEqual(const W4WRecType& rRec) const
- {
- return (rRec.c0 == c0) && (rRec.c1 == c1) && (rRec.c2 == c2);
- }
- BOOL IsEqual( const sal_Char* pRec, int nLen ) const
- {
- return (3 == nLen )
- && (*(pRec+0) == c0)
- && (*(pRec+1) == c1)
- && (*(pRec+2) == c2);
- }
-};
-
-
-struct W4W_ColdT // ColumnsDefinitionTyp, nur in W4WPar2.cxx benutzt
-{
- long nLeft; //!!! kann eigentlich nach w4wpar2.cxx
- long nRight;
- long nNC;
- long nLeftTw;
- long nRightTw;
- long nNC2;
- long nWidthFrac;
- USHORT nMergeGroupIdx; // falls groesser -1 ist Merge-Gruppe offen
- long nRemainingMergeRows; // wieweit nach unten mergen wir noch dazu
-};
-
-
-struct W4WRectInfo
-{
- SwRect aRect;
- int nPDTId; // Nummer der Seite im PDT array
- int nFLOId; // Nummer des FLO, in dem das Rect enthalten ist
-
- int nFMId; // urspruengliche FrameMaker-Id aus dem W4W-Code
- int nSWId; // Id des W4WRectInfo, den wir im SW dafuer nehmen
- // ( z.B. bei Spaltigkeit: alle Spalten weisen
- // auf den linken Rahmen )
-
- BOOL bInside: 1; // Frame liegt in einem anderen drinnen
- BOOL bColXYZ: 1; // Folge-Spalten eines spalt. Bereichs
- BOOL bBody: 1; // Body-Bereich, also KEIN Fly
- BOOL bHeader: 1; // Header " "
- BOOL bFooter: 1; // Footer " "
-
- W4WRectInfo(const SwRect& rRect_, int nId_, int nPDTId_ = -1):
- aRect( rRect_ ),
- nPDTId( nPDTId_),
- nFMId( nId_ ),
- nSWId( nId_ )
- {
- bInside = FALSE;
- bColXYZ = FALSE;
- bBody = FALSE;
- bHeader = FALSE;
- bFooter = FALSE;
- }
- /*
- void StoreRect(SwRect* pRect_, int nId_, int nPDTId_)
- {
- aRect = pRect_;
- nPDTId = nPDTId_;
- nFMId = nId_;
- nSWId = nId_;
- bInside = FALSE;
- bColXYZ = FALSE;
- bBody = FALSE;
- bHeader = FALSE;
- bFooter = FALSE;
- }
- void StoreRect(W4WRectInfo& rInfo)
- {
- pRect = rInfo.pRect;
- nPDTId = rInfo.nPDTId;
- nFMId = rInfo.nFMId;
- nSWId = rInfo.nSWId;
- bInside = rInfo.bInside;
- bColXYZ = rInfo.bColXYZ;
- bBody = rInfo.bBody;
- bHeader = rInfo.bHeader;
- bFooter = rInfo.bFooter;
- }
- */
- BOOL IsActive(){ return !(bColXYZ || bInside); }
- BYTE BodyHdFtMode(){ return bBody ? 1 : (bHeader ? 2 : 3); }
-};
-
-
-struct W4WPDTInfo
-{
- String sPageName;
- long* pIds;
- long nPageType; // 1 == Body Page, 2 == Master Page, 3 == Reference Page
- long nPageSubType; // 1 == Left Page, 2 == Right Page, 3 == First Page ???
- long nRects;
- USHORT nSwPdId;
- USHORT nBodyRectId;
- USHORT nHdRectId;
- USHORT nFtRectId;
- BOOL bSwPdUsed :1;
- BOOL bPageWidthUnknown :1;// Page Margin rechts noch nicht eingestellt
- BOOL bPageHeightUnknown :1;// unten
- W4WPDTInfo()
- : pIds(0)
- , nPageType(1)
- , nPageSubType(0)
- , nRects(0)
- , nSwPdId(USHRT_MAX)
- , nBodyRectId(USHRT_MAX)
- , nHdRectId(USHRT_MAX)
- , nFtRectId(USHRT_MAX)
- {
- bSwPdUsed = FALSE;
- bPageWidthUnknown = TRUE;
- bPageHeightUnknown = TRUE;
- }
- ~W4WPDTInfo(){ delete pIds; }
- BOOL PageSizeKnown(){ return 0 == ( bPageWidthUnknown
- | bPageHeightUnknown ); }
-};
-typedef W4WPDTInfo* W4WPDTInfo_Ptr;
-SV_DECL_PTRARR_DEL(W4WPDTInfos, W4WPDTInfo_Ptr, 16, 16)
-
-
-struct W4WFLOInfo
-{
- long* pIds;
- long nFlowId;
- long nRects;
- BOOL bFlowUsed:1;
- W4WFLOInfo()
- : pIds(0)
- , nFlowId(0)
- , nRects(0)
- { bFlowUsed = FALSE; }
- ~W4WFLOInfo(){ delete pIds; }
-};
-typedef W4WFLOInfo* W4WFLOInfo_Ptr;
-SV_DECL_PTRARR_DEL(W4WFLOInfos, W4WFLOInfo_Ptr, 16, 16)
-
-
-DECLARE_TABLE(W4WRDTInfos, W4WRectInfo*)
-
-
-class SwW4WParser
-{
- // Zum Unterscheiden, von wo die Methode
- // SwW4WParser::UpdatePageMarginSettings() aufgerufen wurde
- enum W4W_UpdtPgMrgSet
- {
- CALLED_BY_HF2, // Methode wurde aufgerufen wegen HF2-Flag,
- CALLED_BY_HF1, // wegen HF1-Flag,
- CALLED_BY_FLUSH_OR_HNL // aus SwW4WParser::Flush() oder nach .<HNL>
- };
-
- // Zur Parametrisierung von SwW4WParser::CreatePageDesc()
- enum W4W_CreatePgDescSet
- {
- CRPGD_AS_FOLLOW = 0x01, // es soll ein Follow-PageDesc werden
- CRPGD_AND_INSERT= 0x02, // PageDesc wird ins pDoc inserted
- CRPGD_REMOVE_HD = 0x04, // Header des Vorgaengers NICHT uebernehmen
- CRPGD_REMOVE_FT = 0x08, // Footer des Vorgaengers NICHT uebernehmen
- CRPGD_UPDT_MRGN = 0x10 // ggfs. SwW4WParser::SetPageMgn() aufrufen
- };
-
- // zum Erkennen des unbekannten Zustands einer booleschen Variablen
- enum W4W_THREE_STATE
- {
- VALUE_FALSE = 0x00, // wahr
- VALUE_UNKNOWN = 0x01, // (noch) unbekannter Wert
- VALUE_TRUE = 0x02 // unwahr
- };
-
-
- sal_Unicode aCharBuffer[ 512 ]; // Puffer fuer die Zeichen
-
- const String& rVersion; // Unterversion des Filteraufrufs
- //; Bit 0: Rahmen werden niemals an Zeichen gebunden
- //; Bit 1: Bilder werden niemals an Zeichen gebunden
- //; Bit 2: Tabelle punktgenau positionieren ( nicht so robust )
- //; Bit 3: Umrandungen von Tabellenzellen nicht ausduennen
- //; Bit 4: bei WinWord2 Umlauten nicht mogeln ( ab Version 94c )
- //; Bit 5: bei WinWord2 ueberfluessige Leerzeilen nicht ignorieren ( ab Version 102 )
- //; Bit 6: Bei Frames doppelte Umrandungen nicht unterdruecken
-
- //; Bit 16: ASCII-Export darf ^L enthalten
- //; Bit 17: Grafiken nicht exportieren
-
- /*
- Pointer
- */
- W4WCtrlStack* pCtrlStck; // Stack fuer die Attribute
-
- SwW4WGraf* pGraf; // Pointer auf W4W-Grafik-Klasse
- Graphic* pGraphic; // Hier ist die Grafik
-
- SwTableNode* pTblNd; // Tabellen-Node
- SwTableLine* pTabLine; // akt. Zeile
- SwTableBoxes* pTabBoxes; // Boxen-Array in akt. Zeile
- SwTableBox* pTabBox; // akt. Zelle
-
- W4W_ColdT* pTabDefs; // ColumnsDefinition
-
- W4WTabBorders* pTabBorders; // .<BRO>-Raender einer ganzen Tabelle
-
- W4WMergeGroups* pMergeGroups; // Listen aller zu verknuepfenden Zellen
-
- SwNodeIndex* pBehindSection; // Node-Index zum Zuruecksetzen des PaM nach einem Bereich
-
- W4WPDTInfos* pPDTInfos; // array von PageDefinitionTable
- W4WRDTInfos* pRDTInfos; // array von RectangleDefinitionTable
- W4WFLOInfos* pFLOInfos; // array von Text Folow
-
- W4WPDTInfo* pPDTInfo; // Id der derzeit aktuellen PDT (FrameMaker)
- W4WRectInfo* pActRectInfo; // Rect-1 des derzeitigen TextFlow (FrameMaker)
-
- // aktuelles Seitenlayout, oder das bei naechstem
- // Seitenumbruch automatisch zu nehmende Layout
- SwPageDesc* pPageDesc;
-
- // letztes per PageAttr gesetztes Seitenlayout
- SwPageDesc* pLastActPageDesc;
-
- // aktuelles Seitenlayout, falls bereits ein Folge-Layout definiert wurde,
- // das in pPageDesc gespeichert ist, sonst 0
- SwPageDesc* pOpen1stPgPageDesc;
-
- // kommendes Seitenlayout ab naechstem .<HNP> fuer den Fall,
- // dass wir den Follow des in pPageDesc gespeicherten Layouts
- // nicht aendern wollen/duerfen, sonst 0
- SwPageDesc* pPageDescForNextHNP;
-
- SwPaM *pCurPaM; // Writer-Einfuegepos
- SwFlyFrmFmt* pActFlySection;
- SwDoc *pDoc; // aktuelles Dokument
-
- SvStream& rInp; // gepufferter swistream dazu
-
- W4WStyleIdTab* pStyleTab; // Tabelle fuers Mappen von Id auf Style
- W4WStyleIdTab* pStyleBaseTab; // Tabelle fuer "Style based on"
-
- SwNumRule* pActNumRule; // derzeitige num. Liste laut letztem .<PND>
-
- W4WRecord *pActW4WRecord; // letzte, passende Methode aus ::GetNextRecord()
- W4WRecType aLastRecType; // in Main Loop: last Token that has been processed
-
- String* pReadTxtString; // zum Einlesen in :Flush(),
- // falls bReadTxtIntoString gesetzt ist
-
- /*
- long und ULONG
- */
- long nGrafPDSType; // Typ der Graphik aus PDS-Befehl
- long nGrWidthTw; // Groesse der Grafik
- long nGrHeightTw;
- long nParaLen; // zum Zaehlen gegen UEberschreitung d. max. Absatzlaenge
- long nRecNo; // Befehlszaehler zum besseren Debuggen
- long nRSMLeft; // Merke RSM-Werte bis zum naechsten Seitenwechsel
- long nRSMRight;
- long nRSMwpwParaLeft; // Merke RSM-Werte f�r WPWin - Absatz-Raender
- long nRSMwpwParaRight;
-
- // Hilfs-Varis zur Umrechnung
- // von W4W-Randangaben
- // zu denen im Writer
- long nLastValueSTP; // zuletzt wegen STP gesetzter Wert
- long nLastValueSBP; // zuletzt wegen SBP gesetzter Wert
- long nLastValueHTM; // zuletzt wegen HTM gesetzter Wert
- long nLastValueHM; // zuletzt wegen HM gesetzter Wert
- long nLastValueFBM; // zuletzt wegen FBM gesetzter Wert
- long nLastValueFM; // zuletzt wegen FM gesetzter Wert
- long nNewValueSTP; // jetzt neu von STP angegebener Wert
- long nNewValueSBP; // jetzt neu von SBP angegebener Wert
- long nNewValueHTM; // jetzt neu von HTM angegebener Wert
- long nNewValueHM; // jetzt neu von HM angegebener Wert
- long nNewValueFBM; // jetzt neu von FBM angegebener Wert
- long nNewValueFM; // jetzt neu von FM angegebener Wert
-
- long nW4WFileSize; // fuer Prozentskala
-
- long nTabDeltaSpace; // durchschnittl. Zellen-Zwischenraum
- long nTabWidthTw; // GesamtBreite ALLER Spalten in Twips
-
- long nLastProcessedCol; // zuletzt per .<BC0_> definierte Zelle
-
- long nStartOfActRecord;
- long nStreamPosInRec;
-
- ULONG nIniFlags; // Flags aus der writer.ini
- // untere 16 Bits fuer den W4W-Reader
- ULONG nIniHdSiz; // Flags fuer Default-Size Header
- ULONG nIniFtSiz; // dito fuer Footer
- ULONG nIniFMFlags; // Flags fuer Import von FrameMaker Dokumenten
-
- W4W_THREE_STATE eFootNotePageRestart; // neu zaehlen ab jeder Seite
-
- /*
- USHORT und short
- */
- USHORT nDefLanguage; // diese Sprache statt Ausschalter
-
- USHORT nDocType; // Quellformat
- USHORT nAktPgDesc; // momentan gueltiges Seitenlayout
- USHORT nApoBorderCode; // Diese APO hat folgenden BorderCode
- // gegen doppelte Border in WW2-Apos
-
- USHORT nColSize; // wenn keine Angaben in Twips existieren
- USHORT nTablInTablDepth; // Ebenen-Tiefe von Tabelle IN Tabelle
-
- USHORT nHdFtType; // Typ des letzten Kopf/Fusstextes
- USHORT nPDType; // Typ des zuletzt angelegten Seitenlayouts
- USHORT nTabRows; // V-SSize der Tabelle
- USHORT nTabCols; // H-SSize
- USHORT nTabCol; // aktuelle H-Pos
-
- short nTabRow; // V-Pos in Tabelle
-
- USHORT nTabDefBorder; // Was fuer einen Standard-Rahmen ist gewaehlt
-
- // gecachete Raender des SeitenLayouts
- USHORT nPgLeft; // SLay L.Rand
- // = pPageDesc->GetMaster()->GetLRSpace()->GetTxtLeft()
-
- USHORT nLeftMgnCorr;
-
- USHORT nPgRightDelta; // dito ...->GetRight()
-
- USHORT nPgRight; // dito ...->GetWidth() - ->GetRight()
-
- USHORT nPgWidth; // dito ...->GetFrmSize().GetFixSize()
-
- USHORT nAktStyleId; // Id vom aktuellen StyleSheet (W4W-Nummerierung)
- USHORT nTabStyleId; // Id des Style vor Tabellen-Anfang (W4W-Nummerierung)
- USHORT nNoNameStylesCount; // Anzahl der Styles mit ungueltigem oder fehlendem W4W-Namen
-
- USHORT nChrCnt; // Counter fuer aCharBuffer
-
- USHORT nLastReadFootNo; // zuletzt eingelesene Fussnoten-Nr.
- USHORT nLastReadEndNo; // zuletzt eingelesene Endnoten-Nr.
-
- /*
- char und BYTE
- */
- char nFtnType; // Fuss- oder EndNote, -1 fuer noch nicht bekannt
-
- BYTE nError; // igendwelche Fehler ??
-
- BYTE nTabCode; // Tabellen-Definitions-Byte
-
- BYTE nUnderlineMode; // alles oder nur Worte unterstreichen
-
- BYTE nActNumLevel; // Nummerierungs-Tiefe des akt. Absatz
-
- BYTE nFootNoOverflow; // Ueberlaufzaehler fuer Fussnoten-Nummern
- // beim FNI-Typ Gross- oder Kleinbuchstaben
- BYTE nEndNoOverflow; // Ueberlaufzaehler fuer Endnoten-Nummern
- // beim FNI-Typ Gross- oder Kleinbuchstaben
- /*
- BOOL mit 1 Bit
- */
- BOOL bPDTanalyzed : 1; // FrameMaker-Flag, ob Page Definition Table
- // bereits ausgewertet wurde
- // und die entrsprechenden PgDesc erzeugt sind
-
- BOOL bStyleDef : 1; // Flag, ob gerade Style definitiniert wird
- BOOL bHeadFootDef : 1; // Flag, ob gerade Header oder Footer definiert werden
- BOOL bFootnoteDef : 1; // Flag, ob gerade Fussnote definiert wird
-
- BOOL bStyleEndRec : 1; // StyleEndRec erkannt
- BOOL bStyleOnOff : 1; // im StyleSheet On oder Off Record
- BOOL bStyleOn : 1; // im StyleSheet On Record
- BOOL bTxtInDoc : 1; // setze den akt. CharBuffer ins Dokument
- BOOL bPageDefRdy : 1; // Flag, ob Page-Definition abgescholssen ist
- BOOL bIsTxtInDoc : 1; // Flag, ob im Doc schon Text steht
- // (leeren Absatz vor Tabelle erzeugen?)
- BOOL bIsTxtInFNote : 1; // Kam schon Text (oder ein TAB) in dieser
- // Fussnote? (der erste TAB in e. Fussnote
- // wird naemlich jeweils uebersprungen)
- BOOL bIsTxtInPara : 1; // Ist der Absatz nicht mehr leer ?
- // Mogelei gegen leere Absaetze WW2
- // + Sicherheit, dass PageDesc nicht in leeren Abs.
- BOOL bIsTxtInPgDesc : 1; // Flag, ob dieser PageDescriptor schon Text beinhaltet
- // (ist die Erzeugung eines neuen Seitenlayouts noetig?)
- BOOL bWasTxtSinceLastHF2 : 1; // Flag, ob Text seit HF2 bzw. Textbeginn
- BOOL bWasTxtSinceLastHF1 : 1; // Flag, ob Text seit HF1 bzw. Textbeginn
- BOOL bWasTxtSince_BREAK_PAGE : 1; // ob seit letztem HNP schon Text kam
- // (Ist Pagebreak bei folgendem Pagedesc ueberfluessig?)
- BOOL bWasHNPInPgDesc : 1; // Gab es in diesem PgDesc bereits .<HNP>-Kodes ?
- // (wir verschlucken erstes .<HNP> in leerem PgDesc)
-
- BOOL bStyleOff : 1; // Flag, ob am Absatzende Default-Layout gesetzt werden muss
- BOOL bBCMStep1 : 1; // Flag, ob .<BCM> die Tabelle zum 1. Mal liest
- BOOL bBCMStep2 : 1; // Flag, ob .<BCM> die Tabelle zum 2. Mal liest
- BOOL bNoExec : 1; // Flag, ob gerade Kommandos ausser "HFX" (Ende Kopf/Fusstext)
- // ignoriert werden sollen
- BOOL bSepar : 1; // nach (SEP) in der Style-Definition gesetzt
- BOOL bPDFirstOnly : 1; // zuletzt angelegtes Seitenlayout gilt nur fuer 1. Seite
- BOOL bIsNLN : 1; // ist nach (NLN) bis ca. Anfang des naechsten Textes gesetzt
- BOOL bDefFontSet : 1; // ist bereits Default-Font gesetzt ?
- BOOL bIsColMode : 1; // ist Column-Mode (z.B. eine Tabelle am entstehen) ?
- BOOL bWasCellAfterCBreak:1; // FALSE, wenn 2 HCB nacheinander (ohne BCO )
- BOOL bWasPGNAfterPND : 1;
- BOOL bTabBorder : 1; // Umrandung der Zellen in Tabelle
- BOOL bTabSpezBorder : 1; // andere als Standart-Umrandung der Zellen in Tabelle
- BOOL bCheckTabAppendMode:1; // Pruef-Flag fuer .<CDS>
- BOOL bIsTabAppendMode : 1; // aktuelle Tabelle und vorher definierte Tabelle
- // gehoeren zusammen und werden in EINE eingelesen
- BOOL bIsSTYInTab : 1; // um Style glaubwuerdig zu simulieren
- BOOL bIsColDefTab : 1; // Tabelle statt Mehrspaltigkeit
- BOOL bPicPossible : 1; // hier kann eine Grafik stehen
- BOOL bPic : 1; // Ein Bild ist erfolgreich eingelesen worden
- BOOL bIsIpsInPara : 1; // beinhaltet dieser Absatz einen IPS-Befehl ?
- // -> STM ignorieren
- BOOL bToxOpen : 1; // in Tox
- BOOL bPersAlign : 1; // persistent Alignment (BRJ)
- BOOL bPgMgnChanged : 1; // Page Margin has changed
- BOOL bWasXCS : 1; // Um nach XCS-Records 1 Zeichen zu ueberlesen
- BOOL bWasSLG : 1; // 1. Laguage Group ist Default
- BOOL bIgnoreNTB : 1; // nach Auftreten von RUL wird NTB ignoriert
-
- BOOL bWWWasRSM : 1; // 1. RSM wg. WW-Bug bescheissen
- BOOL bIsTab : 1; // fuer AmiPro StyleDef virt. Tabs
-
- BOOL bWPWWasRSM : 1; // fuer WPWin-Import RSM-Sonderbehandlung
- BOOL bSingleParaMgn : 1; // fuer WPWin-Import STM/IPS-Behandlung
-
- BOOL bIsSTMInPara : 1; // fuer WPWin-Import STM-Sonderbehandlung
- BOOL bIsNumListPara : 1; // Absatz einer nummerierten Liste
-
- BOOL bSetPgWidth : 1;
- BOOL bSetPgHeight : 1;
-
- BOOL bTabOwnFrm : 1; // Flag : eigenes FraneFmt fuer alle Zellen
-
- BOOL bNew : 1; // neues Dokument oder zufuegen
-
- BOOL bEndNoteInfoAlreadySet :1;
- BOOL bFtnInfoAlreadySet :1;
- BOOL bFootNoteNumberAutomatic:1;
- BOOL bEndNoteNumberAutomatic :1;
- BOOL bWasFootNoteOnW4WPage :1;
-
- BOOL bReadTxtIntoString :1; // :Flush() speichert dann *nicht* ins pDoc
-
- BOOL bNixNoughtNothingExec :1; // keinerlei Methoden werden ausgefuehrt
-
-
- /*
- Methoden
- */
- BOOL ContinueHdFtDefinition( BOOL bFollow, long nLMarg, long nRMarg );
- void Read_HdFtDefinition( BOOL bHeader );
-// void Read_ColBrk();
-
- void SetPamInCell( USHORT nRow, USHORT nCol, BOOL bSetPaM = TRUE );
- SwTableBox* UpdateTableMergeGroup( SwSelBoxes_SAR* pActGroup,
- SwTableBox* pActBox,
- USHORT nCol );
-
- void Flush(); // speichert Buffer im Document
- void FlushChar( sal_Unicode c );
-
- // lese und bearbeiten den naechsten Record
- int GetNextRecord();
-
- // returnt W4WR_RED/W4WR_TXTERM wenn einstellige HexZahl, sonst 0
- // in rHexVal steht der gewandelte Hex-Wert
- BYTE GetChar( BYTE& rHexVal );
- BYTE GetDeciByte( BYTE& rByteVal );
- BYTE GetHexByte( BYTE& rHexVal );
- BYTE GetHexUShort( USHORT& rHexVal );
- // returnt W4WR_RED/W4WR_TXTERM
- // in rDecVal steht der gewandelte Decimal-Wert
- BYTE GetDecimal( long& rDecVal );
- // ueberliest alles bis zum W4WR_TXTERM oder W4WR_RED (wird returnt)
-
- BOOL GetString( String& rString, const int nEndCode1, const int nEndCode2 );
-
- BOOL GetNextName(); // liest Namen (inc. Sonderzchn.) in aCharBuffer ein
-
- SwPageDesc* CreatePageDesc( USHORT eCreateMode );
-// SwPageDesc& GetAktPgDsc();
-
- BYTE SkipPara();
- BYTE SkipParaX();
- BYTE SkipEndRecord();
-
- void StyleAnfang(); // liest StyleName und Id
-
- const SfxPoolItem* GetFmtAttr( USHORT nWhich );
- void SetAttr( const SfxPoolItem& rHint );
- void SetAttrOff( const SfxPoolItem& rHint );
-
- // returnt den abs. Rand der Seite (SeitenRand+NodeRand)
- long GetLeftMargin() const;
- void Read_FootNoteStart(char Type, BYTE nNoLow,
- BYTE nNoHigh,
- USHORT FootNo);
- void DeleteZStk( W4WCtrlStack*& rpStk );
- USHORT Read_SetBorder( USHORT nBor, SvxBoxItem& rFmtBox );
- USHORT Read_SetTabBorder( USHORT nW4WRow , USHORT nW4WCol , SvxBoxItem& rFmtBox );
- void Adjust_pTabDefs();
- BOOL GetULSpace( SvxULSpaceItem*& rpUL );
- BOOL GetLRULHint( const SfxPoolItem*& rpH, RES_FRMATR eTyp );
- void SetPageMgn();
- void DoSplit();
- void UpdateCacheVars();
- void SetPageDescVSpaces( SwPageDesc& rPageDesc,
- W4W_UpdtPgMrgSet eCalledByWhom);
- void UpdateHdFtMarginSettings( SwFrmFmt *pHdFmt,
- long nHeight,
- long nDelta,
- BOOL bDoTheHeader );
- void AdjustTempVar1( long& rHeight, long& rPgDelta,
- long& rHdFtDelta, long nIniHdFtSiz );
- void UpdatePageMarginSettings( W4W_UpdtPgMrgSet eCalledByWhom );
- void Read_IndentPara1(long nLeft, long n1st, long nRight);
-
- void FlySecur( BOOL bAlignCol,
- long& rXPos, long& rYPos, long& rWidthTw, long& rHeightTw,
- RndStdIds& rAnchor, long* pTop = 0, long* pLeft = 0,
- long* pBot = 0, long* pRight = 0, USHORT nBorderCode = 0 );
-
- void Read_HardAttrOff( USHORT nResId );
-
- void ReadTabDefs( BYTE nCode, long nCols, W4W_ColdT* pActTabDefs );
-
- SwFlyFrmFmt* MakeTxtFly( RndStdIds eAnchor, const SfxItemSet& );
-
- void UpdatePercent( ULONG nPos, ULONG nFileSize );
-
- void ActivateTxtFlags();
-
- void SetFtnInfoIntoDoc( BOOL bEndNote, BYTE nRestart, BYTE nStyle,
- String& rPrefixTxt,
- String& rSuffixTxt );
-
- void Read_ProcessHiddenText( BOOL bInline );
- void ProcessRecordInHiddenText();
-
-public:
- SwW4WParser( const SwPaM &, SvStream& rIstream, BOOL bNewDoc, //$ istream
- USHORT nFilterNo, const String& rVersion );
-
- BOOL CallParser();
-
- BOOL IsNewDocument() { return bNew; }
- SwDoc& GetDoc() const { return *pDoc; } // aktuelles Dokument
- sal_Char ReadChar() { sal_Char c = 0; rInp.Read( &c, 1 ); return c; }
-
- USHORT GetAktCollId() { return nAktStyleId; }
- void SetAktCollId( USHORT nId ) { nAktStyleId = nId; }
- SwTxtFmtColl* GetAktColl( BOOL* pSetAttrFlag = 0 ) const; // hole die durch nAktStyleId angegebe Style
-
- void MakeUniqueStyleName( String& rName );
-
- // die Read-Methoden fuer die verschiedenen Records
- void Read_DefineDocumentType(); // zur Zeit Dummies
-
- void Read_UpperCharSet();
- void Read_ExtendCharSet();
- void Read_HardNewLine();
- void Read_SoftNewLine();
- void Read_SoftNewPage();
- void Read_HardNewPage();
- void Read_HardSpace();
- void Read_NewLineInPara();
- void Read_Tab();
- void Read_StyleTable();
- void Read_StyleEnd();
- void Read_StyleOn();
- void Read_StyleOff();
- void Read_DateTime();
-
- // Read-Methoden fuer die Attribute
- void Read_BeginBold();
- void Read_EndBold();
- void Read_BeginUnderline();
- void Read_EndUnderline();
- void Read_BeginItalic();
- void Read_EndItalic();
- void Read_BeginDoubleUnderline();
- void Read_EndDoubleUnderline();
- void Read_BeginSuperScript();
- void Read_EndSuperScript();
- void Read_BeginSubScript();
- void Read_EndSubScript();
- void Read_BeginColoredText();
- void Read_EndColoredText();
- void Read_NewTabTable();
- void Read_BeginFlushRight();
- void Read_EndFlushRight();
- void Read_BeginCenterText();
- void Read_EndCenterText();
- void Read_BeginRightJustify();
- void Read_EndRightJustify();
- void Read_IndentPara();
- void Read_BeginStrikeOut();
- void Read_EndStrikeOut();
- void Read_BeginShadow();
- void Read_EndShadow();
-
- // Read-Methoden fuer die Fonts
- void Read_SetPitchAndOrFont();
- void Read_FontDefTable();
-
- // Read-Formatierungs Methoden
- void Read_SetFormLenght();
- void Read_SetPageNumber();
- void Read_PageWidth();
- void Read_ReSetLeftRightMargin();
- void Read_SetTopMarginOfPage(); // STP
- void Read_SetBottomMarginOfPage(); // SBP
- void Read_HeaderTopMargin(); // HTM
- void Read_HeadingMargin(); // HM
- void Read_FooterBottomMargin(); // FBM
- void Read_FooterMargin(); // FM
- void Read_SetTempLeftRightMargin();
- void Read_FooterStart();
- void Read_HeaderStart();
- void Read_HeadFootEnd();
- void Read_PrintPageNo();
- void Read_PrintLastPageNo();
- void Read_Separator();
- void Read_SetLeftMarginRelease();
- void Read_FootNoteStart1();
- void Read_FootNoteStart2();
- void Read_FootNoteEnd();
- void Read_FootNoteInfo();
- void Read_EndSection();
- void Read_ColumnsDefinition();
- void Read_BeginColumnMode();
- void Read_EndColumnMode();
- void Read_BeginTabCell();
- void Read_BeginTabRow();
- void Read_ColumnBreak();
- void Read_ParaBorder();
- void Read_BeginAbsPosObj();
- void Read_EndAbsPosObj();
- void Read_Picture();
- void Read_PictureDef();
- void Read_IncludeGraphic();
- void Read_SetSpaceAfter();
- void Read_SetSpaceBefore();
- void Read_BeginMarkedText();
- void Read_EndMarkedText();
- void Read_HardHyphen();
- void Read_SoftHyphen();
- void Read_PageOrient();
- void Read_SetTray();
- void Read_Hex();
- void Read_BeginSmallCaps();
- void Read_EndSmallCaps();
- void Read_BeginUpperCaps();
- void Read_EndUpperCaps();
- void Read_SetRightMarginIndent();
- void Read_ReSetLineSpacing();
- void Read_StyleBasedOn();
- void Read_Split();
- void Read_NonBreakSpace();
- void Read_WidowOrphOn();
- void Read_WidowOrphOff();
- void Read_BeginKerning();
- void Read_EndKerning();
- void Read_BeginHyphen();
- void Read_EndHyphen();
- void Read_LangGroup();
- void Read_SysInfo();
- void Read_Ruler();
- void Read_SetUnderlineMode();
-
- void Read_BeginHiddenText();
- void Read_EndHiddenText();
- void Read_CommentLine();
-
- // Read-Methoden fuer nummerierte Listen
- void Read_ParagraphNumber();
- void Read_EndOfParaNum();
- void Read_ParaNumberDef();
-
- // besondere Methoden fuer FrameMaker - Dokumente !!
- BOOL Read_Analyze_FLO_PDT();
- void Read_PageDefinitionTable();
- void Read_RectangleDefinitionTable();
- void Read_Flow();
- void Read_BeginTextFlow();
- void Read_EndTextFlow();
- void Read_TextRectangelId();
-};
-
-typedef void (SwW4WParser:: *FNReadRecord)();
-
-struct W4WRecord
-{
- W4WRecType aRecType; // der ID-String fuer den Record
- FNReadRecord fnReadRec; // Methode fuer diesen spez. Record
-};
-
-
-ULONG GetW4WIniFlags( USHORT nFilterNo ); // auch fuer Writer
-
-struct W4WStyleIdTabEntry
-{
- SwTxtFmtColl* pColl; // Pointer auf Writer-Collection, sobald
- // angelegt. Beim Suchen 0, bis gefunden.
- USHORT nStyleId; // W4W-Style-Id, nicht Writer-Id
- BOOL bSetAttributes; // erlaubt, dass Attribute gesetzt werden duerfen
-
- // Bei Base-Tab (Style based on) ist alles etwas anders:
- // pColl ist die Vorlage (Collection), die noch einen
- // Verweis (SBO) nachgereicht bekommen muss.
- // nStyleId ist die W4W-Style-Id, auf die verwiesen werden
- // muss, sobald es diese gibt.
-
-
- W4WStyleIdTabEntry( SwW4WParser& rParser, USHORT nId,
- const sal_Unicode* pName );
- // ctor fuers suchen !!
- W4WStyleIdTabEntry( USHORT nSeekId )
- : pColl(0)
- , nStyleId( nSeekId )
- , bSetAttributes( TRUE )
- {}
-
- inline BOOL operator==( const W4WStyleIdTabEntry&) const;
- inline BOOL operator<( const W4WStyleIdTabEntry&) const;
-};
-typedef W4WStyleIdTabEntry* W4WStyleIdTabEntryPtr;
-
-
-
-} //namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/filter/inc/w4wstk.hxx b/binfilter/bf_sw/source/filter/inc/w4wstk.hxx
deleted file mode 100644
index 9d52228..0000000
--- a/binfilter/bf_sw/source/filter/inc/w4wstk.hxx
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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 _W4WSTK_HXX
-#define _W4WSTK_HXX
-
-#include <bf_svtools/bf_solar.h>
-
-#include <bf_svtools/svarray.hxx>
-
-#include <bf_svtools/poolitem.hxx>
-
-#include <ndindex.hxx>
-namespace binfilter {
-
-class SwW4WParser;
-class SwDoc;
-struct SwPosition;
-class SwPaM;
-class SwFlyFrmFmt;
-
-/* ------ Stack-Eintrag fuer die Attribute -----------
- * Es werden immer Pointer auf neue Attribute uebergeben.
- */
-
-struct W4WStkEntry
-{
- SfxPoolItem * pAttr; // Format Attribute
- SwNodeIndex nMkNode;
- SwNodeIndex nPtNode;
- xub_StrLen nMkCntnt; // Nachbildung von Mark()
- xub_StrLen nPtCntnt; // Nachbildung von GetPoint()
- BOOL bLocked : 1;
- BOOL bCopied : 1;
- BOOL bClosed : 1; // Zeigt ueber Child geschlossenes Attr. an.
- BOOL bNeverIntoDoc : 1; // Dieser Entry soll nichts ins Doc sondern,
- // nach dem Schliessen geloescht werden.
-
- W4WStkEntry( const SwPosition & rStartPos,
- SfxPoolItem* pHt,
- BOOL bInitCopied = FALSE,
- BOOL bInitNID = FALSE );
-
- ~W4WStkEntry();
-
- void SetEndPos( const SwPosition & rEndPos );
- BOOL MakeRegion( SwPaM & rRegion ) const;
-
-private:
- W4WStkEntry( const W4WStkEntry& rEntry ); // niemals aufrufen, nur Complier-Test
-};
-
-// ein Stack fuer die gesamten Text-Attribute
-typedef W4WStkEntry* W4WStkEntryPtr;
-SV_DECL_PTRARR(W4WCtrlStkEntries,W4WStkEntryPtr,5,10)
-
-class W4WCtrlStack : public W4WCtrlStkEntries
-{
- SwW4WParser* pParser;
- W4WCtrlStack* pParentStack;
-
-public:
- W4WCtrlStack( SwW4WParser& rParser );
- W4WCtrlStack( W4WCtrlStack& rCpy, const SwPosition& rPos );
- ~W4WCtrlStack();
-
- void NewAttr( const SwPosition& rPos, const SfxPoolItem & rAttr );
-
- BOOL SetAttr( const SwPosition& rPos, USHORT nAttrId=0,
- BOOL bTstEnde = TRUE,
- BOOL bDoNotSetInDoc = FALSE );
- void SetAttrInDoc( SwPaM& rRegion, const W4WStkEntry& rEntry );
- void SetLockedAttrClosed( USHORT nAttrId );
- void SetEndForClosedEntries( const SwPosition& rPos );
- void StealAttr( const SwPosition& rPos, USHORT nAttrId = 0 );
- void StealWWTabAttr( const SwPosition& rPos );
-
- SfxPoolItem* GetFmtStkAttr( USHORT nWhich, USHORT * pPos = 0 );
- const SfxPoolItem* GetFmtAttr( const SwPaM& rPaM, USHORT nWhich );
- BOOL IsAttrOpen( USHORT nAttrId );
-};
-
-
-// weitere Teile aus ehemaligem swrtf.hxx
-class SwW4WStyle : public SfxPoolItem
-{
-public:
- USHORT nStyleId;
- SwW4WStyle( USHORT nId );
- SwW4WStyle( const SwW4WStyle & rRTFFld );
-
- // "pure virtual Methoden" vom SfxPoolItem
- virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxPoolItem* Clone( SfxItemPool* = 0 ) const;
-
- USHORT GetStyleId() const { return nStyleId; }
-};
-
-class SwW4WAnchor : public SfxPoolItem
-{
- SwFlyFrmFmt* pFlyFmt;
-public:
- SwW4WAnchor( SwFlyFrmFmt* pFlyFmt );
- SwW4WAnchor( const SwW4WAnchor& );
-
- // "pure virtual Methoden" vom SfxPoolItem
- virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxPoolItem* Clone( SfxItemPool* = 0 ) const;
-
- const SwFlyFrmFmt* GetFlyFmt() const { return pFlyFmt; }
- SwFlyFrmFmt* GetFlyFmt() { return pFlyFmt; }
-};
-
-} //namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/filter/makefile.mk b/binfilter/bf_sw/source/filter/makefile.mk
index 9374f3a..40d765d 100644
--- a/binfilter/bf_sw/source/filter/makefile.mk
+++ b/binfilter/bf_sw/source/filter/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -51,7 +51,6 @@ SUBLIBS= \
$(SLB)$/sw_writer.lib \
$(SLB)$/sw_excel.lib \
$(SLB)$/sw_lotus.lib \
- $(SLB)$/sw_w4w.lib \
$(SLB)$/sw_xml.lib \
$(SLB)$/sw_sw6.lib
diff --git a/binfilter/bf_sw/source/filter/w4w/makefile.mk b/binfilter/bf_sw/source/filter/w4w/makefile.mk
deleted file mode 100644
index 1932a49..0000000
--- a/binfilter/bf_sw/source/filter/w4w/makefile.mk
+++ /dev/null
@@ -1,68 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..$/..
-BFPRJ=..$/..$/..
-
-PRJNAME=binfilter
-TARGET=sw_w4w
-
-NO_HIDS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : $(PRJ)$/inc$/bf_sw$/swpre.mk
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/inc$/bf_sw$/sw.mk
-
-INC+= -I$(PRJ)$/inc$/bf_sw
-.IF "$(mydebug)" != ""
-CDEFS=$(CDEFS) -Dmydebug
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-CXXFILES = \
- sw_w4wgraf.cxx \
- sw_w4wpar1.cxx \
- sw_w4wpar2.cxx \
- sw_w4wpar3.cxx \
- sw_w4wstk.cxx
-
-
-
-SLOFILES = \
- $(SLO)$/sw_w4wgraf.obj \
- $(SLO)$/sw_w4wpar1.obj \
- $(SLO)$/sw_w4wpar2.obj \
- $(SLO)$/sw_w4wpar3.obj \
- $(SLO)$/sw_w4wstk.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/binfilter/bf_sw/source/filter/w4w/sw_w4wgraf.cxx b/binfilter/bf_sw/source/filter/w4w/sw_w4wgraf.cxx
deleted file mode 100644
index 8125055..0000000
--- a/binfilter/bf_sw/source/filter/w4w/sw_w4wgraf.cxx
+++ /dev/null
@@ -1,1016 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include <stdlib.h>
-#ifdef UNX
- #include <unistd.h>
-#endif
-
-#include <unotools/tempfile.hxx>
-#include <vcl/graph.hxx>
-#include <tools/poly.hxx>
-#include <bf_svtools/filter.hxx>
-#include <vcl/virdev.hxx>
-#include <tools/cachestr.hxx>
-#include <bf_svx/impgrf.hxx>
-
-#include <shellio.hxx>
-#include <w4wstk.hxx> // fuer den Attribut Stack
-#include <w4wpar.hxx> // ERR_CHAR
-#include <w4wgraf.hxx> // eigenes
-#include <osl/endian.h>
-namespace binfilter {
-
-#define MAX_MEM_GRAF 300000 // ab 300K im File statt im Speicher
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Windows BMP /////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-class BmpFileHd
-{ // Vorsicht: Struktur ist nicht aligned
-public:
- USHORT Typ; // = "BM"
- ULONG Size; // Filesize in Bytes
- USHORT Reserve1; // Reserviert
- USHORT Reserve2; // Reserviert
- ULONG Offset; // Offset?
-
- friend SvStream& operator << ( SvStream& rOStream, BmpFileHd& rHead ); //$ ostream
-};
-
-#define BMP_FILE_HD_SIZ 14 // Groesse der Struktur BmpFileHd
-
-
-class BmpInfoHd
-{ // Dieser Header ist aligned
-public:
- ULONG Size; // Gráe des BmpInfoHeaders
- long Width; // Breite in Pixel
- long Height; // Hhe in Pixel
- USHORT Planes; // Anzahl der Planes (immer 1)
-
- USHORT PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24)
- ULONG Compress; // Datenkompression
- ULONG ImgSize; // Gráe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt.
- long xDpmm; // Dot per Meter (0 ist erlaubt)
- long yDpmm; // Dot per Meter (0 ist erlaubt)
- ULONG ColUsed; // Anzahl der verwendeten Farben (0=alle)
- ULONG ColMust; // Anzahl der wichtigen Farben (0=alle)
-
- friend SvStream& operator << ( SvStream& rOStream, BmpInfoHd& rHead ); //$ ostream
-};
-
-class RGBQuad {
-private:
- unsigned char Red;
- unsigned char Grn;
- unsigned char Blu;
- unsigned char Fil;
-public:
- RGBQuad( unsigned char R, unsigned char G, unsigned char B )
- { Red=R; Grn=G; Blu=B; Fil=0; }
-};
-
-
-SvStream& operator << ( SvStream& rOStream, BmpFileHd& rHead ) //$ ostream
-{
- BmpFileHd aHd = rHead;
-
-#ifndef OSL_LITENDIAN
- aHd.Typ =SWAPSHORT( aHd.Typ );
- aHd.Size =SWAPLONG ( aHd.Size );
- aHd.Reserve1=SWAPSHORT( aHd.Reserve1 );
- aHd.Reserve2=SWAPSHORT( aHd.Reserve2 );
- aHd.Offset =SWAPLONG ( aHd.Offset );
-#endif // !OSL_LITENDIAN
-
- // Da MS die BmpFileHd-Struktur nicht aligned hat,
- // muessen die Member einzeln 'rausgeschrieben werden,
- // da die Groesse der Sruktur von Compiler zu Compiler
- // unterschiedlich ist.
-
- rOStream.Write( (char*)&aHd.Typ, sizeof( aHd.Typ ) );
- rOStream.Write( (char*)&aHd.Size, sizeof( aHd.Size ) );
- rOStream.Write( (char*)&aHd.Reserve1, sizeof( aHd.Reserve1 ) );
- rOStream.Write( (char*)&aHd.Reserve2, sizeof( aHd.Reserve2 ) );
- rOStream.Write( (char*)&aHd.Offset, sizeof( aHd.Offset ) );
-
- return rOStream;
-}
-
-
-SvStream& operator << ( SvStream& rOStream, BmpInfoHd& rInfo) //$ ostream
-{
-#ifndef OSL_LITENDIAN
- BmpInfoHd aInfo = rInfo;
-
- aInfo.Size =SWAPLONG ( aInfo.Size );
- aInfo.Width =SWAPLONG ( aInfo.Width );
- aInfo.Height =SWAPLONG ( aInfo.Height );
- aInfo.Planes =SWAPSHORT( aInfo.Planes );
- aInfo.PixBits =SWAPSHORT( aInfo.PixBits );
- aInfo.Compress=SWAPLONG ( aInfo.Compress );
- aInfo.ImgSize =SWAPLONG ( aInfo.ImgSize );
- aInfo.xDpmm =SWAPLONG ( aInfo.xDpmm );
- aInfo.yDpmm =SWAPLONG ( aInfo.yDpmm );
- aInfo.ColUsed =SWAPLONG ( aInfo.ColUsed );
- aInfo.ColMust =SWAPLONG ( aInfo.ColMust );
-
- rOStream.Write( (char*)&aInfo, sizeof(aInfo) );
-#else // !OSL_LITENDIAN
- rOStream.Write( (char*)&rInfo, sizeof(rInfo) );
-#endif // !OSL_LITENDIAN
- return rOStream;
-}
-
-
-SwW4WGraf::SwW4WGraf( SvStream& rIstream )
- : rInp( rIstream )
-{
- pBmp = 0;
- pGraph = 0;
- nError = 0;
- nStat = 0;
- pPal = 0;
- nPalColors = 0;
- pBmpHead = 0;
- pBmpInfo = 0;
- nVectMinX = nVectMinY = USHRT_MAX;
- nVectMaxX = nVectMaxY = 0;
-}
-
-
-SwW4WGraf::~SwW4WGraf()
-{
- if( pGraph )
- delete pGraph;
- if( pBmp )
- delete pBmp;
-}
-
-
-short SwW4WGraf::GetHexByte() // Ret: -1 fuer W4W_TXT_TERM, W4W_RED
-{
- register unsigned int c;
- register unsigned int nHexVal = 0; // Default fuer Error
-
- for ( int i = 0; i < 2; ++i )
- {
- c = ReadChar();
- if( c == 0 )
- { // eof oder Stuss
- nError = ERR_CHAR;
- return -1;
- }
- if( c >= '0' && c <= '9' ) (nHexVal <<= 4 )+= (c - '0');
- else if( c >= 'A' && c <= 'F' ) (nHexVal <<= 4 )+= (c - 'A' + 10);
- else if( c >= 'a' && c <= 'f' ) (nHexVal <<= 4 )+= (c - 'a' + 10);
- else
- {
- nError = ERR_CHAR;
- return 0;
- }
- }
-
- return (short)nHexVal;
-}
-
-
-USHORT SwW4WGraf::GetHexUShort()
-{
- int c = (int)GetHexByte();
- return( (BYTE)c | ( (USHORT)GetHexByte() << 8 ) );
-}
-
-
-ULONG SwW4WGraf::GetHexULong()
-{
- register ULONG c = 0;
- register int i;
- for ( i=0; i<32; i+=8 )
- c |= ((ULONG)GetHexByte()) << i;
- return c;
-}
-
-
-long SwW4WGraf::GetVarSize() // Zum Lesen der Recordlaenge (in 1..5 Byte codiert)
-{
- BYTE c0, c1, c2, c3, c4;
-
- if ( ( c0 = (BYTE)GetHexByte() ) != 0xff ) // 1-Byte-Darstellung : Wert
- return c0;
-
- c1 = (BYTE)GetHexByte();
- c2 = (BYTE)GetHexByte();
- if ( ( c2 & 0x80 ) == 0 ) // 3-Byte-Darstellung :
- return ( (USHORT)c2 << 8 ) | c1; // 0xff LowByte HiByte
-
- c3 = (BYTE)GetHexByte(); // 5-Byte-Darstellung:
- c4 = (BYTE)GetHexByte(); // 0xff Byte2 (Byte3 | 0x80) Byte0 Byte1
- return( ( ( (long) c2 & 0x7f ) << 24 )
- | ( (long) c1 << 16 )
- | ( (USHORT)c4 << 8 )
- | c3 );
-}
-
-
-short SwW4WGraf::DefaultPalette( USHORT nColors )
-{
- pPal = (RGBQuad*)new char[ nColors*sizeof(RGBQuad) ];
- if ( !pPal ) return -1;
- nPalColors = nColors;
- register RGBQuad* pP = pPal;
-
- if (nColors==2) {
- *pP++ = RGBQuad(0x00,0x00,0x00); // Schwarz
- *pP++ = RGBQuad(0xFF,0xFF,0xFF); // Weiss
- }
- else if (nColors==16)
- {
- *pP++ = RGBQuad(0x00,0x00,0x00); // Schwarz
- *pP++ = RGBQuad(0x24,0x24,0x24); // Grau 80%
- *pP++ = RGBQuad(0x49,0x49,0x49); // Grau 60%
- *pP++ = RGBQuad(0x92,0x92,0x92); // Grau 40%
- *pP++ = RGBQuad(0x6D,0x6D,0x6D); // Grau 30%
- *pP++ = RGBQuad(0xB6,0xB6,0xB6); // Grau 20%
- *pP++ = RGBQuad(0xDA,0xDA,0xDA); // Grau 10%
- *pP++ = RGBQuad(0xFF,0xFF,0xFF); // Weiss
- *pP++ = RGBQuad(0x00,0x00,0x00); // Schwarz
- *pP++ = RGBQuad(0xFF,0x00,0x00); // Rot
- *pP++ = RGBQuad(0x00,0x00,0xFF); // Blau
- *pP++ = RGBQuad(0xFF,0x00,0xFF); // Magenta
- *pP++ = RGBQuad(0x00,0xFF,0x00); // Gruen
- *pP++ = RGBQuad(0xFF,0xFF,0x00); // Gelb
- *pP++ = RGBQuad(0x00,0xFF,0xFF); // Cyan
- *pP++ = RGBQuad(0xFF,0xFF,0xFF); // Weiss
- } else
- return -1;
- return 0;
-}
-
-
-
-short SwW4WGraf::ReadPalette( long nVarSize )
-{
- nPalColors = (USHORT)(nVarSize / 3);
- pPal = (RGBQuad*)new char[ nPalColors*sizeof(RGBQuad) ];
- if ( !pPal ){ nPalColors = 0; return -1; };
- register RGBQuad* pP = pPal;
- USHORT i;
-
- for (i=0; i<nPalColors; i++)
- *pP++ = RGBQuad( (BYTE)GetHexByte(), (BYTE)GetHexByte(), (BYTE)GetHexByte() );
- return 0;
-}
-
-
-
-short SwW4WGraf::ReadBitmap( long ) // Mastersoft internal Format Bitmap
-{
- ULONG n4Width = GetHexULong(); // Lies Header ein
- ULONG n4Height = GetHexULong();
- USHORT n4ResWidth = GetHexUShort();
- USHORT n4ResHeight = GetHexUShort();
- USHORT n4ColBits = GetHexUShort();
-
- USHORT nColors = (1 << n4ColBits); // Anzahl der Farben (1,16,256)
- USHORT nWdtIn = (USHORT)((n4Width*n4ColBits+7)/8);
- USHORT nWdtOut = (USHORT)(((n4Width*n4ColBits+31)/32)*4);
-
-if( 24 > n4ColBits )
-{
-
-
- if ( !pPal || ( nColors != nPalColors ) ){ // keine oder falsche Palette
- if ( pPal ) DELETEZ( pPal );
- if ( DefaultPalette( nColors ) < 0 ) // mach selbst
- return -1;
- }
-
-
-}
-
-
- pBmpHead = new BmpFileHd; // erzeuge BMP-Header
- if ( !pBmpHead ) return -1;
- pBmpInfo = new BmpInfoHd;
- if ( !pBmpInfo ) return -1;
-
- pBmpHead->Typ='B'+'M'*256;
- pBmpHead->Offset=BMP_FILE_HD_SIZ+sizeof(*pBmpInfo);
- if( pPal ) pBmpHead->Offset += nColors*4;
- pBmpHead->Size=pBmpHead->Offset+nWdtOut*n4Height; // Reihenfolge wichtig
- pBmpHead->Reserve1=0;
- pBmpHead->Reserve2=0;
-
- pBmpInfo->Size=sizeof(*pBmpInfo);
- pBmpInfo->Width=n4Width;
- pBmpInfo->Height=n4Height;
- pBmpInfo->Planes=1;
- pBmpInfo->PixBits=n4ColBits;
- pBmpInfo->Compress=0;
- pBmpInfo->ImgSize=0;
- pBmpInfo->xDpmm=n4ResWidth*1000L/254L; // DPI in Pixel per Meter
- pBmpInfo->yDpmm=n4ResHeight*1000L/254; // dito
- pBmpInfo->ColUsed=0;
- pBmpInfo->ColMust=0;
-
- if ( nWdtOut != (size_t)nWdtOut ) return -1; // Zeile nicht allozierbar
- BYTE* pBuf = new BYTE[nWdtOut];
- if ( !pBuf ) return -1; // Fehler: kein Speicher da
-
- String sExt(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( ".bmp" )));
- ::utl::TempFile aTempFile(aEmptyStr, &sExt, 0);
- aTempFile.EnableKillingFile();
-
- SvStream* pOut = aTempFile.GetStream( STREAM_READ | STREAM_WRITE |
- STREAM_TRUNC );
-
- *pOut << *pBmpHead<<*pBmpInfo;
- if ( pPal )
- pOut->Write( (char*)pPal, nPalColors*sizeof(*pPal) ); // hier kein ByteSwap noetig
- // da nur Bytes enthalten
- USHORT x, y;
- short nLeft;
- BYTE c, nRun;
- BYTE* pB;
-
- for( y=0; y<n4Height; y++)
- {
- nLeft = nWdtIn;
- pB = pBuf;
- while ( nLeft > 0 ){
- nRun = (BYTE)GetHexByte();
- if ( ( nRun & 0x80 ) != 0 ) //komprimiert
- {
- nRun &= 0x7f;
- c = (BYTE)GetHexByte();
- for ( x=0; x<nRun && pB < pBuf+nWdtOut; x++)
- *pB++ = c;
- }
- else // unkomprimiert
- {
- for ( x=0; x<nRun && pB < pBuf+nWdtOut; x++)
- *pB++ = (BYTE)GetHexByte();
- }
- nLeft -= nRun;
- }
- for ( x=nWdtIn; x<nWdtOut; x++ )
- *pB++ = 0x00; // 0..3 Bytes Luecke
- pOut->Write( (char*)pBuf, (size_t)nWdtOut );
- }
- pOut->Seek(0);
- GraphicFilter& rGF = *GetGrfFilter(); // lese ueber Filter ein
- pGraph = new Graphic;
- BOOL bOk = ( rGF.ImportGraphic( *pGraph, aEmptyStr, *pOut,
- GRFILTER_FORMAT_DONTKNOW )
- == 0 );
-
- if( !bOk )
- DELETEZ( pGraph );
-
- return ( bOk ) ? 0 : -1; // OK / Error
-}
-
-
-void SwW4WGraf::SkipBytes( register long nBytes )
-{
- nBytes *= 2; // 1 Byte = 2 Chars im File
- rInp.SeekRel( nBytes );
-}
-
-#define W4WRG_Ignore 0x0000 /* Dummy */
-#define W4WRG_RecdID 0x0001 /* orginal file type, etc. */
-#define W4WRG_DefPal 0x0002 /* Define Palette */
-#define W4WRG_DefPen 0x0003 /* Define Pen */
-#define W4WRG_DefBrs 0x0004 /* Define Brush */
-#define W4WRG_DefMrk 0x0005 /* Define Marker */
-#define W4WRG_MoveTo 0x0008 /* Move To */
-#define W4WRG_LineTo 0x0009 /* Line To */
-#define W4WRG_FloodF 0x000A /* Floodfill Area */
-#define W4WRG_SetFil 0x000B /* Set Fillmode */
-#define W4WRG_DrMark 0x000C /* Draw Marker */
-#define W4WRG_DrMrkP 0x000D /* Draw an Array of Markers */
-#define W4WRG_DrRect 0x000E /* Draw a SRectangle */
-#define W4WRG_DrPLin 0x000F /* Draw a Polyline */
-#define W4WRG_DrPoly 0x0010 /* Draw a Polygon */
-#define W4WRG_DrwArc 0x0011 /* Draw an Arc */
-#define W4WRG_DrwPie 0x0012 /* Draw a Pie */
-#define W4WRG_DrCirc 0x0013 /* Draw a Circle or an Ellipse */
-#define W4WRG_DrBMap 0x0014 /* Draw a Bitmap */
-#define W4WRG_Scalng 0x0015 /* Set Scaling Mode */
-#define W4WRG_Rotate 0x0016 /* Set Rotation Value */
-#define W4WRG_DefFnt 0x0017 /* Define Font */
-#define W4WRG_DrText 0x0018 /* Draw Text */
-#define W4WRG_BckCol 0x0019 /* Set Backgroundcolor */
-#define W4WRG_StGrup 0x001A /* Start grouped Objects */
-#define W4WRG_EoGrup 0x001B /* End grouped Objects */
-#define W4WRG_DrChrd 0x001C /* Draw a Chord */
-#define W4WRG_DefP16 0x001D /* Define 16 Bit Palette */
-#define W4WRG_DefGCv 0x001E /* Define Gray Curve */
-#define W4WRG_DefFHd 0x001F /* Define File Header */
-
-#define W4WRG_TextBox 0x0020 /* Text box */
-#define W4WRG_StClPath 0x0021 /* Start enclosed path */
-#define W4WRG_EoClPath 0x0022 /* End enclosed path */
-#define W4WRG_Bezier 0x0023 /* Draw a bezier curve */
-#define W4WRG_Dr24bitBMap 0x0024 /* Draw a 24bit Bitmap */
-#define W4WRG_Comment 0x0025 /* intermal MSG comment */
-#define W4WRG_Spline 0x0026 /* to be defined */
-#define W4WRG_Transform 0x0027 /* to be defined */
-#define W4WRG_LineHead 0x0028 /* to be defined */
-#define W4WRG_LineTail 0x0029 /* to be defined */
-#define W4WRG_CanvasCol 0x002A /* canvas color of image */
-#define W4WRG_BmpPos 0x002B /* x,y and scaling of bitmap */
-
-#define W4WRG_EoFile 0xFFFF /* End of File */
-
-
-
-int SwW4WGraf::GetNextRecord()
-{
- USHORT nRecId;
- long nVarSize;
- short nRet=0;
-
- nRecId=GetHexUShort();
- nVarSize=GetVarSize();
-
- switch( nRecId )
- {
- case W4WRG_DefPal: nRet = ReadPalette( nVarSize ); break;
- case W4WRG_DrBMap: nRet = ReadBitmap( nVarSize ); break;
- case W4WRG_Dr24bitBMap: nRet = ReadBitmap( nVarSize ); break;
- default: SkipBytes( nVarSize );
- }
- if( nRet < 0 ) nStat = nRet;
- return (nRet) ? nRet : nRecId;
-}
-
-
-short SwW4WGraf::ReadW4WGrafBMap( long, long, long ) // Mastersoft internal Format Bitmap
-{
- int nRet;
- do {
- nRet=GetNextRecord();
- } while (nError==0 && nRet!=(int)W4WRG_EoFile && nRet!=-1 && nRet!=-1); //$ EOF
- return nStat;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// W4W Vectorimport von Joe (BEGIN) ///////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-BOOL SwW4WGraf::CheckW4WVector() // enthlt die W4W-Grafik Vektordaten ? (Joe)
-{
- long nFPosMerk = rInp.Tell();
- long nVarSize;
- USHORT nRecID;
- BOOL bRet = FALSE;
-
- do {
- nRecID = GetHexUShort();
- nVarSize = GetVarSize();
-
- // Bitmap ?
- if( ( nRecID == W4WRG_DefPal )
- || ( nRecID == W4WRG_DrBMap )
- || ( nRecID == W4WRG_Dr24bitBMap ) ) break;
-
- // Vektor ?
- if( ( nRecID == W4WRG_LineTo )
- || ( nRecID == W4WRG_FloodF )
- || ( nRecID == W4WRG_DrMark )
- || ( nRecID == W4WRG_DrMrkP )
- || ( nRecID == W4WRG_DrRect )
- || ( nRecID == W4WRG_DrPLin )
- || ( nRecID == W4WRG_DrPoly )
- || ( nRecID == W4WRG_DrwArc )
- || ( nRecID == W4WRG_DrwPie )
- || ( nRecID == W4WRG_DrCirc )
- || ( nRecID == W4WRG_DrText )
- || ( nRecID == W4WRG_DrChrd ) )
- {
- bRet = TRUE; break;
- }
- SkipBytes( nVarSize );
- }
- while( ( !nError ) && ( W4WRG_EoFile != nRecID ) );
-
- rInp.Seek( nFPosMerk ); // FilePos restaurieren
- return bRet;
-}
-
-
-void SwW4WGraf::ReadHexPoint(Point& aPnt)
-{
- USHORT xu=GetHexUShort();
- USHORT yu=GetHexUShort();
- if( xu < nVectMinX )
- nVectMinX = xu;
- if( xu > nVectMaxX )
- nVectMaxX = xu;
- if( yu < nVectMinY )
- nVectMinY = yu;
- if( yu > nVectMaxY )
- nVectMaxY = yu;
- long x=xu;
- long y=yu;
- Point a(x,y);
- aPnt=a;
-}
-
-
-void DrehePoint(Point& P, long cx, long cy, double sn, double cs)
-{
- long dx,dy;
- double x1,y1;
- dx=P.X()-cx;
- dy=P.Y()-cy;
- x1=dx*cs-dy*sn;
- y1=dy*cs+dx*sn;
- P=Point(cx+long(x1),cy+long(y1));
-}
-
-
-int SwW4WGraf::GetNextVectRec(OutputDevice& rOut)
-{
- USHORT nRecID;
- long nVarSize;
-
- nRecID = GetHexUShort();
- nVarSize = GetVarSize();
-
- switch (nRecID) {
- case W4WRG_RecdID: {
- /* INT16 nId= */ GetHexUShort();
- /* INT16 nRes= */GetHexUShort();
- /* INT16 nX0= */ GetHexUShort();
- /* INT16 nY0= */ GetHexUShort();
- /* INT16 nX1= */ GetHexUShort();
- /* INT16 nY1= */ GetHexUShort();
- } break;
- case W4WRG_Scalng: {
- SkipBytes(nVarSize); // Dummy fuer Breakpoint
- } break;
- case W4WRG_MoveTo: {
- ReadHexPoint(aVectPos);
- } break;
- case W4WRG_LineTo: {
- Point aP;
- ReadHexPoint(aP);
- rOut.DrawLine(aVectPos,aP);
- aVectPos=aP;
- } break;
- case W4WRG_DrPLin: case W4WRG_DrPoly: {
- INT16 nPts=GetHexUShort();
- INT16 i;
- Polygon aPoly(nPts);
- Point P1;
- for (i=0;i<nPts;i++) {
- ReadHexPoint(P1);
- aPoly.SetPoint(P1,i);
- }
- if (nRecID==W4WRG_DrPLin) rOut.DrawPolyLine(aPoly);
- else rOut.DrawPolygon(aPoly);
- } break;
- case W4WRG_DrRect: {
- Point P1,P2;
- ReadHexPoint(P1);
- ReadHexPoint(P2);
- rOut.DrawRect(Rectangle(P1,P2));
- } break;
- case W4WRG_DrCirc: {
- short xc=(short)GetHexUShort();
- short yc=(short)GetHexUShort();
- short xr=(short)GetHexUShort();
- short yr=(short)GetHexUShort();
- rOut.DrawEllipse(Rectangle(Point(xc-xr,yc-yr),Point(xc+xr,yc+yr)));
- } break;
- case W4WRG_DrwPie: case W4WRG_DrwArc: {
- long xc=(short)GetHexUShort(),
- yc=(short)GetHexUShort(),
- xr=(short)GetHexUShort(),
- yr=(short)GetHexUShort(),
- nAnf=(short)GetHexUShort(),
- nEnd=(short)GetHexUShort();
- double sn,cs;
- Point aAnf(xc+xr,yc);
- Point aEnd=aAnf;
- sn=sin(double(nAnf)*3.14159265359/18000);
- cs=cos(double(nAnf)*3.14159265359/18000);
- DrehePoint(aAnf,xc,yc,sn,cs);
- sn=sin(double(nEnd)*3.14159265359/18000);
- cs=cos(double(nEnd)*3.14159265359/18000);
- DrehePoint(aEnd,xc,yc,sn,cs);
- if (nRecID==W4WRG_DrwPie)
- rOut.DrawPie(Rectangle(Point(xc-xr,yc-yr),Point(xc+xr,yc+yr)),aAnf,aEnd);
- else rOut.DrawArc(Rectangle(Point(xc-xr,yc-yr),Point(xc+xr,yc+yr)),aAnf,aEnd);
- } break;
- case W4WRG_DefBrs: {
- USHORT nPat=GetHexUShort();
- USHORT nBlu=GetHexByte();
- USHORT nGrn=GetHexByte();
- USHORT nRed=GetHexByte();
- Color aCol(nRed*0x0100,nGrn*0x0100,nBlu*0x0100);
-// Brush aBrs(aCol);
- switch (nPat) {
- //case 0: Bitmap
-// case 1: aBrs.SetStyle(BRUSH_SOLID); break;
-// case 2: aBrs.SetStyle(BRUSH_VERT); break;
-// case 3: aBrs.SetStyle(BRUSH_UPDIAG); break; // +45deg
-// case 4: aBrs.SetStyle(BRUSH_HORZ); break;
-// case 5: aBrs.SetStyle(BRUSH_DOWNDIAG); break; // -45deg
-// case 6: aBrs.SetStyle(BRUSH_50); break; // Dots
-// case 7: aBrs.SetStyle(BRUSH_CROSS); break;
-// case 8: aBrs.SetStyle(BRUSH_DIAGCROSS); break;
- case 9: aCol.SetTransparency(0xff); break; // BRUSH_NULL Hollow
- }
- rOut.SetFillColor(aCol);
- } break;
- case W4WRG_DefPen: {
- USHORT nPat=GetHexUShort();
- USHORT nBlu=GetHexByte();
- USHORT nGrn=GetHexByte();
- USHORT nRed=GetHexByte();
- /* USHORT nWdt= */ GetHexUShort();
- /* USHORT nHgt= */ GetHexUShort();
- Color aCol(nRed*0x0100,nGrn*0x0100,nBlu*0x0100);
-// Pen aPen(aCol);
- switch (nPat) {
- case 0: aCol.SetTransparency(0xff);/*aPen.SetStyle(PEN_NULL);*/ break;
-// case 1: aPen.SetStyle(PEN_SOLID); break;
-// case 2: aPen.SetStyle(PEN_DASH); break;
-// case 3: aPen.SetStyle(PEN_DOT); break;
-// case 4: aPen.SetStyle(PEN_DASHDOT); break;
-// case 5: aPen.SetStyle(PEN_DASHDOT); break;
- }
- rOut.SetLineColor(aCol);
- } break;
- case W4WRG_BckCol: {
- USHORT nBlu=GetHexByte();
- USHORT nGrn=GetHexByte();
- USHORT nRed=GetHexByte();
- Color aCol(nRed*0x0100,nGrn*0x0100,nBlu*0x0100);
- rOut.SetBackground(Wallpaper(aCol));
- } break;
- case W4WRG_DefFnt:
- {
- USHORT i;
- USHORT Grad=GetHexByte();
- USHORT nLen=USHORT(nVarSize)-2; // Lnge des Fontnamen inkl. #0
- sal_Char* pC = new sal_Char[ nLen ];
- for (i=0;i<nLen;i++)
- pC[i]=(char)GetHexByte();
- String aStr( pC, RTL_TEXTENCODING_IBM_850 );
- Color aColor=rOut.GetLineColor();
- Font aFont(aStr,Size(0,Grad));
- aFont.SetColor(aColor);
- rOut.SetFont(aFont);
- delete[] pC;
- } break;
- case W4WRG_DrText: {
- USHORT i;
- Point P1;
- ReadHexPoint(P1);
- USHORT nLen=USHORT(nVarSize)-4; // Textlnge inkl. #0
- char* pC=new char[nLen];
- for (i=0;i<nLen;i++)
- pC[i]=(char)GetHexByte();
- String aStr( pC, RTL_TEXTENCODING_IBM_850 );
- rOut.DrawText(P1,aStr);
- delete[] pC;
- } break;
-
- /*
- folgende Dummys sind ggfs. noch zu implementieren
- */
- case W4WRG_TextBox: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- case W4WRG_StClPath: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- case W4WRG_EoClPath: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- case W4WRG_Bezier: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- /*
- case W4WRG_Dr24bitBMap: {
- ;
- } break;
- */
- case W4WRG_Comment: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- case W4WRG_Spline: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- case W4WRG_Transform: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- case W4WRG_LineHead: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- case W4WRG_LineTail: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- case W4WRG_CanvasCol: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
- case W4WRG_BmpPos: {
- // Dummy-Implementation
- for( USHORT i=0; i < nVarSize; i++) GetHexByte();
- } break;
-
-// Bitmap und Vektoren gemischt geht nicht, denn im W4W-BitmapRec steht
-// nichts ber die Position der Bitmap in der Grafik drin. Die Gráe der
-// Bitmap knnte man sich mittels Pixelsize und DPI ausrechnen. Joe M.
-// case W4WRG_DefPal: {
-// ReadPalette(nVarSize);
-// } break;
-// case W4WRG_DrBMap: {
-// ReadBitmap(nVarSize);
-// if (rFileName!=aEmptyStr) { // BMap im File
-// rFileName=aEmptystr;
-// } else {
-// if ...
-// }
-// } break;
- default: SkipBytes(nVarSize);
- }
- return nRecID;
-}
-
-
-short SwW4WGraf::ReadW4WGrafVect( long, long, long ) // Mastersoft internal Format Vector (Joe)
-{
- int nRet;
- GDIMetaFile aMtf; // fr Vektorimport des internen W4W-Formats (Joe)
- VirtualDevice aOut;
- aMtf.Record(&aOut); // aOut ans Metafile binden
- do {
- nRet=GetNextVectRec(aOut);
- } while (nError==0 && nRet!=(int)W4WRG_EoFile && nRet!=-1 && nRet!=-1); //$ EOF
- aMtf.Stop();
- aMtf.WindStart();
- aMtf.SetPrefMapMode( MAP_10TH_MM );
- long nSizX = (long)nVectMaxX - (long)nVectMinX; // Groesse
- long nRandX = nSizX / 50 + 1; // Zugabe
- long nSizY = (long)nVectMaxY - (long)nVectMinY;
- long nRandY = nSizY / 50 + 1; // Zugabe
- aMtf.SetPrefSize( Size( nSizX + 2 * nRandX, nSizY + 2 * nRandY ) );
-
- // Das Obere zuunterst kehren
- aMtf.Scale( Fraction( 1, 1 ), Fraction( -1, 1 ) );
- aMtf.Move( (long)nVectMinX + nRandX, (long)nVectMaxY + nRandY );
- pGraph=new Graphic(aMtf);
-
- return nStat;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// W4W Vectorimport von Joe (ENDE) ////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-
-struct WmfFileHd
-{ // Vorsicht: Struktur ist nicht aligned
- USHORT nTyp; // 0 = Mem, 1 = File
- USHORT nHdSiz; // 0x009
- USHORT nVersion; // 0x300
- ULONG nSize; // filesize in bytes
- USHORT nNoObj; // Number of Objects that exist at same time
- ULONG nMaxRecLen; // largest record
- USHORT nNoParas; // not used
-};
-
-//#define WMF_FILE_HD_SIZ 18 // Groesse der Struktur WmfFileHd
-
-
-ULONG SwW4WGraf::ReadWmfHeader( WmfFileHd& rHd )
-{
- long nPos = rInp.Tell();
-
- rHd.nTyp = GetHexUShort();
- rHd.nHdSiz = GetHexUShort();
- rHd.nVersion = GetHexUShort();
- rHd.nSize = GetHexULong();
- rHd.nNoObj = GetHexUShort();
- rHd.nMaxRecLen = GetHexULong();
- rHd.nNoParas = GetHexUShort();
-
- rInp.Seek( nPos );
- return rHd.nSize * 2; // FileSize in Bytes
-}
-
-struct METAFILEHEADER
-{
- UINT32 key;
- UINT16 hmf;
- UINT16 left;
- UINT16 top;
- UINT16 right;
- UINT16 bottom;
- UINT16 inch;
- UINT32 reserved;
- UINT16 checksum;
-};
-
-#define METAFILEHEADER_SIZE 22
-
-
-void WriteWmfPreHd( long nWidth, long nHeight, SvStream& rOStream ) //$ ostream
-{
- METAFILEHEADER aHeader;
-
- aHeader.key = 0x9AC6CDD7L;
- aHeader.hmf = 0;
- aHeader.left = 0;
- aHeader.top = 0;
- aHeader.right = (USHORT)( nWidth * 100 / 144 );
- aHeader.bottom = (USHORT)( nHeight * 100 / 144 );
- aHeader.inch= 1000;
- aHeader.reserved = 0;
- aHeader.checksum = 0;
- for( USHORT n=0; n < 10; n++ )
- aHeader.checksum ^= *(((UINT16*)&aHeader)+n);
-
-#ifndef OSL_LITENDIAN
- aHeader.key = SWAPLONG( aHeader.key );
- aHeader.left = 0;
- aHeader.top = 0;
- aHeader.right = SWAPSHORT( aHeader.right );
- aHeader.bottom = SWAPSHORT( aHeader.bottom );
- aHeader.inch = SWAPSHORT( aHeader.inch );
- aHeader.checksum = SWAPSHORT( aHeader.checksum );
-#endif // !OSL_LITENDIAN
-
- rOStream.Write( (char*)&aHeader, METAFILEHEADER_SIZE );
-}
-
-
-static BYTE WpgFileHd[]={ 0xFF, 0x57, 0x50, 0x43, 0x10, 0x00, 0x00, 0x00,
- 0x01, 0x16, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 };
-
-
-short SwW4WGraf::ReadGrafFile( long nTyp, long nWidth, long nHeight ) // Grafik in File schreiben
-{
- SvCacheStream aOut;
- BOOL bWriteToOut = TRUE;
- switch ( nTyp )
- {
- /*
- Anmerkungen zu den Datei-Formaten, die als
- Hex-Dump im Zwischenkode stehen:
-
- 503 = encapsulated Postscript
- mit Vorschau-Header --> alles dumpen
- Wir haben hierfuer leider
- noch keinen Import-Filter.
-
- 513 = Bitmap incl. Header --> alles dumpen
-
- 614 = in AmiPro importierte WPG-
- Files, die fuer uns leider
- unlesbar sind: unbekanntes
- Format --> dennoch alles dumpen
-
- 615 = WPG ( WordPerfect ) --> alles dumpen
- Wir haben hierfuer leider
- noch keinen Import-Filter.
-
- */
- case 1: { // WMF ( z.B. WinWord )
- WmfFileHd aHd; // lies Header
- ULONG nSiz = ReadWmfHeader( aHd ); // FileSize in Bytes
-
- WriteWmfPreHd( nWidth, nHeight, aOut ); // Placeable WMF-Header
-
- register ULONG i;
- for ( i = 0; i < nSiz && !nError; i++ ) // Schreibe Daten
- aOut << (BYTE)GetHexByte();
- bWriteToOut = FALSE;
- }
- break;
-
- case 606:{ // WPG ( WordPerfect )
- // Es fehlt der File-Header, es gibt auch keine
- // Info ueber ihn. Ich nehme mal an, dass er immer
- // gleich ist wie in den Beispiel-Dateien von WpWin52
-
- for (size_t i = 0; i < sizeof(WpgFileHd); ++i) // Schreibe Header
- aOut << WpgFileHd[i];
- }
- break;
-
- case 610:{ // Metafile
- // diese Metafile-Dateien sind in
- // WinWord eingebunden und
- // haben einen verstuemmelten Header
- // sowie eine andere Dateilaenge als
- // die Original-Dateien
- ReadChar(); // ueberlies " 0 | "
- ReadChar();
- }
- break;
-
- }
-
- if( bWriteToOut )
- {
- register long i = 0;
- register short s; // evtl. mit Header
- while( !nError )
- {
- s = GetHexByte(); // Kopiere Daten
- if ( s < 0 ) break; // fertig
- aOut << (BYTE)s;
- i++;
- }
- }
-
- GraphicFilter& rGF = *GetGrfFilter(); // lies ueber UNSERE Filter ein
- pGraph = new Graphic();
-
- aOut.Seek( STREAM_SEEK_TO_BEGIN );
-
- if( 0 != rGF.ImportGraphic( *pGraph, aEmptyStr, aOut ))
- DELETEZ( pGraph );
-
-// aOut.SwapOut();
-
- return 0;
-}
-
-
-short SwW4WGraf::Read( long nTyp, long nWidth, long nHeight )
-{
- if( pGraph ) DELETEZ( pGraph );
- nStat = 0;
- switch( nTyp ) {
- case 0: {
- if( CheckW4WVector() )
- {
- return ReadW4WGrafVect( nTyp, nWidth, nHeight ); // Mastersoft internal Format Vector
- } else
- {
- return ReadW4WGrafBMap( nTyp, nWidth, nHeight ); // Mastersoft internal Format Bitmap
- }
- }
- default:
- {
- // erweitert um viele Formate (khz, April 1998)
- return ReadGrafFile( nTyp, nWidth, nHeight );
- }
- }
-}
-
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/filter/w4w/sw_w4wpar1.cxx b/binfilter/bf_sw/source/filter/w4w/sw_w4wpar1.cxx
deleted file mode 100644
index 278b76e..0000000
--- a/binfilter/bf_sw/source/filter/w4w/sw_w4wpar1.cxx
+++ /dev/null
@@ -1,3732 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <hintids.hxx>
-
-#include <bf_svtools/zforlist.hxx>
-
-#include <bf_svx/paperinf.hxx>
-#include <bf_svx/langitem.hxx>
-#include <bf_sfx2/docfile.hxx>
-#include <bf_svx/ulspitem.hxx>
-#include <bf_svx/shdditem.hxx>
-#include <bf_svx/langitem.hxx>
-#include <bf_svx/pbinitem.hxx>
-#include <bf_svx/brkitem.hxx>
-#include <bf_svx/wghtitem.hxx>
-#include <bf_svx/udlnitem.hxx>
-#include <bf_svx/wrlmitem.hxx>
-#include <bf_svx/udlnitem.hxx>
-#include <bf_svx/postitem.hxx>
-#include <bf_svx/escpitem.hxx>
-#include <bf_svx/colritem.hxx>
-#include <bf_svx/crsditem.hxx>
-#include <bf_svx/lspcitem.hxx>
-#include <bf_svx/lrspitem.hxx>
-#include <bf_svx/cmapitem.hxx>
-#include <bf_svx/fontitem.hxx>
-#include <bf_svx/cscoitem.hxx>
-#include <bf_svx/tstpitem.hxx>
-#include <bf_svx/langitem.hxx>
-#include <bf_svx/fhgtitem.hxx>
-#include <bf_svx/adjitem.hxx>
-#include <unotools/charclass.hxx>
-#include <unotools/localedatawrapper.hxx>
-#include <bf_svx/unolingu.hxx>
-
-#include <fmthbsh.hxx>
-#include <fmthdft.hxx>
-#include <fmtfld.hxx>
-#include <fmtfsize.hxx>
-#include <fmtpdsc.hxx>
-#include <frmatr.hxx>
-#include <ftnidx.hxx>
-#include <ftninfo.hxx>
-#include <fmtftn.hxx>
-#include <txtftn.hxx>
-#include <pam.hxx> // fuer SwPam
-#include <doc.hxx>
-#include <shellio.hxx> // MAX_ASCII_PARA
-#include <ndtxt.hxx>
-#include <fldbas.hxx>
-#include <paratr.hxx>
-#include <fmtcol.hxx>
-#include <pagedesc.hxx>
-#include <docufld.hxx>
-#include <poolfmt.hxx> // RES_POOLCOLL_STANDARD
-#include <ndgrf.hxx>
-#include <w4wstk.hxx> // fuer den Attribut Stack
-#include <w4wpar.hxx>
-#include <w4wflt.hxx> // fuer den W4W Parser
-#include <fltini.hxx>
-#include <swfltopt.hxx>
-#include <flddat.hxx> // class SwDateTimeField
-#include <swunohelper.hxx>
-
-#include <sal/macros.h>
-
-#include <swerror.h>
-#include <mdiexp.hxx> // ...SetPercent()
-#include <statstr.hrc> // ResId fuer Statusleiste
-#include <bf_tools/string.hxx>
-namespace binfilter {
-
-#define HOR_SICHER 100 // Horizontale Bereiche werden mindestens so
- // gross gemacht ( z.B. Tab-Boxengroesse - LRSpace )
-
-#define MOGEL_WW6 // Bei WW6 werden PGW und SFL ignoriert, da falsch
-
-
-#define CHARBUF_SIZE (SAL_N_ELEMENTS( aCharBuffer ))
-
-// #define bInsertMode FALSE
-
-
-inline const SwNodeIndex & PtNd( const SwPaM * pPam )
- { return pPam->GetPoint()->nNode; }
-inline SwNodeIndex & PtNd( SwPaM* pPam )
- { return pPam->GetPoint()->nNode; }
-inline const SwIndex & PtCnt( const SwPaM * pPam )
- { return pPam->GetPoint()->nContent; }
-inline SwIndex & PtCnt( SwPaM* pPam )
- { return pPam->GetPoint()->nContent; }
-
-// ------------- allg. Funktionen --------------------
-
-// Ermittle die Anzahl der Bits der Varaiablen "n".
-// (Algorithmus kommt aus einer MAIL)
-
-static USHORT GetBitCnt( register ULONG n )
-{
- n = (n & 0x55555555) + ((n >> 1) & 0x55555555);
- n = (n & 0x33333333) + ((n >> 2) & 0x33333333);
- n = (n + (n >> 4)) & 0x0f0f0f0f;
- n += n >> 8;
- n += n >> 16;
- return ( (USHORT)n & 0xff);
-}
-
-
-/***************************************************************************
-#* Prototypes
-#**************************************************************************/
-
-extern "C" {
-#if defined( WNT ) && defined( _CRTAPI1 )
-// nur beim MSC von den NT Disks ist _CRTAPI1 definiert, nicht bei VC++
- #define COMPRECORD_MODIFIER _CRTAPI1
-#elif defined( WNT )
- #define COMPRECORD_MODIFIER __cdecl
-#else
- #define COMPRECORD_MODIFIER
-#endif
-
-
- int COMPRECORD_MODIFIER CompRecord( const void *pFirst, const void *pSecond)
- {
- return strncmp( (char*) &(((W4WRecord*)pSecond)->aRecType.c0) ,
- (char*) &(((W4WRecord*)pFirst)->aRecType.c0), 3 );
- }
- // die Routine ist absichtlich "falsch" herum ( 'A' > 'Z' ) definiert,
- // da sonst wg. Vorordnung der Quicksort laenger braucht
-
- #undef COMPRECORD_MODIFIER
-}
-
-static BOOL bSortRecordTab = FALSE;
-static W4WRecord aRecordTab[] = {
- {{'A', 'F', 'R'}, &SwW4WParser::Read_BeginFlushRight},
- {{'A', 'P', 'F'}, &SwW4WParser::Read_EndAbsPosObj},
- {{'A', 'P', 'O'}, &SwW4WParser::Read_BeginAbsPosObj},
- {{'B', 'B', 'T'}, &SwW4WParser::Read_BeginBold},
- {{'B', 'C', 'L'}, &SwW4WParser::Read_BeginColoredText},
- {{'B', 'C', 'M'}, &SwW4WParser::Read_BeginColumnMode},
- {{'B', 'C', 'O'}, &SwW4WParser::Read_BeginTabCell},
- {{'B', 'C', 'S'}, &SwW4WParser::Read_BeginSmallCaps},
- {{'B', 'C', 'U'}, &SwW4WParser::Read_BeginUpperCaps},
- {{'B', 'D', 'U'}, &SwW4WParser::Read_BeginDoubleUnderline},
- {{'B', 'H', 'P'}, &SwW4WParser::Read_BeginHyphen},
- {{'B', 'H', 'T'}, &SwW4WParser::Read_BeginHiddenText},
- {{'B', 'M', 'T'}, &SwW4WParser::Read_BeginMarkedText},
- {{'B', 'R', 'J'}, &SwW4WParser::Read_BeginRightJustify},
- {{'B', 'R', 'O'}, &SwW4WParser::Read_BeginTabRow},
- {{'B', 'S', 'O'}, &SwW4WParser::Read_BeginStrikeOut},
- {{'B', 'S', 'P'}, &SwW4WParser::Read_BeginShadow},
-
- {{'B', 'T', 'F'}, &SwW4WParser::Read_BeginTextFlow}, // FrameMaker
-
- {{'B', 'U', 'L'}, &SwW4WParser::Read_BeginUnderline},
- {{'C', 'D', 'S'}, &SwW4WParser::Read_ColumnsDefinition},
- {{'C', 'M', 'T'}, &SwW4WParser::Read_CommentLine},
- {{'C', 'T', 'X'}, &SwW4WParser::Read_BeginCenterText},
- {{'D', 'I', 'D'}, &SwW4WParser::Read_DefineDocumentType},
- {{'D', 'T', 'B'}, &SwW4WParser::Read_Tab},
- {{'D', 'T', 'F'}, &SwW4WParser::Read_DateTime},
- {{'E', 'A', 'T'}, &SwW4WParser::Read_EndFlushRight},
- {{'E', 'B', 'S'}, &SwW4WParser::Read_EndSubScript},
- {{'E', 'B', 'T'}, &SwW4WParser::Read_EndBold},
- {{'E', 'C', 'L'}, &SwW4WParser::Read_EndColoredText},
- {{'E', 'C', 'M'}, &SwW4WParser::Read_EndColumnMode},
- {{'E', 'C', 'S'}, &SwW4WParser::Read_EndSmallCaps},
- {{'E', 'C', 'T'}, &SwW4WParser::Read_EndCenterText},
- {{'E', 'C', 'U'}, &SwW4WParser::Read_EndUpperCaps},
- {{'E', 'D', 'U'}, &SwW4WParser::Read_EndDoubleUnderline},
- {{'E', 'F', 'N'}, &SwW4WParser::Read_FootNoteEnd},
- {{'E', 'F', 'T'}, &SwW4WParser::Read_FootNoteEnd},
- {{'E', 'H', 'P'}, &SwW4WParser::Read_EndHyphen},
- {{'E', 'H', 'T'}, &SwW4WParser::Read_EndHiddenText},
- {{'E', 'K', 'R'}, &SwW4WParser::Read_EndKerning},
- {{'E', 'M', 'T'}, &SwW4WParser::Read_EndMarkedText},
- {{'E', 'P', 'N'}, &SwW4WParser::Read_EndOfParaNum},
- {{'E', 'P', 'S'}, &SwW4WParser::Read_EndSuperScript},
- {{'E', 'R', 'J'}, &SwW4WParser::Read_EndRightJustify},
- {{'E', 'S', 'O'}, &SwW4WParser::Read_EndStrikeOut},
- {{'E', 'S', 'P'}, &SwW4WParser::Read_EndShadow},
-
- {{'E', 'T', 'F'}, &SwW4WParser::Read_EndTextFlow}, // FrameMaker
-
- {{'E', 'U', 'L'}, &SwW4WParser::Read_EndUnderline},
- {{'F', 'B', 'M'}, &SwW4WParser::Read_FooterBottomMargin},
-
- {{'F', 'L', 'O'}, &SwW4WParser::Read_Flow}, // FrameMaker
-
- {{'F', 'M', ' '}, &SwW4WParser::Read_FooterMargin},
- {{'F', 'N', 'I'}, &SwW4WParser::Read_FootNoteInfo},
- {{'F', 'N', 'T'}, &SwW4WParser::Read_FootNoteStart1},
- {{'F', 'T', 'N'}, &SwW4WParser::Read_FootNoteStart2},
- {{'H', 'C', 'B'}, &SwW4WParser::Read_ColumnBreak},
- {{'H', 'E', 'X'}, &SwW4WParser::Read_Hex},
- {{'H', 'H', 'C'}, &SwW4WParser::Read_HardHyphen},
- {{'H', 'H', 'L'}, &SwW4WParser::Read_HardHyphen},
- {{'H', 'H', 'P'}, &SwW4WParser::Read_HardHyphen},
- {{'H', 'F', '1'}, &SwW4WParser::Read_FooterStart},
- {{'H', 'F', '2'}, &SwW4WParser::Read_HeaderStart},
- {{'H', 'F', 'X'}, &SwW4WParser::Read_HeadFootEnd},
-
- {{'H', 'M', ' '}, &SwW4WParser::Read_HeadingMargin},
- {{'H', 'T', 'M'}, &SwW4WParser::Read_HeaderTopMargin},
- {{'H', 'N', 'L'}, &SwW4WParser::Read_HardNewLine},
- {{'H', 'N', 'P'}, &SwW4WParser::Read_HardNewPage},
- {{'H', 'S', 'P'}, &SwW4WParser::Read_HardSpace},
-
- {{'I', 'G', 'R'}, &SwW4WParser::Read_IncludeGraphic},
- {{'I', 'P', 'S'}, &SwW4WParser::Read_IndentPara},
- {{'I', 'T', 'F'}, &SwW4WParser::Read_EndItalic},
- {{'I', 'T', 'O'}, &SwW4WParser::Read_BeginItalic},
- {{'K', 'E', 'P'}, &SwW4WParser::Read_Split},
- {{'K', 'E', 'R'}, &SwW4WParser::Read_BeginKerning},
- {{'L', 'M', 'R'}, &SwW4WParser::Read_SetLeftMarginRelease},
- {{'N', 'B', 'R'}, &SwW4WParser::Read_NonBreakSpace},
- {{'N', 'L', 'N'}, &SwW4WParser::Read_NewLineInPara},
- {{'N', 'T', 'B'}, &SwW4WParser::Read_NewTabTable},
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list