diff options
Diffstat (limited to 'svtools/source/filter.vcl/filter')
-rw-r--r-- | svtools/source/filter.vcl/filter/FilterConfigItem.cxx | 4 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/exportdialog.cxx | 4 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/filter.cxx | 334 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/filter2.cxx | 316 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/sgfbram.cxx | 132 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/sgvmain.cxx | 202 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/sgvspln.cxx | 82 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/sgvtext.cxx | 364 |
8 files changed, 717 insertions, 721 deletions
diff --git a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx index 312f62af9d84..8d7752ddd7df 100644 --- a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx +++ b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx @@ -428,7 +428,7 @@ void FilterConfigItem::WriteBool( const OUString& rKey, sal_Bool bNewValue ) Any aAny; if ( ImplGetPropertyValue( aAny, xPropSet, rKey, sal_True ) ) { - sal_Bool bOldValue; + sal_Bool bOldValue(sal_True); if ( aAny >>= bOldValue ) { if ( bOldValue != bNewValue ) @@ -462,7 +462,7 @@ void FilterConfigItem::WriteInt32( const OUString& rKey, sal_Int32 nNewValue ) if ( ImplGetPropertyValue( aAny, xPropSet, rKey, sal_True ) ) { - sal_Int32 nOldValue; + sal_Int32 nOldValue = 0; if ( aAny >>= nOldValue ) { if ( nOldValue != nNewValue ) diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx index 20cc46a30ab5..701619d31f6c 100644 --- a/svtools/source/filter.vcl/filter/exportdialog.cxx +++ b/svtools/source/filter.vcl/filter/exportdialog.cxx @@ -794,7 +794,7 @@ void ExportDialog::createSizeControls( vcl::RowOrColumn& rLayout ) nUnit = UNIT_PIXEL; if ( nUnit < 0 ) nUnit = UNIT_CM; - maLbSizeX.SelectEntryPos( static_cast< USHORT >( nUnit ) ); + maLbSizeX.SelectEntryPos( static_cast< sal_uInt16 >( nUnit ) ); if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport) should be supported for vector formats also... this makes { // sense eg for bitmap fillings in metafiles, to preserve high dpi output @@ -807,7 +807,7 @@ void ExportDialog::createSizeControls( vcl::RowOrColumn& rLayout ) sal_Int32 nResolutionUnit = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), 1 ); if ( ( nResolutionUnit < 0 ) || ( nResolutionUnit > 2 ) ) nResolutionUnit = 1; - maLbResolution.SelectEntryPos( static_cast< USHORT >( nResolutionUnit ) ); + maLbResolution.SelectEntryPos( static_cast< sal_uInt16 >( nResolutionUnit ) ); } boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx index 7e0729082841..9c2c28dfbe3b 100644 --- a/svtools/source/filter.vcl/filter/filter.cxx +++ b/svtools/source/filter.vcl/filter/filter.cxx @@ -133,9 +133,9 @@ public: ~ImpFilterOutputStream() {} }; -BOOL ImplDirEntryHelper::Exists( const INetURLObject& rObj ) +sal_Bool ImplDirEntryHelper::Exists( const INetURLObject& rObj ) { - BOOL bExists = FALSE; + sal_Bool bExists = sal_False; try { @@ -188,11 +188,11 @@ void ImplDirEntryHelper::Kill( const String& rMainUrl ) //-------------------------------------------------------------------------- -BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize ) +sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nComp, sal_uLong nSize ) { while ( nComp-- >= nSize ) { - ULONG i; + sal_uLong i; for ( i = 0; i < nSize; i++ ) { if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) ) @@ -225,9 +225,9 @@ inline String ImpGetExtension( const String &rPath ) |* Eingabe-prarameter: |* rPath - Dateipfad |* rFormatExtension - Inhalt egal -|* bTest - setze FALSE +|* bTest - setze sal_False |* Ausgabe-parameter: -|* Funkionswert - TRUE wenn Erfolg +|* Funkionswert - sal_True wenn Erfolg |* rFormatExtension - Bei Erfolg: uebliche Dateiendung |* des Formats (Grossbuchstaben) |* 2.) Datei anlesen, Dateiformat ueberpruefen @@ -235,11 +235,11 @@ inline String ImpGetExtension( const String &rPath ) |* rPath - Dateipfad |* rFormatExtension - uebliche Dateiendung des Formats |* (Grossbuchstaben) -|* bTest - setze TRUE +|* bTest - setze sal_True |* Ausgabe-parameter: -|* Funkionswert - FALSE, wenn die Datei bestimmt nicht +|* Funkionswert - sal_False, wenn die Datei bestimmt nicht |* vom uebgebenen Format ist. -|* TRUE, wenn die Datei WAHRSCHEINLICH von +|* sal_True, wenn die Datei WAHRSCHEINLICH von |* dem Format ist, ODER WENN DAS FORMAT |* DIESER FUNKTION NICHT BEKANNT IST! |* @@ -248,22 +248,22 @@ inline String ImpGetExtension( const String &rPath ) |* *************************************************************************/ -static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, BOOL bTest ) +static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, sal_Bool bTest ) { - USHORT i; - BYTE sFirstBytes[ 256 ]; - ULONG nFirstLong,nSecondLong; - ULONG nStreamPos = rStream.Tell(); + sal_uInt16 i; + sal_uInt8 sFirstBytes[ 256 ]; + sal_uLong nFirstLong,nSecondLong; + sal_uLong nStreamPos = rStream.Tell(); rStream.Seek( STREAM_SEEK_TO_END ); - ULONG nStreamLen = rStream.Tell() - nStreamPos; + sal_uLong nStreamLen = rStream.Tell() - nStreamPos; rStream.Seek( nStreamPos ); if ( !nStreamLen ) { SvLockBytes* pLockBytes = rStream.GetLockBytes(); if ( pLockBytes ) - pLockBytes->SetSynchronMode( TRUE ); + pLockBytes->SetSynchronMode( sal_True ); rStream.Seek( STREAM_SEEK_TO_END ); nStreamLen = rStream.Tell() - nStreamPos; @@ -276,25 +276,25 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B { rStream.Read( sFirstBytes, nStreamLen ); - for( i = (USHORT) nStreamLen; i < 256; i++ ) + for( i = (sal_uInt16) nStreamLen; i < 256; i++ ) sFirstBytes[ i ]=0; } if( rStream.GetError() ) - return FALSE; + return sal_False; // Die ersten 8 Bytes in nFirstLong, nSecondLong unterbringen, // Big-Endian: for( i = 0, nFirstLong = 0L, nSecondLong = 0L; i < 4; i++ ) { - nFirstLong=(nFirstLong<<8)|(ULONG)sFirstBytes[i]; - nSecondLong=(nSecondLong<<8)|(ULONG)sFirstBytes[i+4]; + nFirstLong=(nFirstLong<<8)|(sal_uLong)sFirstBytes[i]; + nSecondLong=(nSecondLong<<8)|(sal_uLong)sFirstBytes[i+4]; } - // Folgende Variable ist nur bei bTest==TRUE interessant. Sie - // bleibt FALSE, wenn das Format (rFormatExtension) hier noch nicht + // Folgende Variable ist nur bei bTest==sal_True interessant. Sie + // bleibt sal_False, wenn das Format (rFormatExtension) hier noch nicht // einprogrammiert wurde. - BOOL bSomethingTested = FALSE; + sal_Bool bSomethingTested = sal_False; // Nun werden die verschieden Formate ueberprueft. Dabei ist die // Reihenfolge nicht egal. Z.b. koennte eine MET-Datei auch durch @@ -303,7 +303,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B // Theoretisch waere aber vielleicht auch eine BMP-Datei denkbar, // die durch den MET-Test geht. // Diese Probleme gibt es natuerlich nicht nur bei MET und BMP. - // Deshalb wird im Falle der Uberpruefung eines Formats (bTest==TRUE) + // Deshalb wird im Falle der Uberpruefung eines Formats (bTest==sal_True) // nur genau dieses eine Format getestet. Alles andere koennte fatale // Folgen haben, z.B. wenn der Benutzer sagt, es sei BMP-Datei (und es // ist BMP-Datei), und hier wuerde die Datei durch den MET-Test gehen... @@ -311,26 +311,26 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- MET ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "MET", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if( sFirstBytes[2] == 0xd3 ) { rStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStream.Seek( nStreamPos ); - USHORT nFieldSize; - BYTE nMagic; - BOOL bOK=TRUE; + sal_uInt16 nFieldSize; + sal_uInt8 nMagic; + sal_Bool bOK=sal_True; rStream >> nFieldSize >> nMagic; for (i=0; i<3; i++) { - if (nFieldSize<6) { bOK=FALSE; break; } - if (nStreamLen < rStream.Tell() + nFieldSize ) { bOK=FALSE; break; } + if (nFieldSize<6) { bOK=sal_False; break; } + if (nStreamLen < rStream.Tell() + nFieldSize ) { bOK=sal_False; break; } rStream.SeekRel(nFieldSize-3); rStream >> nFieldSize >> nMagic; - if (nMagic!=0xd3) { bOK=FALSE; break; } + if (nMagic!=0xd3) { bOK=sal_False; break; } } rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); if (bOK && !rStream.GetError()) { rFormatExtension= UniString::CreateFromAscii( "MET", 3 ); - return TRUE; + return sal_True; } } } @@ -338,9 +338,9 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- BMP ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "BMP", 3 ) == COMPARE_EQUAL ) ) { - BYTE nOffs; + sal_uInt8 nOffs; - bSomethingTested=TRUE; + bSomethingTested=sal_True; // OS/2-Bitmaparray ('BA') koennen wir evtl. auch lesen, // dementspr. muessen wir den Offset anpassen, @@ -364,7 +364,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B sFirstBytes[14+nOffs] == 0x0c ) { rFormatExtension = UniString::CreateFromAscii( "BMP", 3 ); - return TRUE; + return sal_True; } } } @@ -375,33 +375,33 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B ( rFormatExtension.CompareToAscii( "WMF", 3 ) == COMPARE_EQUAL ) || ( rFormatExtension.CompareToAscii( "EMF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if ( nFirstLong==0xd7cdc69a || nFirstLong==0x01000900 ) { rFormatExtension = UniString::CreateFromAscii( "WMF", 3 ); - return TRUE; + return sal_True; } else if( nFirstLong == 0x01000000 && sFirstBytes[ 40 ] == 0x20 && sFirstBytes[ 41 ] == 0x45 && sFirstBytes[ 42 ] == 0x4d && sFirstBytes[ 43 ] == 0x46 ) { rFormatExtension = UniString::CreateFromAscii( "EMF", 3 ); - return TRUE; + return sal_True; } } //--------------------------- PCX ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PCX", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if (sFirstBytes[0]==0x0a) { - BYTE nVersion=sFirstBytes[1]; - BYTE nEncoding=sFirstBytes[2]; + sal_uInt8 nVersion=sFirstBytes[1]; + sal_uInt8 nEncoding=sFirstBytes[2]; if( ( nVersion==0 || nVersion==2 || nVersion==3 || nVersion==5 ) && nEncoding<=1 ) { rFormatExtension = UniString::CreateFromAscii( "PCX", 3 ); - return TRUE; + return sal_True; } } } @@ -409,69 +409,69 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- TIF ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "TIF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if ( nFirstLong==0x49492a00 || nFirstLong==0x4d4d002a ) { rFormatExtension=UniString::CreateFromAscii( "TIF", 3 ); - return TRUE; + return sal_True; } } //--------------------------- GIF ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "GIF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if ( nFirstLong==0x47494638 && (sFirstBytes[4]==0x37 || sFirstBytes[4]==0x39) && sFirstBytes[5]==0x61 ) { rFormatExtension = UniString::CreateFromAscii( "GIF", 3 ); - return TRUE; + return sal_True; } } //--------------------------- PNG ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PNG", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if (nFirstLong==0x89504e47 && nSecondLong==0x0d0a1a0a) { rFormatExtension = UniString::CreateFromAscii( "PNG", 3 ); - return TRUE; + return sal_True; } } //--------------------------- JPG ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "JPG", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if ( ( nFirstLong==0xffd8ffe0 && sFirstBytes[6]==0x4a && sFirstBytes[7]==0x46 && sFirstBytes[8]==0x49 && sFirstBytes[9]==0x46 ) || ( nFirstLong==0xffd8fffe ) || ( 0xffd8ff00 == ( nFirstLong & 0xffffff00 ) ) ) { rFormatExtension = UniString::CreateFromAscii( "JPG", 3 ); - return TRUE; + return sal_True; } } //--------------------------- SVM ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "SVM", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if( nFirstLong==0x53564744 && sFirstBytes[4]==0x49 ) { rFormatExtension = UniString::CreateFromAscii( "SVM", 3 ); - return TRUE; + return sal_True; } else if( sFirstBytes[0]==0x56 && sFirstBytes[1]==0x43 && sFirstBytes[2]==0x4C && sFirstBytes[3]==0x4D && sFirstBytes[4]==0x54 && sFirstBytes[5]==0x46 ) { rFormatExtension = UniString::CreateFromAscii( "SVM", 3 ); - return TRUE; + return sal_True; } } //--------------------------- PCD ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PCD", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if( nStreamLen >= 2055 ) { char sBuf[8]; @@ -481,7 +481,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B if( strncmp( sBuf, "PCD_IPI", 7 ) == 0 ) { rFormatExtension = UniString::CreateFromAscii( "PCD", 3 ); - return TRUE; + return sal_True; } } } @@ -489,30 +489,30 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- PSD ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PSD", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if ( ( nFirstLong == 0x38425053 ) && ( (nSecondLong >> 16 ) == 1 ) ) { rFormatExtension = UniString::CreateFromAscii( "PSD", 3 ); - return TRUE; + return sal_True; } } //--------------------------- EPS ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "EPS", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; - if ( ( nFirstLong == 0xC5D0D3C6 ) || ( ImplSearchEntry( sFirstBytes, (BYTE*)"%!PS-Adobe", 10, 10 ) && - ImplSearchEntry( &sFirstBytes[15], (BYTE*)"EPS", 3, 3 ) ) ) + bSomethingTested = sal_True; + if ( ( nFirstLong == 0xC5D0D3C6 ) || ( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"%!PS-Adobe", 10, 10 ) && + ImplSearchEntry( &sFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) ) { rFormatExtension = UniString::CreateFromAscii( "EPS", 3 ); - return TRUE; + return sal_True; } } //--------------------------- DXF ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "DXF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; i=0; while (i<256 && sFirstBytes[i]<=32) @@ -533,22 +533,22 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B if (strncmp((char*)(sFirstBytes+i),"SECTION",7)==0) { rFormatExtension = UniString::CreateFromAscii( "DXF", 3 ); - return TRUE; + return sal_True; } } if( strncmp( (char*) sFirstBytes, "AutoCAD Binary DXF", 18 ) == 0 ) { rFormatExtension = UniString::CreateFromAscii( "DXF", 3 ); - return TRUE; + return sal_True; } } //--------------------------- PCT ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PCT", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; - BYTE sBuf[3]; + bSomethingTested = sal_True; + sal_uInt8 sBuf[3]; // store number format sal_uInt16 oldNumberFormat = rStream.GetNumberFormatInt(); sal_uInt32 nOffset; // in ms documents the pict format is used without the first 512 bytes @@ -577,19 +577,19 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x02) { rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); - return TRUE; + return sal_True; } // normal version 1 - page A25 else if (sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 && bdBoxOk) { rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); - return TRUE; + return sal_True; } // previous code kept in order to do not break any compatibility // probably eroneous else if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x01 && bdBoxOk) { rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); - return TRUE; + return sal_True; } } } @@ -600,7 +600,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B ( rFormatExtension.CompareToAscii( "PGM", 3 ) == COMPARE_EQUAL ) || ( rFormatExtension.CompareToAscii( "PPM", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if ( sFirstBytes[ 0 ] == 'P' ) { switch( sFirstBytes[ 1 ] ) @@ -608,17 +608,17 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B case '1' : case '4' : rFormatExtension = UniString::CreateFromAscii( "PBM", 3 ); - return TRUE; + return sal_True; case '2' : case '5' : rFormatExtension = UniString::CreateFromAscii( "PGM", 3 ); - return TRUE; + return sal_True; case '3' : case '6' : rFormatExtension = UniString::CreateFromAscii( "PPM", 3 ); - return TRUE; + return sal_True; } } } @@ -626,81 +626,81 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- RAS( SUN RasterFile )------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "RAS", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if( nFirstLong == 0x59a66a95 ) { rFormatExtension = UniString::CreateFromAscii( "RAS", 3 ); - return TRUE; + return sal_True; } } //--------------------------- XPM ------------------------------------ if( !bTest ) { - bSomethingTested = TRUE; - if( ImplSearchEntry( sFirstBytes, (BYTE*)"/* XPM */", 256, 9 ) ) + bSomethingTested = sal_True; + if( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"/* XPM */", 256, 9 ) ) { rFormatExtension = UniString::CreateFromAscii( "XPM", 3 ); - return TRUE; + return sal_True; } } else if( rFormatExtension.CompareToAscii( "XPM", 3 ) == COMPARE_EQUAL ) { - bSomethingTested = TRUE; - return TRUE; + bSomethingTested = sal_True; + return sal_True; } //--------------------------- XBM ------------------------------------ if( !bTest ) { - ULONG nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen; - BYTE* pBuf = new BYTE [ nSize ]; + sal_uLong nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen; + sal_uInt8* pBuf = new sal_uInt8 [ nSize ]; rStream.Seek( nStreamPos ); rStream.Read( pBuf, nSize ); - BYTE* pPtr = ImplSearchEntry( pBuf, (BYTE*)"#define", nSize, 7 ); + sal_uInt8* pPtr = ImplSearchEntry( pBuf, (sal_uInt8*)"#define", nSize, 7 ); if( pPtr ) { - if( ImplSearchEntry( pPtr, (BYTE*)"_width", pBuf + nSize - pPtr, 6 ) ) + if( ImplSearchEntry( pPtr, (sal_uInt8*)"_width", pBuf + nSize - pPtr, 6 ) ) { rFormatExtension = UniString::CreateFromAscii( "XBM", 3 ); delete[] pBuf; - return TRUE; + return sal_True; } } delete[] pBuf; } else if( rFormatExtension.CompareToAscii( "XBM", 3 ) == COMPARE_EQUAL ) { - bSomethingTested = TRUE; - return TRUE; + bSomethingTested = sal_True; + return sal_True; } //--------------------------- TGA ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL ) - return TRUE; + return sal_True; } //--------------------------- SGV ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL ) - return TRUE; + return sal_True; } //--------------------------- SGF ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "SGF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if( sFirstBytes[ 0 ] == 'J' && sFirstBytes[ 1 ] == 'J' ) { rFormatExtension = UniString::CreateFromAscii( "SGF", 3 ); - return TRUE; + return sal_True; } } @@ -718,7 +718,7 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const String& rPath, SvStream& rS if( rFormat == GRFILTER_FORMAT_DONTKNOW ) { String aFormatExt; - if( ImpPeekGraphicFormat( rStream, aFormatExt, FALSE ) ) + if( ImpPeekGraphicFormat( rStream, aFormatExt, sal_False ) ) { for( sal_uInt16 i = 0; i < n; i++ ) { @@ -747,7 +747,7 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const String& rPath, SvStream& rS else { String aTmpStr( pConfig->GetImportFormatExtension( rFormat ) ); - if( !ImpPeekGraphicFormat( rStream, aTmpStr, TRUE ) ) + if( !ImpPeekGraphicFormat( rStream, aTmpStr, sal_True ) ) return GRFILTER_FORMATERROR; if ( pConfig->GetImportFormatExtension( rFormat ).EqualsIgnoreCaseAscii( "pcd" ) ) { @@ -1079,7 +1079,7 @@ void GraphicFilter::ImplInit() // ------------------------------------------------------------------------ -ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm ) +sal_uLong GraphicFilter::ImplSetError( sal_uLong nError, const SvStream* pStm ) { pErrorEx->nFilterError = nError; pErrorEx->nStreamError = pStm ? pStm->GetError() : ERRCODE_NONE; @@ -1087,28 +1087,28 @@ ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm ) } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatCount() +sal_uInt16 GraphicFilter::GetImportFormatCount() { return pConfig->GetImportFormatCount(); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatNumber( const String& rFormatName ) +sal_uInt16 GraphicFilter::GetImportFormatNumber( const String& rFormatName ) { return pConfig->GetImportFormatNumber( rFormatName ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType ) +sal_uInt16 GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType ) { return pConfig->GetImportFormatNumberForMediaType( rMediaType ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName ) +sal_uInt16 GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName ) { return pConfig->GetImportFormatNumberForShortName( rShortName ); } @@ -1122,35 +1122,35 @@ sal_uInt16 GraphicFilter::GetImportFormatNumberForTypeName( const String& rType // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatName( USHORT nFormat ) +String GraphicFilter::GetImportFormatName( sal_uInt16 nFormat ) { return pConfig->GetImportFormatName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatTypeName( USHORT nFormat ) +String GraphicFilter::GetImportFormatTypeName( sal_uInt16 nFormat ) { return pConfig->GetImportFilterTypeName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatMediaType( USHORT nFormat ) +String GraphicFilter::GetImportFormatMediaType( sal_uInt16 nFormat ) { return pConfig->GetImportFormatMediaType( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatShortName( USHORT nFormat ) +String GraphicFilter::GetImportFormatShortName( sal_uInt16 nFormat ) { return pConfig->GetImportFormatShortName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportOSFileType( USHORT ) +String GraphicFilter::GetImportOSFileType( sal_uInt16 ) { String aOSFileType; return aOSFileType; @@ -1158,42 +1158,42 @@ String GraphicFilter::GetImportOSFileType( USHORT ) // ------------------------------------------------------------------------ -String GraphicFilter::GetImportWildcard( USHORT nFormat, sal_Int32 nEntry ) +String GraphicFilter::GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ) { return pConfig->GetImportWildcard( nFormat, nEntry ); } // ------------------------------------------------------------------------ -BOOL GraphicFilter::IsImportPixelFormat( USHORT nFormat ) +sal_Bool GraphicFilter::IsImportPixelFormat( sal_uInt16 nFormat ) { return pConfig->IsImportPixelFormat( nFormat ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatCount() +sal_uInt16 GraphicFilter::GetExportFormatCount() { return pConfig->GetExportFormatCount(); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatNumber( const String& rFormatName ) +sal_uInt16 GraphicFilter::GetExportFormatNumber( const String& rFormatName ) { return pConfig->GetExportFormatNumber( rFormatName ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType ) +sal_uInt16 GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType ) { return pConfig->GetExportFormatNumberForMediaType( rMediaType ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName ) +sal_uInt16 GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName ) { return pConfig->GetExportFormatNumberForShortName( rShortName ); } @@ -1207,35 +1207,35 @@ sal_uInt16 GraphicFilter::GetExportFormatNumberForTypeName( const String& rType // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatName( USHORT nFormat ) +String GraphicFilter::GetExportFormatName( sal_uInt16 nFormat ) { return pConfig->GetExportFormatName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatTypeName( USHORT nFormat ) +String GraphicFilter::GetExportFormatTypeName( sal_uInt16 nFormat ) { return pConfig->GetExportFilterTypeName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatMediaType( USHORT nFormat ) +String GraphicFilter::GetExportFormatMediaType( sal_uInt16 nFormat ) { return pConfig->GetExportFormatMediaType( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatShortName( USHORT nFormat ) +String GraphicFilter::GetExportFormatShortName( sal_uInt16 nFormat ) { return pConfig->GetExportFormatShortName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportOSFileType( USHORT ) +String GraphicFilter::GetExportOSFileType( sal_uInt16 ) { String aOSFileType; return aOSFileType; @@ -1243,22 +1243,22 @@ String GraphicFilter::GetExportOSFileType( USHORT ) // ------------------------------------------------------------------------ -String GraphicFilter::GetExportWildcard( USHORT nFormat, sal_Int32 nEntry ) +String GraphicFilter::GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ) { return pConfig->GetExportWildcard( nFormat, nEntry ); } // ------------------------------------------------------------------------ -BOOL GraphicFilter::IsExportPixelFormat( USHORT nFormat ) +sal_Bool GraphicFilter::IsExportPixelFormat( sal_uInt16 nFormat ) { return pConfig->IsExportPixelFormat( nFormat ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath, - USHORT nFormat, USHORT* pDeterminedFormat ) +sal_uInt16 GraphicFilter::CanImportGraphic( const INetURLObject& rPath, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::CanImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); @@ -1275,10 +1275,10 @@ USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath, // ------------------------------------------------------------------------ -USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream, - USHORT nFormat, USHORT* pDeterminedFormat ) +sal_uInt16 GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat ) { - ULONG nStreamPos = rIStream.Tell(); + sal_uLong nStreamPos = rIStream.Tell(); sal_uInt16 nRes = ImpTestOrFindFormat( rMainUrl, rIStream, nFormat ); rIStream.Seek(nStreamPos); @@ -1286,13 +1286,13 @@ USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStre if( nRes==GRFILTER_OK && pDeterminedFormat!=NULL ) *pDeterminedFormat = nFormat; - return (USHORT) ImplSetError( nRes, &rIStream ); + return (sal_uInt16) ImplSetError( nRes, &rIStream ); } // ------------------------------------------------------------------------ //SJ: TODO, we need to create a GraphicImporter component -USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath, - USHORT nFormat, USHORT * pDeterminedFormat, sal_uInt32 nImportFlags ) +sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath, + sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); @@ -1307,25 +1307,25 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPa return nRetValue; } -USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, - USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags ) +sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags ) { return ImportGraphic( rGraphic, rPath, rIStream, nFormat, pDeterminedFormat, nImportFlags, NULL ); } //------------------------------------------------------------------------- -USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, - USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags, +sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags, com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData ) { String aFilterName; - ULONG nStmBegin; - USHORT nStatus; + sal_uLong nStmBegin; + sal_uInt16 nStatus; GraphicReader* pContext = rGraphic.GetContext(); GfxLinkType eLinkType = GFX_LINK_TYPE_NONE; - BOOL bDummyContext = ( pContext == (GraphicReader*) 1 ); - const BOOL bLinkSet = rGraphic.IsLink(); + sal_Bool bDummyContext = ( pContext == (GraphicReader*) 1 ); + const sal_Bool bLinkSet = rGraphic.IsLink(); FilterConfigItem* pFilterConfigItem = NULL; Size aPreviewSizeHint( 0, 0 ); @@ -1376,7 +1376,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS else nStmBegin = rIStream.Tell(); - bAbort = FALSE; + bAbort = sal_False; nStatus = ImpTestOrFindFormat( rPath, rIStream, nFormat ); // Falls Pending, geben wir GRFILTER_OK zurueck, // um mehr Bytes anzufordern @@ -1385,13 +1385,13 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS rGraphic.SetContext( (GraphicReader*) 1 ); rIStream.ResetError(); rIStream.Seek( nStmBegin ); - return (USHORT) ImplSetError( GRFILTER_OK ); + return (sal_uInt16) ImplSetError( GRFILTER_OK ); } rIStream.Seek( nStmBegin ); if( ( nStatus != GRFILTER_OK ) || rIStream.GetError() ) - return (USHORT) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream ); + return (sal_uInt16) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream ); if( pDeterminedFormat ) *pDeterminedFormat = nFormat; @@ -1525,7 +1525,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS else if( aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGF ) || aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGV ) ) { - USHORT nVersion; + sal_uInt16 nVersion; unsigned char nTyp = CheckSgfTyp( rIStream, nVersion ); switch( nTyp ) @@ -1637,15 +1637,15 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS if( nStatus == GRFILTER_OK && bCreateNativeLink && ( eLinkType != GFX_LINK_TYPE_NONE ) && !rGraphic.GetContext() && !bLinkSet ) { - const ULONG nStmEnd = rIStream.Tell(); - const ULONG nBufSize = nStmEnd - nStmBegin; + const sal_uLong nStmEnd = rIStream.Tell(); + const sal_uLong nBufSize = nStmEnd - nStmBegin; if( nBufSize ) { - BYTE* pBuf=0; + sal_uInt8* pBuf=0; try { - pBuf = new BYTE[ nBufSize ]; + pBuf = new sal_uInt8[ nBufSize ]; } catch (std::bad_alloc) { @@ -1656,7 +1656,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS { rIStream.Seek( nStmBegin ); rIStream.Read( pBuf, nBufSize ); - rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, TRUE ) ); + rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, sal_True ) ); } } } @@ -1679,12 +1679,12 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS // ------------------------------------------------------------------------ -USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath, +sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath, sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ExportGraphic() : ProtType == INET_PROT_NOT_VALID" ); - BOOL bAlreadyExists = ImplDirEntryHelper::Exists( rPath ); + sal_Bool bAlreadyExists = ImplDirEntryHelper::Exists( rPath ); String aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) ); SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aMainUrl, STREAM_WRITE | STREAM_TRUNC ); @@ -1701,10 +1701,10 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObjec // ------------------------------------------------------------------------ -USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath, +sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath, SvStream& rOStm, sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData ) { - USHORT nFormatCount = GetExportFormatCount(); + sal_uInt16 nFormatCount = GetExportFormatCount(); ResetLastError(); nExpGraphHint = 0; @@ -1715,7 +1715,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat String aExt( aURL.GetFileExtension().toAsciiUpperCase() ); - for( USHORT i = 0; i < nFormatCount; i++ ) + for( sal_uInt16 i = 0; i < nFormatCount; i++ ) { if ( pConfig->GetExportFormatExtension( i ).EqualsIgnoreCaseAscii( aExt ) ) { @@ -1725,13 +1725,13 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat } } if( nFormat >= nFormatCount ) - return (USHORT) ImplSetError( GRFILTER_FORMATERROR ); + return (sal_uInt16) ImplSetError( GRFILTER_FORMATERROR ); FilterConfigItem aConfigItem( (uno::Sequence< beans::PropertyValue >*)pFilterData ); String aFilterName( pConfig->GetExportFilterName( nFormat ) ); - bAbort = FALSE; - USHORT nStatus = GRFILTER_OK; + bAbort = sal_False; + sal_uInt16 nStatus = GRFILTER_OK; GraphicType eType; Graphic aGraphic( rGraphic ); @@ -1743,12 +1743,12 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat if( eType != GRAPHIC_BITMAP ) { Size aSizePixel; - ULONG nColorCount,nBitsPerPixel,nNeededMem,nMaxMem; + sal_uLong nColorCount,nBitsPerPixel,nNeededMem,nMaxMem; VirtualDevice aVirDev; // Maximalen Speicherbedarf fuer das Bildes holen: // if( GetOptionsConfig() ) -// nMaxMem = (UINT32)GetOptionsConfig()->ReadKey( "VEC-TO-PIX-MAX-KB", "1024" ).ToInt32(); +// nMaxMem = (sal_uInt32)GetOptionsConfig()->ReadKey( "VEC-TO-PIX-MAX-KB", "1024" ).ToInt32(); // else nMaxMem = 1024; @@ -1765,14 +1765,14 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat else if (nColorCount<=256) nBitsPerPixel=8; else if (nColorCount<=65536) nBitsPerPixel=16; else nBitsPerPixel=24; - nNeededMem=((ULONG)aSizePixel.Width()*(ULONG)aSizePixel.Height()*nBitsPerPixel+7)/8; + nNeededMem=((sal_uLong)aSizePixel.Width()*(sal_uLong)aSizePixel.Height()*nBitsPerPixel+7)/8; // ggf. Groesse des Bildes einschraenken: if (nMaxMem<nNeededMem) { double fFak=sqrt(((double)nMaxMem)/((double)nNeededMem)); - aSizePixel.Width()=(ULONG)(((double)aSizePixel.Width())*fFak); - aSizePixel.Height()=(ULONG)(((double)aSizePixel.Height())*fFak); + aSizePixel.Width()=(sal_uLong)(((double)aSizePixel.Width())*fFak); + aSizePixel.Height()=(sal_uLong)(((double)aSizePixel.Height())*fFak); } aVirDev.SetMapMode(MapMode(MAP_PIXEL)); @@ -1793,7 +1793,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat { Bitmap aBmp( aGraphic.GetBitmap() ); sal_Int32 nColorRes = aConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Colors" ) ), 0 ); - if ( nColorRes && ( nColorRes <= (USHORT)BMP_CONVERSION_24BIT) ) + if ( nColorRes && ( nColorRes <= (sal_uInt16)BMP_CONVERSION_24BIT) ) { if( !aBmp.Convert( (BmpConversion) nColorRes ) ) aBmp = aGraphic.GetBitmap(); @@ -2019,16 +2019,16 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat // ------------------------------------------------------------------------ -BOOL GraphicFilter::Setup( USHORT ) +sal_Bool GraphicFilter::Setup( sal_uInt16 ) { - return FALSE; + return sal_False; } /* ------------------------------------------------------------------------ No Import filter has a dialog, so the following two methods are obsolete */ -BOOL GraphicFilter::HasImportDialog( USHORT ) +sal_Bool GraphicFilter::HasImportDialog( sal_uInt16 ) { return sal_True; // return pConfig->IsImportDialog( nFormat ); @@ -2036,26 +2036,26 @@ BOOL GraphicFilter::HasImportDialog( USHORT ) // ------------------------------------------------------------------------ -BOOL GraphicFilter::DoImportDialog( Window*, USHORT ) +sal_Bool GraphicFilter::DoImportDialog( Window*, sal_uInt16 ) { return sal_True; } // ------------------------------------------------------------------------ -BOOL GraphicFilter::HasExportDialog( USHORT nFormat ) +sal_Bool GraphicFilter::HasExportDialog( sal_uInt16 nFormat ) { return pConfig->IsExportDialog( nFormat ); } // ------------------------------------------------------------------------ -BOOL GraphicFilter::DoExportDialog( Window* pWindow, USHORT nFormat ) +sal_Bool GraphicFilter::DoExportDialog( Window* pWindow, sal_uInt16 nFormat ) { return DoExportDialog( pWindow, nFormat, FUNIT_MM ); } -BOOL GraphicFilter::DoExportDialog( Window*, USHORT nFormat, FieldUnit ) +sal_Bool GraphicFilter::DoExportDialog( Window*, sal_uInt16 nFormat, FieldUnit ) { sal_Bool bRet = sal_False; com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > @@ -2113,7 +2113,7 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData ) if( pData ) { - USHORT nFormat = GRFILTER_FORMAT_DONTKNOW; + sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW; ByteString aShortName; switch( pData->mnFormat ) { @@ -2161,12 +2161,12 @@ GraphicFilter* GraphicFilter::GetGraphicFilter() int GraphicFilter::LoadGraphic( const String &rPath, const String &rFilterName, Graphic& rGraphic, GraphicFilter* pFilter, - USHORT* pDeterminedFormat ) + sal_uInt16* pDeterminedFormat ) { if ( !pFilter ) pFilter = GetGraphicFilter(); - const USHORT nFilter = rFilterName.Len() && pFilter->GetImportFormatCount() + const sal_uInt16 nFilter = rFilterName.Len() && pFilter->GetImportFormatCount() ? pFilter->GetImportFormatNumber( rFilterName ) : GRFILTER_FORMAT_DONTKNOW; diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx index d91ec1a19772..9b655c732036 100644 --- a/svtools/source/filter.vcl/filter/filter2.cxx +++ b/svtools/source/filter.vcl/filter/filter2.cxx @@ -40,7 +40,7 @@ #define DATA_SIZE 640 -BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG ); +sal_uInt8* ImplSearchEntry( sal_uInt8* , sal_uInt8* , sal_uLong , sal_uLong ); /************************************************************************* |* @@ -51,7 +51,7 @@ BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG ); GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ) ), aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ), - bOwnStream( TRUE ) + bOwnStream( sal_True ) { ImpConstruct(); } @@ -64,7 +64,7 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) : pFileStm ( &rInStream ), - bOwnStream ( FALSE ) + bOwnStream ( sal_False ) { ImpConstruct(); @@ -93,38 +93,38 @@ GraphicDescriptor::~GraphicDescriptor() |* \************************************************************************/ -BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::Detect( sal_Bool bExtendedInfo ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( pFileStm && !pFileStm->GetError() ) { SvStream& rStm = *pFileStm; - UINT16 nOldFormat = rStm.GetNumberFormatInt(); - - if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = TRUE; + sal_uInt16 nOldFormat = rStm.GetNumberFormatInt(); + + if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = sal_True; rStm.SetNumberFormatInt( nOldFormat ); } @@ -142,7 +142,7 @@ void GraphicDescriptor::ImpConstruct() nFormat = GFF_NOT; nBitsPerPixel = 0; nPlanes = 0; - bCompressed = FALSE; + bCompressed = sal_False; } @@ -152,10 +152,10 @@ void GraphicDescriptor::ImpConstruct() |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT16 nTemp16; - BOOL bRet = FALSE; + sal_uInt16 nTemp16; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -172,12 +172,12 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) if ( nTemp16 == 0x4d42 ) { nFormat = GFF_BMP; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT32 nTemp32; - UINT32 nCompression; + sal_uInt32 nTemp32; + sal_uInt32 nCompression; // bis zur ersten Information rStm.SeekRel( 0x10 ); @@ -218,7 +218,7 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) if ( ( nBitsPerPixel > 24 ) || ( nCompression > 3 ) ) { nFormat = GFF_NOT; - bRet = FALSE; + bRet = sal_False; } } } @@ -233,12 +233,12 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 n32; - UINT16 n16; - BOOL bRet = FALSE; - BYTE cByte; + sal_uInt32 n32; + sal_uInt16 n16; + sal_Bool bRet = sal_False; + sal_uInt8 cByte; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -250,11 +250,11 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ) if ( ( n16 == 0x6137 ) || ( n16 == 0x6139 ) ) { nFormat = GFF_GIF; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT16 nTemp16; + sal_uInt16 nTemp16; // PixelBreite auslesen rStm >> nTemp16; @@ -307,10 +307,10 @@ sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) return nByte; } -BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 nTemp32; - BOOL bRet = FALSE; + sal_uInt32 nTemp32; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); @@ -321,7 +321,7 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) ) { nFormat = GFF_JPG; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { @@ -473,16 +473,16 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPCD( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - UINT32 nTemp32; - UINT16 nTemp16; - BYTE cByte; + sal_uInt32 nTemp32; + sal_uInt16 nTemp16; + sal_uInt8 cByte; rStm.SeekRel( 2048 ); rStm >> nTemp32; @@ -494,7 +494,7 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL ) ( cByte == 0x49 ) ) { nFormat = GFF_PCD; - bRet = TRUE; + bRet = sal_True; } rStm.Seek( nStmPos ); return bRet; @@ -507,16 +507,16 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo ) { // ! Because 0x0a can be interpreted as LF too ... // we cant be shure that this special sign represent a PCX file only. // Every Ascii file is possible here :-( // We must detect the whole header. - bExtendedInfo = TRUE; + bExtendedInfo = sal_True; - BOOL bRet = FALSE; - BYTE cByte; + sal_Bool bRet = sal_False; + sal_uInt8 cByte; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -525,17 +525,17 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) if ( cByte == 0x0a ) { nFormat = GFF_PCX; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT16 nTemp16; - USHORT nXmin; - USHORT nXmax; - USHORT nYmin; - USHORT nYmax; - USHORT nDPIx; - USHORT nDPIy; + sal_uInt16 nTemp16; + sal_uInt16 nXmin; + sal_uInt16 nXmax; + sal_uInt16 nYmin; + sal_uInt16 nYmax; + sal_uInt16 nDPIx; + sal_uInt16 nDPIy; rStm.SeekRel( 1 ); @@ -596,10 +596,10 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 nTemp32; - BOOL bRet = FALSE; + sal_uInt32 nTemp32; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); @@ -611,11 +611,11 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) if ( nTemp32 == 0x0d0a1a0a ) { nFormat = GFF_PNG; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - BYTE cByte; + sal_uInt8 cByte; // IHDR-Chunk rStm.SeekRel( 8 ); @@ -635,9 +635,9 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) // Planes immer 1; // Kompression immer nPlanes = 1; - bCompressed = TRUE; + bCompressed = sal_True; - UINT32 nLen32; + sal_uInt32 nLen32; rStm.SeekRel( 8 ); @@ -654,8 +654,8 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) if ( nTemp32 == 0x70485973 ) { - ULONG nXRes; - ULONG nYRes; + sal_uLong nXRes; + sal_uLong nYRes; // horizontale Aufloesung rStm >> nTemp32; @@ -693,12 +693,12 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo ) { - BOOL bDetectOk = FALSE; - BOOL bRet = FALSE; - BYTE cByte1; - BYTE cByte2; + sal_Bool bDetectOk = sal_False; + sal_Bool bRet = sal_False; + sal_uInt8 cByte1; + sal_uInt8 cByte2; sal_Int32 nStmPos = rStm.Tell(); rStm >> cByte1; @@ -708,30 +708,30 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) if ( cByte1 == 0x49 ) { rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - bDetectOk = TRUE; + bDetectOk = sal_True; } else if ( cByte1 == 0x4d ) { rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); - bDetectOk = TRUE; + bDetectOk = sal_True; } if ( bDetectOk ) { - UINT16 nTemp16; + sal_uInt16 nTemp16; rStm >> nTemp16; if ( nTemp16 == 0x2a ) { nFormat = GFF_TIF; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - ULONG nCount; - ULONG nMax = DATA_SIZE - 48; - UINT32 nTemp32; - BOOL bOk = FALSE; + sal_uLong nCount; + sal_uLong nMax = DATA_SIZE - 48; + sal_uInt32 nTemp32; + sal_Bool bOk = sal_False; // Offset des ersten IFD einlesen rStm >> nTemp32; @@ -831,9 +831,9 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectXBM( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_XBM; @@ -847,9 +847,9 @@ BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectXPM( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_XPM; @@ -862,22 +862,22 @@ BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPBM( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; // erst auf Datei Extension pruefen, da diese aussagekraeftiger ist // als die 2 ID Bytes if ( aPathExt.CompareToAscii( "pbm", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { sal_Int32 nStmPos = rStm.Tell(); - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) ) - bRet = TRUE; + bRet = sal_True; rStm.Seek( nStmPos ); } @@ -893,19 +893,19 @@ BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPGM( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( aPathExt.CompareToAscii( "pgm", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; sal_Int32 nStmPos = rStm.Tell(); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) ) - bRet = TRUE; + bRet = sal_True; rStm.Seek( nStmPos ); } @@ -921,19 +921,19 @@ BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPPM( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( aPathExt.CompareToAscii( "ppm", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; sal_Int32 nStmPos = rStm.Tell(); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) ) - bRet = TRUE; + bRet = sal_True; rStm.Seek( nStmPos ); } @@ -949,17 +949,17 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectRAS( SvStream& rStm, sal_Bool ) { - UINT32 nMagicNumber; - BOOL bRet = FALSE; + sal_uInt32 nMagicNumber; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nMagicNumber; if ( nMagicNumber == 0x59a66a95 ) { nFormat = GFF_RAS; - bRet = TRUE; + bRet = sal_True; } rStm.Seek( nStmPos ); return bRet; @@ -971,9 +971,9 @@ BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectTGA( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_TGA; @@ -986,28 +986,28 @@ BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; - UINT32 nMagicNumber; + sal_uInt32 nMagicNumber; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nMagicNumber; if ( nMagicNumber == 0x38425053 ) { - UINT16 nVersion; + sal_uInt16 nVersion; rStm >> nVersion; if ( nVersion == 1 ) { - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT16 nChannels; - UINT32 nRows; - UINT32 nColumns; - UINT16 nDepth; - UINT16 nMode; + sal_uInt16 nChannels; + sal_uInt32 nRows; + sal_uInt32 nColumns; + sal_uInt16 nDepth; + sal_uInt16 nMode; rStm.SeekRel( 6 ); // Pad rStm >> nChannels >> nRows >> nColumns >> nDepth >> nMode; if ( ( nDepth == 1 ) || ( nDepth == 8 ) || ( nDepth == 16 ) ) @@ -1024,11 +1024,11 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) aPixSize.Height() = nRows; break; default: - bRet = FALSE; + bRet = sal_False; } } else - bRet = FALSE; + bRet = sal_False; } } } @@ -1045,14 +1045,14 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectEPS( SvStream& rStm, sal_Bool ) { // es wird die EPS mit Vorschaubild Variante und die Extensionuebereinstimmung // geprueft sal_uInt32 nFirstLong; sal_uInt8 nFirstBytes[20]; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); @@ -1065,7 +1065,7 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) && ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) ) { nFormat = GFF_EPS; - bRet = TRUE; + bRet = sal_True; } rStm.Seek( nStmPos ); return bRet; @@ -1077,9 +1077,9 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectDXF( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_DXF; @@ -1092,9 +1092,9 @@ BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectMET( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_MET; @@ -1108,16 +1108,16 @@ BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_PCT; else { sal_Int32 nStmPos = rStm.Tell(); - BYTE sBuf[4]; + sal_uInt8 sBuf[4]; rStm.SeekRel( 522 ); rStm.Read( sBuf, 3 ); @@ -1127,7 +1127,7 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) if ( ( sBuf[0] == 0x00 ) && ( sBuf[1] == 0x11 ) && ( ( sBuf[2] == 0x01 ) || ( sBuf[2] == 0x02 ) ) ) { - bRet = TRUE; + bRet = sal_True; nFormat = GFF_PCT; } } @@ -1144,21 +1144,21 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectSGF( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( aPathExt.CompareToAscii( "sgf", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { sal_Int32 nStmPos = rStm.Tell(); - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; rStm >> nFirst >> nSecond; if( nFirst == 'J' && nSecond == 'J' ) - bRet = TRUE; + bRet = sal_True; rStm.Seek( nStmPos ); } @@ -1176,9 +1176,9 @@ BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectSGV( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_SGV; @@ -1192,11 +1192,11 @@ BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 n32; - BOOL bRet = FALSE; - BYTE cByte; + sal_uInt32 n32; + sal_Bool bRet = sal_False; + sal_uInt8 cByte; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -1207,12 +1207,12 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) if ( cByte == 0x49 ) { nFormat = GFF_SVM; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT32 nTemp32; - UINT16 nTemp16; + sal_uInt32 nTemp32; + sal_uInt16 nTemp16; rStm.SeekRel( 0x04 ); @@ -1239,14 +1239,14 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) if( n32 == 0x4D4C4356 ) { - UINT16 nTmp16; + sal_uInt16 nTmp16; rStm >> nTmp16; if( nTmp16 == 0x4654 ) { nFormat = GFF_SVM; - bRet = TRUE; + bRet = sal_True; if( bExtendedInfo ) { @@ -1271,9 +1271,9 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectWMF( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_WMF; @@ -1286,9 +1286,9 @@ BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectEMF( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectEMF( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_EMF; diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter.vcl/filter/sgfbram.cxx index 3d1a71f5a2db..9b981f8c0d94 100644 --- a/svtools/source/filter.vcl/filter/sgfbram.cxx +++ b/svtools/source/filter.vcl/filter/sgfbram.cxx @@ -75,11 +75,11 @@ SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfHeader::ChkMagic() +sal_Bool SgfHeader::ChkMagic() { return Magic=='J'*256+'J'; } -UINT32 SgfHeader::GetOffset() -{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); } +sal_uInt32 SgfHeader::GetOffset() +{ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); } /************************************************************************* @@ -105,8 +105,8 @@ SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr) return rIStream; } -UINT32 SgfEntry::GetOffset() -{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); } +sal_uInt32 SgfEntry::GetOffset() +{ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); } /************************************************************************* @@ -165,21 +165,21 @@ SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead) return rOStream; } -void BmpFileHeader::SetSize(UINT32 Size) +void BmpFileHeader::SetSize(sal_uInt32 Size) { - SizeLo=UINT16(Size & 0x0000FFFF); - SizeHi=UINT16((Size & 0xFFFF0000)>>16); + SizeLo=sal_uInt16(Size & 0x0000FFFF); + SizeHi=sal_uInt16((Size & 0xFFFF0000)>>16); } -void BmpFileHeader::SetOfs(UINT32 Ofs) +void BmpFileHeader::SetOfs(sal_uInt32 Ofs) { - OfsLo=UINT16(Ofs & 0x0000FFFF); - OfsHi=UINT16((Ofs & 0xFFFF0000)>>16); + OfsLo=sal_uInt16(Ofs & 0x0000FFFF); + OfsHi=sal_uInt16((Ofs & 0xFFFF0000)>>16); } -UINT32 BmpFileHeader::GetOfs() +sal_uInt32 BmpFileHeader::GetOfs() { - return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); + return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); } /************************************************************************* @@ -247,14 +247,14 @@ SvStream& operator<<(SvStream& rOStream, const RGBQuad& rQuad) class PcxExpand { private: - USHORT Count; - BYTE Data; + sal_uInt16 Count; + sal_uInt8 Data; public: PcxExpand() { Count=0; } - BYTE GetByte(SvStream& rInp); + sal_uInt8 GetByte(SvStream& rInp); }; -BYTE PcxExpand::GetByte(SvStream& rInp) +sal_uInt8 PcxExpand::GetByte(SvStream& rInp) { if (Count>0) { Count--; @@ -282,21 +282,21 @@ BYTE PcxExpand::GetByte(SvStream& rInp) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) +sal_Bool SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) { BmpFileHeader aBmpHead; BmpInfoHeader aBmpInfo; - USHORT nWdtInp=(rHead.Xsize+7)/8; // Breite der Input-Bitmap in Bytes - USHORT nWdtOut; // Breite der Output-Bitmap in Bytes - USHORT nColors; // Anzahl der Farben (1,16,256) - USHORT nColBits; // Anzahl der Bits/Pixel (2, 4, 8) - USHORT i,j,k; // Spaltenzaehler, Zeilenzaehler, Planezaehler - USHORT a,b; // Hilfsvariable - BYTE pl1 = 0,pl2= 0; // Masken fuer die Planes - BYTE* pBuf=NULL; // Buffer fuer eine Pixelzeile + sal_uInt16 nWdtInp=(rHead.Xsize+7)/8; // Breite der Input-Bitmap in Bytes + sal_uInt16 nWdtOut; // Breite der Output-Bitmap in Bytes + sal_uInt16 nColors; // Anzahl der Farben (1,16,256) + sal_uInt16 nColBits; // Anzahl der Bits/Pixel (2, 4, 8) + sal_uInt16 i,j,k; // Spaltenzaehler, Zeilenzaehler, Planezaehler + sal_uInt16 a,b; // Hilfsvariable + sal_uInt8 pl1 = 0,pl2= 0; // Masken fuer die Planes + sal_uInt8* pBuf=NULL; // Buffer fuer eine Pixelzeile PcxExpand aPcx; - ULONG nOfs; - BYTE cRGB[4]; + sal_uLong nOfs; + sal_uInt8 cRGB[4]; if (rHead.Planes<=1) nColBits=1; else nColBits=4; if (rHead.Typ==4) nColBits=8; nColors=1<<nColBits; @@ -317,8 +317,8 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) aBmpInfo.yDpmm=0; aBmpInfo.ColUsed=0; aBmpInfo.ColMust=0; - pBuf=new BYTE[nWdtOut]; - if (!pBuf) return FALSE; // Fehler: kein Speichel da + pBuf=new sal_uInt8[nWdtOut]; + if (!pBuf) return sal_False; // Fehler: kein Speichel da rOut<<aBmpHead<<aBmpInfo; memset(pBuf,0,nWdtOut); // Buffer mit Nullen fuellen @@ -335,7 +335,7 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) pBuf[i]=aPcx.GetByte(rInp); } for(i=nWdtInp;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes - rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben! + rOut.Seek(nOfs+((sal_uLong)rHead.Ysize-j-1L)*(sal_uLong)nWdtOut); // rueckwaerts schreiben! rOut.Write((char*)pBuf,nWdtOut); } } else if (nColors==16) { @@ -381,7 +381,7 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) } } for(i=nWdtInp*4;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes - rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben! + rOut.Seek(nOfs+((sal_uLong)rHead.Ysize-j-1L)*(sal_uLong)nWdtOut); // rueckwaerts schreiben! rOut.Write((char*)pBuf,nWdtOut); } } else if (nColors==256) { @@ -401,12 +401,12 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) for(i=0;i<rHead.Xsize;i++) pBuf[i]=aPcx.GetByte(rInp); for(i=rHead.Xsize;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes - rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben! + rOut.Seek(nOfs+((sal_uLong)rHead.Ysize-j-1L)*(sal_uLong)nWdtOut); // rueckwaerts schreiben! rOut.Write((char*)pBuf,nWdtOut); } } delete[] pBuf; - return TRUE; + return sal_True; } @@ -419,14 +419,14 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut) +sal_Bool SgfBMapFilter(SvStream& rInp, SvStream& rOut) { - ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. + sal_uLong nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. SgfHeader aHead; SgfEntry aEntr; - ULONG nNext; - BOOL bRdFlag=FALSE; // Grafikentry gelesen ? - BOOL bRet=FALSE; // Returncode + sal_uLong nNext; + sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ? + sal_Bool bRet=sal_False; // Returncode nFileStart=rInp.Tell(); rInp>>aHead; @@ -438,7 +438,7 @@ BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut) rInp>>aEntr; nNext=aEntr.GetOffset(); if (aEntr.Typ==aHead.Typ) { - bRdFlag=TRUE; + bRdFlag=sal_True; switch(aEntr.Typ) { case SgfBitImag0: case SgfBitImag1: @@ -448,7 +448,7 @@ BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut) } } // while(nNext) } - if (rInp.GetError()) bRet=FALSE; + if (rInp.GetError()) bRet=sal_False; return(bRet); } @@ -464,15 +464,15 @@ long SgfVectXmul=0; long SgfVectYmul=0; long SgfVectXdiv=0; long SgfVectYdiv=0; -BOOL SgfVectScal=FALSE; +sal_Bool SgfVectScal=sal_False; //////////////////////////////////////////////////////////// // Hpgl2SvFarbe //////////////////////////////////////////// //////////////////////////////////////////////////////////// -Color Hpgl2SvFarbe( BYTE nFarb ) +Color Hpgl2SvFarbe( sal_uInt8 nFarb ) { - ULONG nColor = COL_BLACK; + sal_uLong nColor = COL_BLACK; switch (nFarb & 0x07) { case 0: nColor=COL_WHITE; break; @@ -497,20 +497,20 @@ Color Hpgl2SvFarbe( BYTE nFarb ) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf) +sal_Bool SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf) { VirtualDevice aOutDev; SgfVector aVect; - BYTE nFarb; - BYTE nFrb0=7; - BYTE nLTyp; - BYTE nOTyp; - BOOL bEoDt=FALSE; - BOOL bPDwn=FALSE; + sal_uInt8 nFarb; + sal_uInt8 nFrb0=7; + sal_uInt8 nLTyp; + sal_uInt8 nOTyp; + sal_Bool bEoDt=sal_False; + sal_Bool bPDwn=sal_False; Point aP0(0,0); Point aP1(0,0); String Msg; - USHORT RecNr=0; + sal_uInt16 RecNr=0; rMtf.Record(&aOutDev); aOutDev.SetLineColor(Color(COL_BLACK)); @@ -518,9 +518,9 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt while (!bEoDt && !rInp.GetError()) { rInp>>aVect; RecNr++; - nFarb=(BYTE) (aVect.Flag & 0x000F); - nLTyp=(BYTE)((aVect.Flag & 0x00F0) >>4); - nOTyp=(BYTE)((aVect.Flag & 0x0F00) >>8); + nFarb=(sal_uInt8) (aVect.Flag & 0x000F); + nLTyp=(sal_uInt8)((aVect.Flag & 0x00F0) >>4); + nOTyp=(sal_uInt8)((aVect.Flag & 0x0F00) >>8); bEoDt=(aVect.Flag & 0x4000) !=0; bPDwn=(aVect.Flag & 0x8000) !=0; @@ -561,7 +561,7 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt Fraction( 1, 4 ), Fraction( 1, 4 ) ); rMtf.SetPrefMapMode( aMap ); rMtf.SetPrefSize( Size( (short)rHead.Xsize, (short)rHead.Ysize ) ); - return TRUE; + return sal_True; } @@ -574,14 +574,14 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf) +sal_Bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf) { - ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. + sal_uLong nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. SgfHeader aHead; SgfEntry aEntr; - ULONG nNext; - BOOL bRdFlag=FALSE; // Grafikentry gelesen ? - BOOL bRet=FALSE; // Returncode + sal_uLong nNext; + sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ? + sal_Bool bRet=sal_False; // Returncode nFileStart=rInp.Tell(); rInp>>aHead; @@ -596,7 +596,7 @@ BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf) } } // while(nNext) if (bRdFlag) { - if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok + if (!rInp.GetError()) bRet=sal_True; // Scheinbar Ok } } return(bRet); @@ -612,9 +612,9 @@ BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&) +sal_Bool SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&) { - return FALSE; // PostSrcipt wird noch nicht unterstuetzt ! + return sal_False; // PostSrcipt wird noch nicht unterstuetzt ! } @@ -627,7 +627,7 @@ BOOL SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion) +sal_uInt8 CheckSgfTyp(SvStream& rInp, sal_uInt16& nVersion) { #if OSL_DEBUG_LEVEL > 1 // Recordgroessen checken. Neuer Compiler hat vielleichte anderes Allignment! if (sizeof(SgfHeader)!=SgfHeaderSize || @@ -638,7 +638,7 @@ BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion) sizeof(RGBQuad )!=RGBQuadSize ) return SGF_DONTKNOW; #endif - ULONG nPos; + sal_uLong nPos; SgfHeader aHead; nVersion=0; nPos=rInp.Tell(); diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter.vcl/filter/sgvmain.cxx index 293c6dab7964..3b0f3ebd2912 100644 --- a/svtools/source/filter.vcl/filter/sgvmain.cxx +++ b/svtools/source/filter.vcl/filter/sgvmain.cxx @@ -58,7 +58,7 @@ p.Paper.RandO =SWAPSHORT(p.Paper.RandO ); \ p.Paper.RandU =SWAPSHORT(p.Paper.RandU ); \ SWAPPOINT(p.U); \ - UINT16 iTemp; \ + sal_uInt16 iTemp; \ for (iTemp=0;iTemp<20;iTemp++) { \ rPage.HlpLnH[iTemp]=SWAPSHORT(rPage.HlpLnH[iTemp]); \ rPage.HlpLnV[iTemp]=SWAPSHORT(rPage.HlpLnV[iTemp]); }} @@ -118,41 +118,41 @@ SgfFontLst* pSgfFonts = 0; //////////////////////////////////////////////////////////////////////////////////////////////////// // Fuer Kreisunterarten, Text und gedrehte Rechtecke /////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// -void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs) +void RotatePoint(PointType& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs) { - INT16 dx,dy; + sal_Int16 dx,dy; double x1,y1; dx=P.x-cx; dy=P.y-cy; x1=dx*cs-dy*sn; y1=dy*cs+dx*sn; - P.x=cx+INT16(x1); - P.y=cy+INT16(y1); + P.x=cx+sal_Int16(x1); + P.y=cy+sal_Int16(y1); } -void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs) +void RotatePoint(Point& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs) { - INT16 dx,dy; + sal_Int16 dx,dy; double x1,y1; - dx=(INT16)(P.X()-cx); - dy=(INT16)(P.Y()-cy); + dx=(sal_Int16)(P.X()-cx); + dy=(sal_Int16)(P.Y()-cy); x1=dx*cs-dy*sn; y1=dy*cs+dx*sn; - P=Point(cx+INT16(x1),cy+INT16(y1)); + P=Point(cx+sal_Int16(x1),cy+sal_Int16(y1)); } -INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div) +sal_Int16 iMulDiv(sal_Int16 a, sal_Int16 Mul, sal_Int16 Div) { - INT32 Temp; - Temp=INT32(a)*INT32(Mul)/INT32(Div); - return INT16(Temp); + sal_Int32 Temp; + Temp=sal_Int32(a)*sal_Int32(Mul)/sal_Int32(Div); + return sal_Int16(Temp); } -UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div) +sal_uInt16 MulDiv(sal_uInt16 a, sal_uInt16 Mul, sal_uInt16 Div) { - UINT32 Temp; - Temp=UINT32(a)*UINT32(Mul)/UINT32(Div); - return UINT16(Temp); + sal_uInt32 Temp; + Temp=sal_uInt32(a)*sal_uInt32(Mul)/sal_uInt32(Div); + return sal_uInt16(Temp); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -167,10 +167,10 @@ SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd) void DtHdOverSeek(SvStream& rInp) { - ULONG FPos=rInp.Tell(); - FPos+=(ULONG)DtHdSize; + sal_uLong FPos=rInp.Tell(); + FPos+=(sal_uLong)DtHdSize; rInp.Seek(FPos); -// rInp.seekg(rInp.tellg()+(ULONG)DtHdSize); +// rInp.seekg(rInp.tellg()+(sal_uLong)DtHdSize); } @@ -185,21 +185,21 @@ SvStream& operator>>(SvStream& rIStream, PageType& rPage) void ObjkOverSeek(SvStream& rInp, ObjkType& rObjk) { - ULONG Siz; - Siz=(ULONG)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize + sal_uLong Siz; + Siz=(sal_uLong)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize rInp.Seek(rInp.Tell()+Siz); } SvStream& operator>>(SvStream& rInp, ObjkType& rObjk) { // Die Fileposition im Stream bleibt unveraendert! - ULONG nPos; + sal_uLong nPos; nPos=rInp.Tell(); rInp.Read((char*)&rObjk.Last,ObjkSize); #if defined OSL_BIGENDIAN SWAPOBJK(rObjk); #endif #ifdef InArbeit - ULONG nPos1=rInp.Tell(); + sal_uLong nPos1=rInp.Tell(); if(nPos == nPos1) InfoBox( NULL, "tellg funkt nich" ).Execute(); #endif rInp.Seek(nPos); @@ -331,10 +331,10 @@ SvStream& operator>>(SvStream& rInp, GrupType& rGrup) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts) +Color Sgv2SvFarbe(sal_uInt8 nFrb1, sal_uInt8 nFrb2, sal_uInt8 nInts) { - UINT16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0; - BYTE nInt2=100-nInts; + sal_uInt16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0; + sal_uInt8 nInt2=100-nInts; switch(nFrb1 & 0x07) { case 0: r1=0xFF; g1=0xFF; b1=0xFF; break; case 1: r1=0xFF; g1=0xFF; break; @@ -355,9 +355,9 @@ Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts) case 6: b2=0xFF; break; case 7: break; } - r1=(UINT16)((UINT32)r1*nInts/100+(UINT32)r2*nInt2/100); - g1=(UINT16)((UINT32)g1*nInts/100+(UINT32)g2*nInt2/100); - b1=(UINT16)((UINT32)b1*nInts/100+(UINT32)b2*nInt2/100); + r1=(sal_uInt16)((sal_uInt32)r1*nInts/100+(sal_uInt32)r2*nInt2/100); + g1=(sal_uInt16)((sal_uInt32)g1*nInts/100+(sal_uInt32)g2*nInt2/100); + b1=(sal_uInt16)((sal_uInt32)b1*nInts/100+(sal_uInt32)b2*nInt2/100); Color aColor( (sal_uInt8)r1, (sal_uInt8)g1, (sal_uInt8)b1 ); return aColor; } @@ -458,7 +458,7 @@ void StrkType::Draw(OutputDevice& rOut) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDevice& rOut) +void SgfAreaColorIntens(sal_uInt16 Muster, sal_uInt8 Col1, sal_uInt8 Col2, sal_uInt8 Int, OutputDevice& rOut) { ObjAreaType F; F.FMuster=Muster; @@ -468,15 +468,15 @@ void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDev SetArea(F,rOut); } -void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, OutputDevice& rOut) +void DrawSlideRect(sal_Int16 x1, sal_Int16 y1, sal_Int16 x2, sal_Int16 y2, ObjAreaType& F, OutputDevice& rOut) { - INT16 i,i0,b,b0; - INT16 Int1,Int2; - INT16 Col1,Col2; + sal_Int16 i,i0,b,b0; + sal_Int16 Int1,Int2; + sal_Int16 Col1,Col2; // ClipMerk: HgdClipRec; - INT16 cx,cy; - INT16 MaxR; - INT32 dx,dy; + sal_Int16 cx,cy; + sal_Int16 MaxR; + sal_Int32 dx,dy; rOut.SetLineColor(); if (x1>x2) { i=x1; x1=x2; x2=i; } @@ -484,7 +484,7 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87; Int1=100-F.FIntens; Int2=F.FIntens; if (Int1==Int2) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.DrawRect(Rectangle(x1,y1,x2,y2)); } else { b0=Int1; @@ -493,30 +493,30 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu i0=y1; i=y1; while (i<=y2) { - b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1)); + b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.DrawRect(Rectangle(x1,i0,x2,i-1)); i0=i; b0=b; } i++; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.DrawRect(Rectangle(x1,i0,x2,y2)); } break; case 0x28: { // horizontal i0=x1; i=x1; while (i<=x2) { - b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1)); + b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.DrawRect(Rectangle(i0,y1,i-1,y2)); i0=i; b0=b; } i++; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.DrawRect(Rectangle(i0,y1,x2,y2)); } break; @@ -530,14 +530,14 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu dx=x2-x1+1; dy=y2-y1+1; a=sqrt((double)(dx*dx+dy*dy)); - MaxR=INT16(a) /2 +1; + MaxR=sal_Int16(a) /2 +1; b0=Int2; i0=MaxR; if (MaxR<1) MaxR=1; i=MaxR; while (i>=0) { - b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR)); + b=Int1+sal_Int16((sal_Int32(Int2-Int1)*sal_Int32(i)) /sal_Int32(MaxR)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); //if (i0>200 || (Col1 & $80)!=0 || (Col2 & $80)!=0) { // then begin { Fallunterscheidung fuer etwas bessere Performance } // s2:=i0-i+2; @@ -550,7 +550,7 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu } i--; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int1,rOut); rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0)); rOut.SetClipRegion(ClipMerk); } break; // Kreis @@ -577,7 +577,7 @@ void RectType::Draw(OutputDevice& rOut) } } else { Point aPts[4]; - USHORT i; + sal_uInt16 i; double sn,cs; sn=sin(double(DrehWink)*3.14159265359/18000); cs=cos(double(DrehWink)*3.14159265359/18000); @@ -608,7 +608,7 @@ void PolyType::Draw(OutputDevice& rOut) if ((Flags & PolyClosBit) !=0) SetArea(F,rOut); SetLine(L,rOut); Polygon aPoly(nPoints); - USHORT i; + sal_uInt16 i; for(i=0;i<nPoints;i++) aPoly.SetPoint(Point(EckP[i].x,EckP[i].y),i); if ((Flags & PolyClosBit) !=0) { rOut.DrawPolygon(aPoly); @@ -632,13 +632,13 @@ void SplnType::Draw(OutputDevice& rOut) SetLine(L,rOut); Polygon aPoly(0); Polygon aSpln(nPoints); - USHORT i; + sal_uInt16 i; for(i=0;i<nPoints;i++) aSpln.SetPoint(Point(EckP[i].x,EckP[i].y),i); if ((Flags & PolyClosBit) !=0) { - Spline2Poly(aSpln,TRUE,aPoly); + Spline2Poly(aSpln,sal_True,aPoly); if (aPoly.GetSize()>0) rOut.DrawPolygon(aPoly); } else { - Spline2Poly(aSpln,FALSE,aPoly); + Spline2Poly(aSpln,sal_False,aPoly); if (aPoly.GetSize()>0) rOut.DrawPolyLine(aPoly); } } @@ -652,22 +652,22 @@ void SplnType::Draw(OutputDevice& rOut) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, OutputDevice& rOut) +void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAreaType& F, OutputDevice& rOut) { - INT16 x1=cx-rx; - INT16 y1=cy-ry; - INT16 x2=cx+rx; - INT16 y2=cy+ry; + sal_Int16 x1=cx-rx; + sal_Int16 y1=cy-ry; + sal_Int16 x2=cx+rx; + sal_Int16 y2=cy+ry; - INT16 i,i0,b,b0; - INT16 Int1,Int2; - INT16 Col1,Col2; + sal_Int16 i,i0,b,b0; + sal_Int16 Int1,Int2; + sal_Int16 Col1,Col2; rOut.SetLineColor(); Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87; Int1=100-F.FIntens; Int2=F.FIntens; if (Int1==Int2) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); } else { b0=Int1; @@ -677,16 +677,16 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu i0=y1; i=y1; while (i<=y2) { - b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1)); + b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.SetClipRegion(Rectangle(x1,i0,x2,i-1)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); i0=i; b0=b; } i++; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.SetClipRegion(Rectangle(x1,i0,x2,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.SetClipRegion(ClipMerk); @@ -696,23 +696,23 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu i0=x1; i=x1; while (i<=x2) { - b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1)); + b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.SetClipRegion(Rectangle(i0,y1,i-1,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); i0=i; b0=b; } i++; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.SetClipRegion(Rectangle(i0,y1,x2,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.SetClipRegion(ClipMerk); } break; case 0x18: case 0x38: { // Kreis - INT16 MaxR; + sal_Int16 MaxR; if (rx<1) rx=1; if (ry<1) ry=1; @@ -721,17 +721,17 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu i0=MaxR; if (MaxR<1) MaxR=1; i=MaxR; while (i>=0) { - b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR)); + b=Int1+sal_Int16((sal_Int32(Int2-Int1)*sal_Int32(i)) /sal_Int32(MaxR)); if (b!=b0) { - INT32 temp=INT32(i0)*INT32(ry)/INT32(rx); - INT16 j0=INT16(temp); - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + sal_Int32 temp=sal_Int32(i0)*sal_Int32(ry)/sal_Int32(rx); + sal_Int16 j0=sal_Int16(temp); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.DrawEllipse(Rectangle(cx-i0,cy-j0,cx+i0,cy+j0)); i0=i; b0=b; } i--; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int1,rOut); rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0)); } break; // Kreis } @@ -804,7 +804,7 @@ void BmapType::Draw(OutputDevice& rOut) { //ifstream aInp; unsigned char nSgfTyp; - USHORT nVersion; + sal_uInt16 nVersion; String aStr( reinterpret_cast< char const * >(&Filename[ 1 ]), (xub_StrLen)Filename[ 0 ], RTL_TEXTENCODING_UTF8 ); @@ -818,7 +818,7 @@ void BmapType::Draw(OutputDevice& rOut) case SGF_BITIMAGE: { GraphicFilter aFlt; Graphic aGrf; - USHORT nRet; + sal_uInt16 nRet; nRet=aFlt.ImportGraphic(aGrf,aFNam); aGrf.Draw(&rOut,Point(Pos1.x,Pos1.y),Size(Pos2.x-Pos1.x,Pos2.y-Pos1.y)); } break; @@ -830,7 +830,7 @@ void BmapType::Draw(OutputDevice& rOut) SgfVectYmul=Pos2.y-Pos1.y; SgfVectXdiv=0; SgfVectYdiv=0; - SgfVectScal=TRUE; + SgfVectScal=sal_True; SgfVectFilter(*pInp,aMtf); SgfVectXofs=0; SgfVectYofs=0; @@ -838,7 +838,7 @@ void BmapType::Draw(OutputDevice& rOut) SgfVectYmul=0; SgfVectXdiv=0; SgfVectYdiv=0; - SgfVectScal=FALSE; + SgfVectScal=sal_False; aMtf.Play(&rOut); } break; } @@ -856,9 +856,9 @@ void BmapType::Draw(OutputDevice& rOut) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -UINT32 GrupType::GetSubPtr() +sal_uInt32 GrupType::GetSubPtr() { - return UINT32(SbLo)+0x00010000*UINT32(SbHi); + return sal_uInt32(SbLo)+0x00010000*sal_uInt32(SbHi); } /************************************************************************* @@ -873,8 +873,8 @@ UINT32 GrupType::GetSubPtr() void DrawObjkList( SvStream& rInp, OutputDevice& rOut ) { ObjkType aObjk; - USHORT nGrpCnt=0; - BOOL bEnde=FALSE; + sal_uInt16 nGrpCnt=0; + sal_Bool bEnde=sal_False; do { rInp>>aObjk; if (!rInp.GetError()) { @@ -941,11 +941,11 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut ) } // if rInp if (!rInp.GetError()) { if (aObjk.Next==0L) { - if (nGrpCnt==0) bEnde=TRUE; + if (nGrpCnt==0) bEnde=sal_True; else nGrpCnt--; } } else { - bEnde=TRUE; // Lesefehler + bEnde=sal_True; // Lesefehler } } while (!bEnde); } @@ -985,15 +985,15 @@ void SkipObjkList(SvStream& rInp) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) +sal_Bool SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; PageType aPage; VirtualDevice aOutDev; OutputDevice* pOutDev; - ULONG nStdPos; - ULONG nZchPos; - USHORT Num; + sal_uLong nStdPos; + sal_uLong nZchPos; + sal_uInt16 Num; pOutDev=&aOutDev; DtHdOverSeek(rInp); // DataHeader weglesen @@ -1029,8 +1029,8 @@ BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) rMtf.WindStart(); MapMode aMap(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4)); rMtf.SetPrefMapMode(aMap); - rMtf.SetPrefSize(Size((INT16)aPage.Paper.Size.x,(INT16)aPage.Paper.Size.y)); - bRet=TRUE; + rMtf.SetPrefSize(Size((sal_Int16)aPage.Paper.Size.x,(sal_Int16)aPage.Paper.Size.y)); + bRet=sal_True; return bRet; } @@ -1045,18 +1045,18 @@ BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ) +sal_Bool SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ) { #if OSL_DEBUG_LEVEL > 1 // Recordgroessen checken. Neuer Compiler hat vielleichte anderes Alignment! - if (sizeof(ObjTextType)!=ObjTextTypeSize) return FALSE; + if (sizeof(ObjTextType)!=ObjTextTypeSize) return sal_False; #endif - ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. + sal_uLong nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. SgfHeader aHead; SgfEntry aEntr; - ULONG nNext; - BOOL bRdFlag=FALSE; // Grafikentry gelesen ? - BOOL bRet=FALSE; // Returncode + sal_uLong nNext; + sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ? + sal_Bool bRet=sal_False; // Returncode aIniPath.Append( String::CreateFromAscii( "sgf.ini", 7 ) ); // aIniPath.ToAbs(); @@ -1077,7 +1077,7 @@ BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ) } } // while(nNext) if (bRdFlag) { - if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok + if (!rInp.GetError()) bRet=sal_True; // Scheinbar Ok } } delete pSgfFonts; @@ -1085,7 +1085,7 @@ BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ) } /* -Bitmap Dither(BYTE Intens) +Bitmap Dither(sal_uInt8 Intens) { Bitmap aBmp; BmpInfoHeader Info; diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter.vcl/filter/sgvspln.cxx index d695e171a194..aac7e1f04e0a 100644 --- a/svtools/source/filter.vcl/filter/sgvspln.cxx +++ b/svtools/source/filter.vcl/filter/sgvspln.cxx @@ -140,10 +140,6 @@ short basis() /* BASIS maschinenunabhaengig bestimmen */ #define NEGMAX -POSMIN /* groesste negative Zahl */ #define NEGMIN -POSMAX /* kleinste negative Zahl */ -#define TRUE 1 -#define FALSE 0 - - /* Definition von Funktionsmakros: */ @@ -170,7 +166,7 @@ short basis() /* BASIS maschinenunabhaengig bestimmen */ /*---------------------- MODUL TRIDIAGONAL ------------------------*/ -USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, +sal_uInt16 TriDiagGS(sal_Bool rep, sal_uInt16 n, double* lower, double* diag, double* upper, double* b) /************************/ /* GAUSS-Verfahren fuer */ @@ -207,7 +203,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, /* */ /* Eingabeparameter: */ /* ================ */ -/* n Dimension der Matrix ( > 1 ) USHORT n */ +/* n Dimension der Matrix ( > 1 ) sal_uInt16 n */ /* */ /* lower untere Nebendiagonale double lower[n] */ /* diag Hauptdiagonale double diag[n] */ @@ -217,7 +213,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, /* Dreieckzerlegung der Ausgangsmatrix. */ /* */ /* b rechte Seite des Systems double b[n] */ -/* rep = 0 erstmaliger Aufruf BOOL rep */ +/* rep = 0 erstmaliger Aufruf sal_Bool rep */ /* !=0 wiederholter Aufruf */ /* fuer gleiche Matrix, */ /* aber verschiedenes b. */ @@ -251,7 +247,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, /*.cp 5 */ { - USHORT i; + sal_uInt16 i; short j; // double fabs(double); @@ -302,7 +298,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, /*---------------- MODUL ZYKLISCH TRIDIAGONAL ----------------------*/ -USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag, +sal_uInt16 ZyklTriDiagGS(sal_Bool rep, sal_uInt16 n, double* lower, double* diag, double* upper, double* lowrow, double* ricol, double* b) /******************************/ /* Systeme mit zyklisch tri- */ @@ -343,12 +339,12 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag, /* */ /* Eingabeparameter: */ /* ================ */ -/* n Dimension der Matrix ( > 2 ) USHORT n */ +/* n Dimension der Matrix ( > 2 ) sal_uInt16 n */ /* lower untere Nebendiagonale double lower[n] */ /* diag Hauptdiagonale double diag[n] */ /* upper obere Nebendiagonale double upper[n] */ /* b rechte Seite des Systems double b[n] */ -/* rep = 0 erstmaliger Aufruf BOOL rep */ +/* rep = 0 erstmaliger Aufruf sal_Bool rep */ /* !=0 wiederholter Aufruf */ /* fuer gleiche Matrix, */ /* aber verschiedenes b. */ @@ -385,7 +381,7 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag, /*.cp 5 */ { double temp; // fabs(double); - USHORT i; + sal_uInt16 i; short j; if ( n < 3 ) return(1); @@ -458,15 +454,15 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag, |* *************************************************************************/ -USHORT NaturalSpline(USHORT n, double* x, double* y, +sal_uInt16 NaturalSpline(sal_uInt16 n, double* x, double* y, double Marg0, double MargN, - BYTE MargCond, + sal_uInt8 MargCond, double* b, double* c, double* d) { - USHORT i; + sal_uInt16 i; double* a; double* h; - USHORT error; + sal_uInt16 error; if (n<2) return 1; if ( (MargCond & ~3) ) return 2; @@ -516,7 +512,7 @@ USHORT NaturalSpline(USHORT n, double* x, double* y, if (n==2) { c[1]=a[0]/d[0]; } else { - error=TriDiagGS(FALSE,n-1,b,d,c,a); + error=TriDiagGS(sal_False,n-1,b,d,c,a); if (error!=0) { delete[] a; delete[] h; return error+2; } for (i=0;i<n-1;i++) c[i+1]=a[i]; } @@ -567,11 +563,11 @@ USHORT NaturalSpline(USHORT n, double* x, double* y, *************************************************************************/ -USHORT PeriodicSpline(USHORT n, double* x, double* y, +sal_uInt16 PeriodicSpline(sal_uInt16 n, double* x, double* y, double* b, double* c, double* d) { // Arrays muessen von [0..n] dimensioniert sein! - USHORT Error; - USHORT i,im1,nm1; //integer + sal_uInt16 Error; + sal_uInt16 i,im1,nm1; //integer double hr,hl; double* a; double* lowrow; @@ -608,7 +604,7 @@ USHORT PeriodicSpline(USHORT n, double* x, double* y, lowrow[0]=hr; ricol[0]=hr; a[nm1]=3.0*((y[1]-y[0])/hr-(y[n]-y[nm1])/hl); - Error=ZyklTriDiagGS(FALSE,n,b,d,c,lowrow,ricol,a); + Error=ZyklTriDiagGS(sal_False,n,b,d,c,lowrow,ricol,a); if ( Error != 0 ) { delete[] a; @@ -645,22 +641,22 @@ USHORT PeriodicSpline(USHORT n, double* x, double* y, |* *************************************************************************/ -USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond, +sal_uInt16 ParaSpline(sal_uInt16 n, double* x, double* y, sal_uInt8 MargCond, double Marg01, double Marg02, double MargN1, double MargN2, - BOOL CondT, double* T, + sal_Bool CondT, double* T, double* bx, double* cx, double* dx, double* by, double* cy, double* dy) { - USHORT Error,Marg; - USHORT i; + sal_uInt16 Error,Marg; + sal_uInt16 i; double deltX,deltY,delt, alphX = 0,alphY = 0, betX = 0,betY = 0; if (n<2) return 1; if ((MargCond & ~3) && (MargCond != 4)) return 2; // ungueltige Randbedingung - if (CondT==FALSE) { + if (CondT==sal_False) { T[0]=0.0; for (i=0;i<n;i++) { deltX=x[i+1]-x[i]; deltY=y[i+1]-y[i]; @@ -724,7 +720,7 @@ USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond, |* Polygons werden als Stuetzstellen angenommen. |* n liefert die Anzahl der Teilpolynome. |* Ist die Berechnung fehlerfrei verlaufen, so -|* liefert die Funktion TRUE. Nur in diesem Fall +|* liefert die Funktion sal_True. Nur in diesem Fall |* ist Speicher fuer die Koeffizientenarrays |* allokiert, der dann spaeter vom Aufrufer mittels |* delete freizugeben ist. @@ -733,14 +729,14 @@ USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond, |* *************************************************************************/ -BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, +sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n, double*& ax, double*& ay, double*& bx, double*& by, double*& cx, double*& cy, double*& dx, double*& dy, double*& T) { - BYTE Marg; + sal_uInt8 Marg; double Marg01,Marg02; double MargN1,MargN2; - USHORT i; + sal_uInt16 i; Point P0(-32768,-32768); Point Pt; @@ -782,12 +778,12 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, MargN2=0.0; if (n>0) n--; // n Korregieren (Anzahl der Teilpolynome) - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( ( Marg == 3 && n >= 3 ) || ( Marg == 2 && n >= 2 ) ) { - bRet = ParaSpline(n,ax,ay,Marg,Marg01,Marg01,MargN1,MargN2,FALSE,T,bx,cx,dx,by,cy,dy) == 0; + bRet = ParaSpline(n,ax,ay,Marg,Marg01,Marg01,MargN1,MargN2,sal_False,T,bx,cx,dx,by,cy,dy) == 0; } - if ( bRet == FALSE ) + if ( bRet == sal_False ) { delete[] ax; delete[] ay; @@ -811,7 +807,7 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, |* Beschreibung Konvertiert einen parametrichen kubischen |* Polynomspline Spline (natuerlich oder periodisch) |* in ein angenaehertes Polygon. -|* Die Funktion liefert FALSE, wenn ein Fehler bei +|* Die Funktion liefert sal_False, wenn ein Fehler bei |* der Koeffizientenberechnung aufgetreten ist oder |* das Polygon zu gross wird (>PolyMax=16380). Im 1. |* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte. @@ -821,7 +817,7 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) +sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly) { short MinKoord=-32000; // zur Vermeidung short MaxKoord=32000; // von Ueberlaeufen @@ -839,11 +835,11 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) double Step; // Schrittweite fuer t double dt1,dt2,dt3; // Delta t, y, ^3 double t; - BOOL bEnde; // Teilpolynom zu Ende? - USHORT n; // Anzahl der zu zeichnenden Teilpolynome - USHORT i; // aktuelles Teilpolynom - BOOL bOk; // noch alles ok? - USHORT PolyMax=16380;// Maximale Anzahl von Polygonpunkten + sal_Bool bEnde; // Teilpolynom zu Ende? + sal_uInt16 n; // Anzahl der zu zeichnenden Teilpolynome + sal_uInt16 i; // aktuelles Teilpolynom + sal_Bool bOk; // noch alles ok? + sal_uInt16 PolyMax=16380;// Maximale Anzahl von Polygonpunkten long x,y; bOk=CalcSpline(rSpln,Periodic,n,ax,ay,bx,by,cx,cy,dx,dy,tv); @@ -855,7 +851,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) i=0; while (i<n) { // n Teilpolynome malen t=tv[i]+Step; - bEnde=FALSE; + bEnde=sal_False; while (!bEnde) { // ein Teilpolynom interpolieren bEnde=t>=tv[i+1]; if (bEnde) t=tv[i+1]; @@ -868,7 +864,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) rPoly.SetSize(rPoly.GetSize()+1); rPoly.SetPoint(Point(short(x),short(y)),rPoly.GetSize()-1); } else { - bOk=FALSE; // Fehler: Polygon wird zu gross + bOk=sal_False; // Fehler: Polygon wird zu gross } t=t+Step; } // Ende von Teilpolynom @@ -886,5 +882,5 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) return bOk; } // Ende von if (bOk) rPoly.SetSize(0); - return FALSE; + return sal_False; } diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter.vcl/filter/sgvtext.cxx index 9a82cd486599..f0130b21c9d6 100644 --- a/svtools/source/filter.vcl/filter/sgvtext.cxx +++ b/svtools/source/filter.vcl/filter/sgvtext.cxx @@ -213,9 +213,9 @@ extern SgfFontLst* pSgfFonts; ///////////////////////////////////////////////////////////////////////////////// -BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L); +sal_Bool CheckTextOutl(ObjAreaType& F, ObjLineType& L); -BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L) +sal_Bool CheckTextOutl(ObjAreaType& F, ObjLineType& L) { return (F.FIntens!=L.LIntens) || ((F.FFarbe!=L.LFarbe) && (F.FIntens>0)) || @@ -261,11 +261,11 @@ short Sgf2hPoint(short a) // Unterkante berechnen. Alles in SGF-Units. // ====================================================================== -USHORT GetTopToBaseLine(USHORT MaxGrad) +sal_uInt16 GetTopToBaseLine(sal_uInt16 MaxGrad) { long ret; ret=long(MaxGrad)*long(CharTopToBase) /long(100); - return USHORT(ret); + return sal_uInt16(ret); } // ====================================================================== @@ -306,9 +306,9 @@ UCHAR ConvertTextChar(UCHAR c) -USHORT GetSchnittBit(UCHAR c) +sal_uInt16 GetSchnittBit(UCHAR c) { - USHORT r=0; + sal_uInt16 r=0; switch (c) { case EscBold : r=TextBoldBit; break; case EscRSlnt: r=TextRSlnBit; break; @@ -349,10 +349,10 @@ long ChgValue(long Def, long Min, long Max, UCHAR FlgVal, long NumVal) -void ChgSchnittBit(USHORT Bit, USHORT Radio1, USHORT Radio2, USHORT Radio3, - UCHAR FlgVal, USHORT Schnitt0, USHORT& Schnitt) +void ChgSchnittBit(sal_uInt16 Bit, sal_uInt16 Radio1, sal_uInt16 Radio2, sal_uInt16 Radio3, + UCHAR FlgVal, sal_uInt16 Schnitt0, sal_uInt16& Schnitt) { - USHORT All,Rad; + sal_uInt16 All,Rad; Rad=Radio1 | Radio2 | Radio3; All=Bit | Rad; @@ -367,9 +367,9 @@ void ChgSchnittBit(USHORT Bit, USHORT Radio1, USHORT Radio2, USHORT Radio3, -UCHAR GetNextChar(UCHAR* TBuf, USHORT Index) +UCHAR GetNextChar(UCHAR* TBuf, sal_uInt16 Index) { - USHORT Cnt; + sal_uInt16 Cnt; while (TBuf[Index]==Escape) { Index++; Cnt=0; @@ -382,24 +382,24 @@ UCHAR GetNextChar(UCHAR* TBuf, USHORT Index) -UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index, +UCHAR ProcessOne(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr, - BOOL ScanEsc) + sal_Bool ScanEsc) { UCHAR c; UCHAR Ident; - BOOL Ende; - BOOL q; + sal_Bool Ende; + sal_Bool q; UCHAR FlgVal; long NumVal; long Sgn; short i; - BOOL EoVal; + sal_Bool EoVal; do { c=TBuf[Index]; Index++; Ende=(c!=Escape); - if (Ende==FALSE) { + if (Ende==sal_False) { c=TBuf[Index]; Index++; Ident=c; // Identifer merken FlgVal=EscNoFlg; @@ -413,36 +413,36 @@ UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index, do { NumVal=10*NumVal+c-'0'; EoVal=(TBuf[Index]<'0' || TBuf[Index]>'9'); - if (EoVal==FALSE) { c=TBuf[Index]; Index++; } + if (EoVal==sal_False) { c=TBuf[Index]; Index++; } i--; - } while (i>0 && EoVal==FALSE); + } while (i>0 && EoVal==sal_False); NumVal=Sgn*NumVal; } q=!CheckTextOutl(AktAtr.F,AktAtr.L); switch (Ident) { - case EscFont : AktAtr.SetFont(ULONG (ChgValue(Atr0.GetFont(),0,0 ,FlgVal,NumVal)));break; - case EscGrad : AktAtr.Grad =USHORT(ChgValue(Atr0.Grad, 2,2000 ,FlgVal,NumVal)); break; - case EscBreit: AktAtr.Breite =USHORT(ChgValue(Atr0.Breite, 1,1000 ,FlgVal,NumVal)); break; - case EscKaptS: AktAtr.Kapit =(BYTE)(ChgValue(Atr0.Kapit, 1,255 ,FlgVal,NumVal)); break; - case EscLFeed: AktAtr.LnFeed =USHORT(ChgValue(Atr0.LnFeed, 1,65535 ,FlgVal,NumVal)); break; - case EscSlant: AktAtr.Slant =USHORT(ChgValue(Atr0.Slant, 1,MaxCharSlant ,FlgVal,NumVal)); break; + case EscFont : AktAtr.SetFont(sal_uLong (ChgValue(Atr0.GetFont(),0,0 ,FlgVal,NumVal)));break; + case EscGrad : AktAtr.Grad =sal_uInt16(ChgValue(Atr0.Grad, 2,2000 ,FlgVal,NumVal)); break; + case EscBreit: AktAtr.Breite =sal_uInt16(ChgValue(Atr0.Breite, 1,1000 ,FlgVal,NumVal)); break; + case EscKaptS: AktAtr.Kapit =(sal_uInt8)(ChgValue(Atr0.Kapit, 1,255 ,FlgVal,NumVal)); break; + case EscLFeed: AktAtr.LnFeed =sal_uInt16(ChgValue(Atr0.LnFeed, 1,65535 ,FlgVal,NumVal)); break; + case EscSlant: AktAtr.Slant =sal_uInt16(ChgValue(Atr0.Slant, 1,MaxCharSlant ,FlgVal,NumVal)); break; case EscVPos : AktAtr.ChrVPos=char (ChgValue(Atr0.ChrVPos,-128,127 ,FlgVal,NumVal)); break; - case EscZAbst: AktAtr.ZAbst =(BYTE)(ChgValue(Atr0.ZAbst, 1,255 ,FlgVal,NumVal)); break; - case EscHJust: AktAtr.Justify=(BYTE)(ChgValue(Atr0.Justify & 0x0F,0,5 ,FlgVal,NumVal)); break; - case EscFarbe: { AktAtr.L.LFarbe =(BYTE)(ChgValue(Atr0.L.LFarbe,0,7 ,FlgVal,NumVal)); if (q) AktAtr.F.FFarbe =AktAtr.L.LFarbe; } break; - case EscBFarb: { AktAtr.L.LBFarbe=(BYTE)(ChgValue(Atr0.L.LBFarbe,0,255,FlgVal,NumVal)); if (q) AktAtr.F.FBFarbe=AktAtr.L.LBFarbe; } break; - case EscInts : { AktAtr.L.LIntens=(BYTE)(ChgValue(Atr0.L.LIntens,0,100,FlgVal,NumVal)); if (q) AktAtr.F.FIntens=AktAtr.L.LIntens; } break; - - case EscMustr: { AktAtr.F.FMuster=USHORT(ChgValue(Atr0.F.FMuster,0,65535,FlgVal,NumVal)); } break; - case EscMFarb: { AktAtr.F.FFarbe =(BYTE)(ChgValue(Atr0.F.FFarbe,0,7 ,FlgVal,NumVal)); } break; - case EscMBFrb: { AktAtr.F.FBFarbe=(BYTE)(ChgValue(Atr0.F.FBFarbe,0,255,FlgVal,NumVal)); } break; - case EscMInts: { AktAtr.F.FIntens=(BYTE)(ChgValue(Atr0.F.FIntens,0,100,FlgVal,NumVal)); } break; - - case EscSMstr: { AktAtr.ShdF.FMuster=USHORT(ChgValue(Atr0.ShdF.FMuster,0,65535,FlgVal,NumVal)); } break; - case EscSFarb: { AktAtr.ShdL.LFarbe =(BYTE)(ChgValue(Atr0.ShdL.LFarbe,0,7 ,FlgVal,NumVal)); AktAtr.ShdF.FFarbe =AktAtr.ShdL.LFarbe; } break; - case EscSBFrb: { AktAtr.ShdL.LBFarbe=(BYTE)(ChgValue(Atr0.ShdL.LBFarbe,0,255,FlgVal,NumVal)); AktAtr.ShdF.FBFarbe=AktAtr.ShdL.LBFarbe; } break; - case EscSInts: { AktAtr.ShdL.LIntens=(BYTE)(ChgValue(Atr0.ShdL.LIntens,0,100,FlgVal,NumVal)); AktAtr.ShdF.FIntens=AktAtr.ShdL.LIntens; } break; + case EscZAbst: AktAtr.ZAbst =(sal_uInt8)(ChgValue(Atr0.ZAbst, 1,255 ,FlgVal,NumVal)); break; + case EscHJust: AktAtr.Justify=(sal_uInt8)(ChgValue(Atr0.Justify & 0x0F,0,5 ,FlgVal,NumVal)); break; + case EscFarbe: { AktAtr.L.LFarbe =(sal_uInt8)(ChgValue(Atr0.L.LFarbe,0,7 ,FlgVal,NumVal)); if (q) AktAtr.F.FFarbe =AktAtr.L.LFarbe; } break; + case EscBFarb: { AktAtr.L.LBFarbe=(sal_uInt8)(ChgValue(Atr0.L.LBFarbe,0,255,FlgVal,NumVal)); if (q) AktAtr.F.FBFarbe=AktAtr.L.LBFarbe; } break; + case EscInts : { AktAtr.L.LIntens=(sal_uInt8)(ChgValue(Atr0.L.LIntens,0,100,FlgVal,NumVal)); if (q) AktAtr.F.FIntens=AktAtr.L.LIntens; } break; + + case EscMustr: { AktAtr.F.FMuster=sal_uInt16(ChgValue(Atr0.F.FMuster,0,65535,FlgVal,NumVal)); } break; + case EscMFarb: { AktAtr.F.FFarbe =(sal_uInt8)(ChgValue(Atr0.F.FFarbe,0,7 ,FlgVal,NumVal)); } break; + case EscMBFrb: { AktAtr.F.FBFarbe=(sal_uInt8)(ChgValue(Atr0.F.FBFarbe,0,255,FlgVal,NumVal)); } break; + case EscMInts: { AktAtr.F.FIntens=(sal_uInt8)(ChgValue(Atr0.F.FIntens,0,100,FlgVal,NumVal)); } break; + + case EscSMstr: { AktAtr.ShdF.FMuster=sal_uInt16(ChgValue(Atr0.ShdF.FMuster,0,65535,FlgVal,NumVal)); } break; + case EscSFarb: { AktAtr.ShdL.LFarbe =(sal_uInt8)(ChgValue(Atr0.ShdL.LFarbe,0,7 ,FlgVal,NumVal)); AktAtr.ShdF.FFarbe =AktAtr.ShdL.LFarbe; } break; + case EscSBFrb: { AktAtr.ShdL.LBFarbe=(sal_uInt8)(ChgValue(Atr0.ShdL.LBFarbe,0,255,FlgVal,NumVal)); AktAtr.ShdF.FBFarbe=AktAtr.ShdL.LBFarbe; } break; + case EscSInts: { AktAtr.ShdL.LIntens=(sal_uInt8)(ChgValue(Atr0.ShdL.LIntens,0,100,FlgVal,NumVal)); AktAtr.ShdF.FIntens=AktAtr.ShdL.LIntens; } break; case EscSDist: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); AktAtr.ShdVers.y=AktAtr.ShdVers.x; } break; case EscSXDst: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); } break; case EscSYDst: { AktAtr.ShdVers.y=(short)ChgValue(Atr0.ShdVers.y,0,30000,FlgVal,NumVal); } break; @@ -463,21 +463,21 @@ UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index, case EscEbShd: ChgSchnittBit(TextShEbBit,TextSh2DBit,TextSh3DBit,TextSh4DBit,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break; } //endcase if (TBuf[Index]==Escape) Index++; // zweites Esc weglesen } - } // if Ende==FALSE - } while (Ende==FALSE && ScanEsc==FALSE); - if (Ende==FALSE) c=Escape; + } // if Ende==sal_False + } while (Ende==sal_False && ScanEsc==sal_False); + if (Ende==sal_False) c=Escape; return c; } // end of ProcessOne -UCHAR GetTextChar(UCHAR* TBuf, USHORT& Index, +UCHAR GetTextChar(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr, - USHORT Rest, BOOL ScanEsc) + sal_uInt16 Rest, sal_Bool ScanEsc) { UCHAR c,c0,nc; c=ProcessOne(TBuf,Index,Atr0,AktAtr,ScanEsc); - if (ScanEsc==FALSE) { + if (ScanEsc==sal_False) { if (c==SoftTrennAdd || c==SoftTrennK || c==SoftTrenn) { nc=GetNextChar(TBuf,Index); c0=c; @@ -507,9 +507,9 @@ UCHAR GetTextChar(UCHAR* TBuf, USHORT& Index, -UCHAR GetTextCharConv(UCHAR* TBuf, USHORT& Index, +UCHAR GetTextCharConv(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr, - USHORT Rest, BOOL ScanEsc) + sal_uInt16 Rest, sal_Bool ScanEsc) { UCHAR c; @@ -530,23 +530,23 @@ UCHAR GetTextCharConv(UCHAR* TBuf, USHORT& Index, // // Benoetigter Zeilenabstand in SGF-Units. ChrVPos wird beruecksichtigt. // ====================================================================== -USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktAtr, - USHORT nChar, USHORT& LF, USHORT& MaxGrad) +sal_uInt16 GetLineFeed(UCHAR* TBuf, sal_uInt16 Index, ObjTextType Atr0, ObjTextType AktAtr, + sal_uInt16 nChar, sal_uInt16& LF, sal_uInt16& MaxGrad) { UCHAR c=0; - BOOL AbsEnd=FALSE; - ULONG LF100=0; - ULONG MaxLF100=0; - BOOL LFauto=0; - BOOL First=TRUE; - USHORT Grad; - USHORT i=0; - USHORT r=1; + sal_Bool AbsEnd=sal_False; + sal_uLong LF100=0; + sal_uLong MaxLF100=0; + sal_Bool LFauto=0; + sal_Bool First=sal_True; + sal_uInt16 Grad; + sal_uInt16 i=0; + sal_uInt16 r=1; MaxGrad=0; while (!AbsEnd && nChar>0) { nChar--; - c=GetTextChar(TBuf,Index,Atr0,AktAtr,nChar,FALSE); + c=GetTextChar(TBuf,Index,Atr0,AktAtr,nChar,sal_False); i++; AbsEnd=(c==TextEnd || c==AbsatzEnd); if (First || (!AbsEnd && c!=' ' && c!=HardTrenn)) { @@ -558,15 +558,15 @@ USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktA Grad=AktAtr.Grad; if (AktAtr.ChrVPos>0) Grad=Grad-AktAtr.ChrVPos; if (Grad>MaxGrad) MaxGrad=Grad; - First=FALSE; + First=sal_False; } if (!AbsEnd && c!=' ') r=i; } MaxGrad=hPoint2Sgf(MaxGrad); if (MaxLF100<=4000) { // sonst Overflowgefahr - LF=USHORT(hPoint2Sgf(short(MaxLF100)) /100); + LF=sal_uInt16(hPoint2Sgf(short(MaxLF100)) /100); } else { - LF=USHORT(hPoint2Sgf(short(MaxLF100) /100)); + LF=sal_uInt16(hPoint2Sgf(short(MaxLF100) /100)); } return r; @@ -588,17 +588,17 @@ USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktA #define SuperSubFact 60 /* SuperScript/SubScript: 60% vom Schriftgrad */ #define DefaultSpace 40 /* Default: Space ist 40% vom SchriftGrad */ -USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dreh, - USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv) +sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, sal_Bool Kapt, sal_uInt16 Dreh, + sal_uInt16 FitXMul, sal_uInt16 FitXDiv, sal_uInt16 FitYMul, sal_uInt16 FitYDiv) { SgfFontOne* pSgfFont; // Font aus dem IniFile Font aFont; Color aColor; - ULONG Grad; - ULONG Brei; + sal_uLong Grad; + sal_uLong Brei; String FNam; - USHORT StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad - BOOL bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1); + sal_uInt16 StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad + sal_Bool bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1); pSgfFont = pSgfFonts->GetFontDesc(Atr.GetFont()); @@ -649,25 +649,25 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr //aFont.SetCharSet(CHARSET_SYSTEM); } - Grad=ULONG(Atr.Grad); - if ((Atr.Schnitt & TextKaptBit) !=0 && Kapt) Grad=Grad*ULONG(Atr.Kapit)/100; + Grad=sal_uLong(Atr.Grad); + if ((Atr.Schnitt & TextKaptBit) !=0 && Kapt) Grad=Grad*sal_uLong(Atr.Kapit)/100; if ((Atr.Schnitt & TextSupSBit) !=0 || (Atr.Schnitt & TextSubSBit) !=0) Grad=Grad*SuperSubFact/100; Brei=Grad; if (Atr.Breite!=100 || bFit) { if (bFit) { - Grad=Grad*ULONG(FitYMul)/ULONG(FitYDiv); - Brei=Brei*ULONG(FitXMul)/ULONG(FitXDiv); + Grad=Grad*sal_uLong(FitYMul)/sal_uLong(FitYDiv); + Brei=Brei*sal_uLong(FitXMul)/sal_uLong(FitXDiv); } - Brei=Brei*ULONG(Atr.Breite)/100; - Brei=Brei*ULONG(StdBrei)/100; - aFont.SetSize(Size(hPoint2Sgf(USHORT(Brei)),hPoint2Sgf(USHORT(Grad)))); + Brei=Brei*sal_uLong(Atr.Breite)/100; + Brei=Brei*sal_uLong(StdBrei)/100; + aFont.SetSize(Size(hPoint2Sgf(sal_uInt16(Brei)),hPoint2Sgf(sal_uInt16(Grad)))); } else { - aFont.SetSize(Size(0,hPoint2Sgf(USHORT(Grad)))); + aFont.SetSize(Size(0,hPoint2Sgf(sal_uInt16(Grad)))); } aColor=Sgv2SvFarbe(Atr.L.LFarbe,Atr.L.LBFarbe,Atr.L.LIntens); aFont.SetColor(aColor); aColor=Sgv2SvFarbe(Atr.F.FFarbe,Atr.F.FBFarbe,Atr.F.FIntens); aFont.SetFillColor(aColor); - aFont.SetTransparent(TRUE); + aFont.SetTransparent(sal_True); aFont.SetAlign(ALIGN_BASELINE); Dreh/=10; Dreh=3600-Dreh; if (Dreh==3600) Dreh=0; @@ -679,11 +679,11 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr if ((Atr.Schnitt & TextDbUnBit) !=0) aFont.SetUnderline(UNDERLINE_DOUBLE); if ((Atr.Schnitt & TextStrkBit) !=0) aFont.SetStrikeout(STRIKEOUT_SINGLE); if ((Atr.Schnitt & TextDbStBit) !=0) aFont.SetStrikeout(STRIKEOUT_DOUBLE); - if ((Atr.Schnitt & TextSh2DBit) !=0) aFont.SetShadow(TRUE); - if ((Atr.Schnitt & TextSh3DBit) !=0) aFont.SetShadow(TRUE); - if ((Atr.Schnitt & TextSh4DBit) !=0) aFont.SetShadow(TRUE); - if ((Atr.Schnitt & TextShEbBit) !=0) aFont.SetShadow(TRUE); - if (CheckTextOutl(Atr.F,Atr.L)) aFont.SetOutline(TRUE); + if ((Atr.Schnitt & TextSh2DBit) !=0) aFont.SetShadow(sal_True); + if ((Atr.Schnitt & TextSh3DBit) !=0) aFont.SetShadow(sal_True); + if ((Atr.Schnitt & TextSh4DBit) !=0) aFont.SetShadow(sal_True); + if ((Atr.Schnitt & TextShEbBit) !=0) aFont.SetShadow(sal_True); + if (CheckTextOutl(Atr.F,Atr.L)) aFont.SetOutline(sal_True); if (aFont!=rOut.GetFont()) rOut.SetFont(aFont); @@ -702,26 +702,26 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr // Absatz.Pas struct ProcChrSta { - USHORT Index; - USHORT ChrXP; + sal_uInt16 Index; + sal_uInt16 ChrXP; UCHAR OutCh; - BOOL Kapt; + sal_Bool Kapt; ObjTextType Attrib; }; -void InitProcessCharState(ProcChrSta& State, ObjTextType& AktAtr, USHORT IndexA) +void InitProcessCharState(ProcChrSta& State, ObjTextType& AktAtr, sal_uInt16 IndexA) { State.Attrib=AktAtr; State.OutCh=0; State.Index=IndexA; State.ChrXP=0; - State.Kapt=FALSE; + State.Kapt=sal_False; } -BOOL UpcasePossible(UCHAR c) +sal_Bool UpcasePossible(UCHAR c) { - if ((c>='a' && c<='z') || c == 0xe4 || c == 0xf6 || c == 0xfc ) return TRUE; - else return FALSE; + if ((c>='a' && c<='z') || c == 0xe4 || c == 0xf6 || c == 0xfc ) return sal_True; + else return sal_False; } UCHAR Upcase(UCHAR c) @@ -733,15 +733,15 @@ UCHAR Upcase(UCHAR c) return c; } -USHORT GetCharWidth(OutputDevice& rOut, UCHAR c) +sal_uInt16 GetCharWidth(OutputDevice& rOut, UCHAR c) { UCHAR c1; - USHORT ChrWidth; + sal_uInt16 ChrWidth; c1 = ByteString::Convert((char)c,RTL_TEXTENCODING_IBM_437, gsl_getSystemTextEncoding() ); if (c==' ') { - ChrWidth=(USHORT)rOut.GetTextWidth( String('A') ); + ChrWidth=(sal_uInt16)rOut.GetTextWidth( String('A') ); if (rOut.GetFont().GetPitch()!=PITCH_FIXED) { ChrWidth=MulDiv(ChrWidth,DefaultSpace,100); } @@ -751,30 +751,30 @@ USHORT GetCharWidth(OutputDevice& rOut, UCHAR c) OSL_ENSURE( MaxChar == 255, "MaxChar not 255" ); if (c>=MinChar /*&& c<=MaxChar*/) { - ChrWidth=(USHORT)rOut.GetTextWidth(String((char)c1)); + ChrWidth=(sal_uInt16)rOut.GetTextWidth(String((char)c1)); } else { - ChrWidth=(USHORT)rOut.GetTextWidth(String('A')); + ChrWidth=(sal_uInt16)rOut.GetTextWidth(String('A')); } } return ChrWidth; } UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& Atr0, - USHORT& nChars, USHORT Rest, + sal_uInt16& nChars, sal_uInt16 Rest, short* Line, UCHAR* cLine) { - USHORT KernDist=0; // Wert fuer Kerning - USHORT ChrWidth; + sal_uInt16 KernDist=0; // Wert fuer Kerning + sal_uInt16 ChrWidth; UCHAR c; UCHAR c1; - BOOL AbsEnd; + sal_Bool AbsEnd; - c=GetTextChar(TBuf,R.Index,Atr0,R.Attrib,Rest,FALSE); // versucht evtl. zu trennen, wenn Rest entsprechenden Wert besitzt + c=GetTextChar(TBuf,R.Index,Atr0,R.Attrib,Rest,sal_False); // versucht evtl. zu trennen, wenn Rest entsprechenden Wert besitzt AbsEnd=(c==AbsatzEnd || c==TextEnd); - if (AbsEnd==FALSE) { + if (AbsEnd==sal_False) { R.OutCh=ConvertTextChar(c); // von HardTrenn nach '-', ... R.Kapt=(R.Attrib.Schnitt & TextKaptBit) !=0 && UpcasePossible(R.OutCh); if (R.Kapt) R.OutCh=Upcase(R.OutCh); @@ -784,9 +784,9 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A ChrWidth=GetCharWidth(rOut,c1); if (R.Attrib.ZAbst!=100) { // Spezial-Zeichenabstand ? - ULONG Temp; - Temp=ULONG(ChrWidth)*ULONG(R.Attrib.ZAbst)/100; - ChrWidth=USHORT(Temp); + sal_uLong Temp; + Temp=sal_uLong(ChrWidth)*sal_uLong(R.Attrib.ZAbst)/100; + ChrWidth=sal_uInt16(Temp); } nChars++; if (R.ChrXP>32000) R.ChrXP=32000; @@ -797,44 +797,44 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A return c; } -void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktAtr, - USHORT UmbWdt, USHORT AdjWdt, - short* Line, USHORT& nChars, +void FormatLine(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr, + sal_uInt16 UmbWdt, sal_uInt16 AdjWdt, + short* Line, sal_uInt16& nChars, double, double, - UCHAR* cLine, BOOL TextFit) + UCHAR* cLine, sal_Bool TextFit) { VirtualDevice vOut; UCHAR c,c0; UCHAR ct; - BOOL First; // erster Char ? - BYTE Just = 0; // Absatzformatierung - BOOL Border; // Rand der Box erreicht ? - BOOL Border0; - BOOL AbsEnd; // Ende des Absatzes erreicht ? + sal_Bool First; // erster Char ? + sal_uInt8 Just = 0; // Absatzformatierung + sal_Bool Border; // Rand der Box erreicht ? + sal_Bool Border0; + sal_Bool AbsEnd; // Ende des Absatzes erreicht ? ProcChrSta* R=new ProcChrSta; ProcChrSta* R0=new ProcChrSta; ProcChrSta* WErec=new ProcChrSta; - USHORT WEnChar; + sal_uInt16 WEnChar; ProcChrSta* WErec0=new ProcChrSta; - USHORT WEnChar0; + sal_uInt16 WEnChar0; ProcChrSta* TRrec=new ProcChrSta; - USHORT TRnChar; + sal_uInt16 TRnChar; - USHORT WordEndCnt; // Justieren und Trennen - BOOL WordEnd; - BOOL Trenn; + sal_uInt16 WordEndCnt; // Justieren und Trennen + sal_Bool WordEnd; + sal_Bool Trenn; short BoxRest; // zum Quetschen und formatieren - USHORT i,j,k,h; - USHORT re,li; + sal_uInt16 i,j,k,h; + sal_uInt16 re,li; vOut.SetMapMode(MapMode(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4))); nChars=0; - SetTextContext(vOut,AktAtr,FALSE,0,1,1,1,1); + SetTextContext(vOut,AktAtr,sal_False,0,1,1,1,1); InitProcessCharState(*R,AktAtr,Index); - (*R0)=(*R); (*WErec)=(*R); WEnChar=0; c0=0; Border0=FALSE; - Border=FALSE; First=TRUE; + (*R0)=(*R); (*WErec)=(*R); WEnChar=0; c0=0; Border0=sal_False; + Border=sal_False; First=sal_True; WordEndCnt=0; do { // mal schauen, wieviele Worte so in die Zeile passen @@ -862,16 +862,16 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA } (*R0)=(*R); c0=c; Border0=Border; - First=FALSE; + First=sal_False; AbsEnd=AbsEnd || (nChars>=MaxLineChars); } while (!(AbsEnd || (Border && ((WordEndCnt>0) || WordEnd || Trenn)))); if (Border) { // Trennen und Quetschen (*WErec0)=(*WErec); WEnChar0=WEnChar; - AbsEnd=FALSE; c0=0; + AbsEnd=sal_False; c0=0; (*R)=(*WErec); nChars=WEnChar; (*TRrec)=(*R); TRnChar=nChars; - Border0=FALSE; Border=FALSE; + Border0=sal_False; Border=sal_False; do { // erst mal gucken wieviele Silben noch reinpassen ct=ProcessChar(vOut,TBuf,*TRrec,Atr0,TRnChar,DoTrenn,Line,cLine); c=ProcessChar(vOut,TBuf,*R,Atr0,nChars,NoTrenn,Line,cLine); @@ -918,7 +918,7 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA if (!AbsEnd) { do { // Leerzeichen weglesen (*WErec)=(*R); - c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE); + c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,sal_False); nChars++; Line[nChars]=R->ChrXP; cLine[nChars]=c; @@ -934,7 +934,7 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA nChars++; Line[nChars]=R->ChrXP; // Damit AbsatzEnde auch weggelesen wird Line[nChars+1]=R->ChrXP; // denn die Breite von CR oder #0 ist nun mal sehr klein if (TBuf[R->Index-1]!=AbsatzEnd && TBuf[R->Index-1]!=TextEnd) { - c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE); // Kleine Korrektur. Notig, wenn nur 1 Wort in + c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,sal_False); // Kleine Korrektur. Notig, wenn nur 1 Wort in } } @@ -1018,8 +1018,8 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA ///////////////////////////////////////////////////////////////////////////////// // DrawText.Pas -void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, USHORT DrehWink, - USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv) +void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, sal_uInt16 DrehWink, + sal_uInt16 FitXMul, sal_uInt16 FitXDiv, sal_uInt16 FitYMul, sal_uInt16 FitYDiv) { SetTextContext(rOut,T,UpcasePossible(c),DrehWink,FitXMul,FitXDiv,FitYMul,FitYDiv); if ((T.Schnitt & TextKaptBit)!=0 && UpcasePossible(c)) c=Upcase(c); @@ -1041,32 +1041,32 @@ void TextType::Draw(OutputDevice& rOut) if ((Flags & TextOutlBit)!=0) return; // Sourcetext fuer Outliner !! ObjTextType T1,T2; - USHORT Index1; - USHORT Index2; + sal_uInt16 Index1; + sal_uInt16 Index2; UCHAR c = TextEnd; - USHORT l; // Anzahl der Zeichen in der Zeile - USHORT i; + sal_uInt16 l; // Anzahl der Zeichen in der Zeile + sal_uInt16 i; short yPos0; short xPos; short yPos; - USHORT LF; - USHORT MaxGrad; + sal_uInt16 LF; + sal_uInt16 MaxGrad; short xSize; short xSAdj; short ySize; double sn,cs; - USHORT TopToBase; - BOOL Ende = 0; - USHORT lc; - BOOL LineFit; // FitSize.x=0? oder Flags -> jede Zeile stretchen - BOOL TextFit; + sal_uInt16 TopToBase; + sal_Bool Ende = 0; + sal_uInt16 lc; + sal_Bool LineFit; // FitSize.x=0? oder Flags -> jede Zeile stretchen + sal_Bool TextFit; short* xLine; UCHAR* cLine; // Buffer fuer FormatLine - USHORT FitXMul; - USHORT FitXDiv; - USHORT FitYMul; - USHORT FitYDiv; - BOOL Fehler; + sal_uInt16 FitXMul; + sal_uInt16 FitXDiv; + sal_uInt16 FitYMul; + sal_uInt16 FitYDiv; + sal_Bool Fehler; UCHAR* Buf=Buffer; // Zeiger auf die Buchstaben pSgfFonts->ReadList(); @@ -1074,9 +1074,9 @@ void TextType::Draw(OutputDevice& rOut) cLine=new UCHAR[CharLineSize]; TextFit=(Flags & TextFitBits)!=0; - LineFit=FALSE; + LineFit=sal_False; LineFit=((Flags & TextFitZBit)!=0); - if (TextFit && FitSize.x==0) LineFit=TRUE; + if (TextFit && FitSize.x==0) LineFit=sal_True; if (DrehWink==0) { sn=0.0; @@ -1091,9 +1091,9 @@ void TextType::Draw(OutputDevice& rOut) ySize=Pos2.y-Pos1.y; xSize=32000 /2; // Umbruch xSAdj=Pos2.x-Pos1.x; // zum Ausrichten bei Zentriert/Blocksatz - //if (xSize<=0) { xSize=32000 /2; LineFit=TRUE; } - FitXMul=sal::static_int_cast< USHORT >(abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1; - FitYMul=sal::static_int_cast< USHORT >(abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1; + //if (xSize<=0) { xSize=32000 /2; LineFit=sal_True; } + FitXMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1; + FitYMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1; } else { xSize=Pos2.x-Pos1.x; xSAdj=xSize; @@ -1132,7 +1132,7 @@ void TextType::Draw(OutputDevice& rOut) T2=T1; Index2=Index1; i=1; while (i<=l) { - c=GetTextCharConv(Buf,Index2,T,T2,l-i,FALSE); + c=GetTextCharConv(Buf,Index2,T,T2,l-i,sal_False); long xp1,yp1; // wegen Overflowgefahr PointType Pos; xp1=long(Pos1.x)+xPos+long(xLine[i]); @@ -1164,27 +1164,27 @@ void TextType::Draw(OutputDevice& rOut) // (DEC Alpha hat naemlich 64Bit-Pointer!) //UCHAR* TextType::GetBufPtr() //{ -// ULONG Temp; -// Temp=ULONG(BufLo)+0x00010000*ULONG(BufHi); +// sal_uLong Temp; +// Temp=sal_uLong(BufLo)+0x00010000*sal_uLong(BufHi); // return (UCHAR*)Temp; //} // //void TextType::SetBufPtr(UCHAR* Ptr) //{ -// ULONG Temp=(ULONG)Ptr; -// BufLo=USHORT(Temp & 0x0000FFFF); -// BufHi=USHORT((Temp & 0xFFFF0000)>>16); +// sal_uLong Temp=(sal_uLong)Ptr; +// BufLo=sal_uInt16(Temp & 0x0000FFFF); +// BufHi=sal_uInt16((Temp & 0xFFFF0000)>>16); //} -UINT32 ObjTextType::GetFont() +sal_uInt32 ObjTextType::GetFont() { - return ULONG(FontLo)+0x00010000*ULONG(FontHi); + return sal_uLong(FontLo)+0x00010000*sal_uLong(FontHi); } -void ObjTextType::SetFont(UINT32 FontID) +void ObjTextType::SetFont(sal_uInt32 FontID) { - FontLo=USHORT(FontID & 0x0000FFFF); - FontHi=USHORT((FontID & 0xFFFF0000)>>16); + FontLo=sal_uInt16(FontID & 0x0000FFFF); + FontHi=sal_uInt16((FontID & 0xFFFF0000)>>16); } @@ -1195,11 +1195,11 @@ SgfFontOne::SgfFontOne() { Next=NULL; IFID=0; - Bold=FALSE; - Ital=FALSE; - Sans=FALSE; - Serf=FALSE; - Fixd=FALSE; + Bold=sal_False; + Ital=sal_False; + Sans=sal_False; + Serf=sal_False; + Fixd=sal_False; SVFamil=FAMILY_DONTKNOW; SVChSet=RTL_TEXTENCODING_DONTKNOW; SVWidth=40; @@ -1207,7 +1207,7 @@ SgfFontOne::SgfFontOne() void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc ) { - USHORT i,j,n; + sal_uInt16 i,j,n; ByteString s; if ( Dsc.Len() < 4 || ( Dsc.GetChar( 0 ) != '(' ) ) @@ -1229,7 +1229,7 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc ) SVFName=String(Dsc,i+1,j); // SV-Fontname rausholen Dsc.Erase(i,j); - IFID = (UINT32)ID.ToInt32(); + IFID = (sal_uInt32)ID.ToInt32(); n=Dsc.GetTokenCount(' '); for (i=0;i<n;i++) { @@ -1237,11 +1237,11 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc ) if ( s.Len() ) { s.ToUpperAscii(); - if ( s.CompareTo( "BOLD", 4 ) == COMPARE_EQUAL ) Bold=TRUE; - else if ( s.CompareTo( "ITAL", 4 ) == COMPARE_EQUAL ) Ital=TRUE; - else if ( s.CompareTo( "SERF", 4 ) == COMPARE_EQUAL ) Serf=TRUE; - else if ( s.CompareTo( "SANS", 4 ) == COMPARE_EQUAL ) Sans=TRUE; - else if ( s.CompareTo( "FIXD", 4 ) == COMPARE_EQUAL ) Fixd=TRUE; + if ( s.CompareTo( "BOLD", 4 ) == COMPARE_EQUAL ) Bold=sal_True; + else if ( s.CompareTo( "ITAL", 4 ) == COMPARE_EQUAL ) Ital=sal_True; + else if ( s.CompareTo( "SERF", 4 ) == COMPARE_EQUAL ) Serf=sal_True; + else if ( s.CompareTo( "SANS", 4 ) == COMPARE_EQUAL ) Sans=sal_True; + else if ( s.CompareTo( "FIXD", 4 ) == COMPARE_EQUAL ) Fixd=sal_True; else if ( s.CompareTo( "ROMAN", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_ROMAN; else if ( s.CompareTo( "SWISS", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_SWISS; else if ( s.CompareTo( "MODERN", 6 ) == COMPARE_EQUAL ) SVFamil=FAMILY_MODERN; @@ -1252,7 +1252,7 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc ) else if ( s.CompareTo( "MAC", 3 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_APPLE_ROMAN; else if ( s.CompareTo( "SYMBOL", 6 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_SYMBOL; else if ( s.CompareTo( "SYSTEM", 6 ) == COMPARE_EQUAL ) SVChSet = gsl_getSystemTextEncoding(); - else if ( s.IsNumericAscii() ) SVWidth=sal::static_int_cast< USHORT >(s.ToInt32()); + else if ( s.IsNumericAscii() ) SVWidth=sal::static_int_cast< sal_uInt16 >(s.ToInt32()); } } } @@ -1265,7 +1265,7 @@ SgfFontLst::SgfFontLst() Last=NULL; LastID=0; LastLn=NULL; - Tried=FALSE; + Tried=sal_False; } SgfFontLst::~SgfFontLst() @@ -1285,7 +1285,7 @@ void SgfFontLst::RausList() } pList=NULL; Last=NULL; - Tried=FALSE; + Tried=sal_False; LastID=0; LastLn=NULL; } @@ -1296,14 +1296,14 @@ void SgfFontLst::AssignFN(const String& rFName) void SgfFontLst::ReadList() { if (!Tried) { - Tried=TRUE; + Tried=sal_True; LastID=0; LastLn=NULL; SgfFontOne* P,P1; Config aCfg(FNam); aCfg.SetGroup("SGV Fonts fuer StarView"); - USHORT Anz=aCfg.GetKeyCount(); - USHORT i; + sal_uInt16 Anz=aCfg.GetKeyCount(); + sal_uInt16 i; ByteString FID,Dsc; for (i=0;i<Anz;i++) @@ -1321,7 +1321,7 @@ void SgfFontLst::ReadList() } } -SgfFontOne* SgfFontLst::GetFontDesc(UINT32 ID) +SgfFontOne* SgfFontLst::GetFontDesc(sal_uInt32 ID) { if (ID!=LastID) { SgfFontOne* P; |