diff options
author | ka <kai.ahrens@oracle.com> | 2011-02-18 05:20:51 +0100 |
---|---|---|
committer | ka <kai.ahrens@oracle.com> | 2011-02-18 05:20:51 +0100 |
commit | f759ad09f5cfd415390ba25aa413cbecb10f047b (patch) | |
tree | aa387694e44d3e51f117a58779eff25fbd6091e0 /svtools | |
parent | 66cf579511eac065ad1f75022537f9a2d4cb7252 (diff) |
ka102: type changes nneded for DEV300_m100
Diffstat (limited to 'svtools')
25 files changed, 1275 insertions, 1288 deletions
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index 20cc46a30ab5..472fe327329d 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/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 ) ); @@ -1510,4 +1510,3 @@ IMPL_LINK( ExportDialog, OK, void *, EMPTYARG ) return 0; } - diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx index e8f6ffddc352..78d97cc25c5c 100644 --- a/svtools/source/filter/filter.cxx +++ b/svtools/source/filter/filter.cxx @@ -136,7 +136,7 @@ public: sal_Bool ImplDirEntryHelper::Exists( const INetURLObject& rObj ) { - sal_Bool bExists = FALSE; + sal_Bool bExists = sal_False; try { @@ -189,7 +189,7 @@ void ImplDirEntryHelper::Kill( const String& rMainUrl ) //-------------------------------------------------------------------------- -BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, sal_uLong nComp, sal_uLong nSize ) +sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nComp, sal_uLong nSize ) { while ( nComp-- >= nSize ) { @@ -226,9 +226,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 @@ -236,11 +236,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! |* @@ -249,22 +249,22 @@ inline String ImpGetExtension( const String &rPath ) |* *************************************************************************/ -static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, BOOL bTest ) +static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, sal_Bool bTest ) { sal_uInt16 i; - BYTE sFirstBytes[ 256 ]; + 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; @@ -282,20 +282,20 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio } 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. - sal_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 @@ -304,7 +304,7 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio // 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... @@ -312,26 +312,26 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio //--------------------------- 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 ); sal_uInt16 nFieldSize; - BYTE nMagic; - sal_Bool bOK=TRUE; + 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; } } } @@ -339,9 +339,9 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio //--------------------------- 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, @@ -365,7 +365,7 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio sFirstBytes[14+nOffs] == 0x0c ) { rFormatExtension = UniString::CreateFromAscii( "BMP", 3 ); - return TRUE; + return sal_True; } } } @@ -376,33 +376,33 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio ( 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; } } } @@ -410,69 +410,69 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio //--------------------------- 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]; @@ -482,7 +482,7 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio if( strncmp( sBuf, "PCD_IPI", 7 ) == 0 ) { rFormatExtension = UniString::CreateFromAscii( "PCD", 3 ); - return TRUE; + return sal_True; } } } @@ -490,30 +490,30 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio //--------------------------- 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) @@ -534,22 +534,22 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio 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 @@ -578,19 +578,19 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio 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; } } } @@ -601,7 +601,7 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio ( rFormatExtension.CompareToAscii( "PGM", 3 ) == COMPARE_EQUAL ) || ( rFormatExtension.CompareToAscii( "PPM", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if ( sFirstBytes[ 0 ] == 'P' ) { switch( sFirstBytes[ 1 ] ) @@ -609,17 +609,17 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio 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; } } } @@ -627,95 +627,95 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio //--------------------------- 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 ) { sal_uLong nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen; - BYTE* pBuf = new BYTE [ nSize ]; + 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; } //--------------------------- SVG ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "SVG", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; // just a simple test for the extension if( rFormatExtension.CompareToAscii( "SVG", 3 ) == COMPARE_EQUAL ) - return TRUE; + return sal_True; } //--------------------------- TGA ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; // just a simple test for the extension 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; // just a simple test for the extension 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; } } @@ -733,7 +733,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++ ) { @@ -762,7 +762,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" ) ) { @@ -1391,7 +1391,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, 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 @@ -1678,10 +1678,10 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, if( nBufSize ) { - BYTE* pBuf=0; + sal_uInt8* pBuf=0; try { - pBuf = new BYTE[ nBufSize ]; + pBuf = new sal_uInt8[ nBufSize ]; } catch (std::bad_alloc) { @@ -1692,7 +1692,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, { rIStream.Seek( nStmBegin ); rIStream.Read( pBuf, nBufSize ); - rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, TRUE ) ); + rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, sal_True ) ); } } } @@ -1766,7 +1766,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& FilterConfigItem aConfigItem( (uno::Sequence< beans::PropertyValue >*)pFilterData ); String aFilterName( pConfig->GetExportFilterName( nFormat ) ); - bAbort = FALSE; + bAbort = sal_False; sal_uInt16 nStatus = GRFILTER_OK; GraphicType eType; Graphic aGraphic( rGraphic ); @@ -1916,7 +1916,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& } else if( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) ) { - sal_Bool bExportedGrayJPEG = sal_False; + bool bExportedGrayJPEG = false; if( !ExportJPEG( rOStm, aGraphic, pFilterData, &bExportedGrayJPEG ) ) nStatus = GRFILTER_FORMATERROR; nExpGraphHint = bExportedGrayJPEG ? GRFILTER_OUTHINT_GREY : 0; @@ -2082,7 +2082,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& sal_Bool GraphicFilter::Setup( sal_uInt16 ) { - return FALSE; + return sal_False; } /* ------------------------------------------------------------------------ diff --git a/svtools/source/filter/filter2.cxx b/svtools/source/filter/filter2.cxx index 9bf651790003..58fafc47c0f2 100644 --- a/svtools/source/filter/filter2.cxx +++ b/svtools/source/filter/filter2.cxx @@ -40,7 +40,7 @@ #define DATA_SIZE 640 -BYTE* ImplSearchEntry( BYTE* , BYTE* , sal_uLong , sal_uLong ); +sal_uInt8* ImplSearchEntry( sal_uInt8* , sal_uInt8* , sal_uLong , sal_uLong ); /************************************************************************* |* @@ -99,33 +99,33 @@ sal_Bool GraphicDescriptor::Detect( sal_Bool bExtendedInfo ) 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 ( ImpDetectSVG( 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 ( ImpDetectSVG( 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 ); } @@ -155,7 +155,7 @@ void GraphicDescriptor::ImpConstruct() sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT16 nTemp16; + sal_uInt16 nTemp16; sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); @@ -173,12 +173,12 @@ sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_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 ); @@ -236,10 +236,10 @@ sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 n32; - UINT16 n16; + sal_uInt32 n32; + sal_uInt16 n16; sal_Bool bRet = sal_False; - BYTE cByte; + sal_uInt8 cByte; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -251,11 +251,11 @@ sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_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; @@ -310,7 +310,7 @@ sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) sal_Bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 nTemp32; + sal_uInt32 nTemp32; sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); @@ -322,7 +322,7 @@ sal_Bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInf if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) ) { nFormat = GFF_JPG; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { @@ -481,9 +481,9 @@ sal_Bool GraphicDescriptor::ImpDetectPCD( SvStream& rStm, sal_Bool ) 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; @@ -495,7 +495,7 @@ sal_Bool GraphicDescriptor::ImpDetectPCD( SvStream& rStm, sal_Bool ) ( cByte == 0x49 ) ) { nFormat = GFF_PCD; - bRet = TRUE; + bRet = sal_True; } rStm.Seek( nStmPos ); return bRet; @@ -514,10 +514,10 @@ sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo // 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; sal_Bool bRet = sal_False; - BYTE cByte; + sal_uInt8 cByte; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -526,11 +526,11 @@ sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo if ( cByte == 0x0a ) { nFormat = GFF_PCX; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT16 nTemp16; + sal_uInt16 nTemp16; sal_uInt16 nXmin; sal_uInt16 nXmax; sal_uInt16 nYmin; @@ -599,7 +599,7 @@ sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 nTemp32; + sal_uInt32 nTemp32; sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); @@ -616,7 +616,7 @@ sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo if ( bExtendedInfo ) { - BYTE cByte; + sal_uInt8 cByte; // IHDR-Chunk rStm.SeekRel( 8 ); @@ -638,7 +638,7 @@ sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo nPlanes = 1; bCompressed = sal_True; - UINT32 nLen32; + sal_uInt32 nLen32; rStm.SeekRel( 8 ); @@ -698,8 +698,8 @@ sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo { sal_Bool bDetectOk = sal_False; sal_Bool bRet = sal_False; - BYTE cByte1; - BYTE cByte2; + sal_uInt8 cByte1; + sal_uInt8 cByte2; sal_Int32 nStmPos = rStm.Tell(); rStm >> cByte1; @@ -719,7 +719,7 @@ sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo if ( bDetectOk ) { - UINT16 nTemp16; + sal_uInt16 nTemp16; rStm >> nTemp16; if ( nTemp16 == 0x2a ) @@ -731,7 +731,7 @@ sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo { sal_uLong nCount; sal_uLong nMax = DATA_SIZE - 48; - UINT32 nTemp32; + sal_uInt32 nTemp32; sal_Bool bOk = sal_False; // Offset des ersten IFD einlesen @@ -875,7 +875,7 @@ sal_Bool GraphicDescriptor::ImpDetectPBM( SvStream& rStm, sal_Bool ) else { sal_Int32 nStmPos = rStm.Tell(); - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) ) bRet = sal_True; @@ -902,7 +902,7 @@ sal_Bool GraphicDescriptor::ImpDetectPGM( SvStream& rStm, sal_Bool ) 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' ) ) ) @@ -930,7 +930,7 @@ sal_Bool GraphicDescriptor::ImpDetectPPM( SvStream& rStm, sal_Bool ) 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' ) ) ) @@ -952,7 +952,7 @@ sal_Bool GraphicDescriptor::ImpDetectPPM( SvStream& rStm, sal_Bool ) sal_Bool GraphicDescriptor::ImpDetectRAS( SvStream& rStm, sal_Bool ) { - UINT32 nMagicNumber; + sal_uInt32 nMagicNumber; sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); @@ -991,24 +991,24 @@ sal_Bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo { 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 = 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 ) ) @@ -1118,7 +1118,7 @@ sal_Bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, sal_Bool ) { sal_Int32 nStmPos = rStm.Tell(); - BYTE sBuf[4]; + sal_uInt8 sBuf[4]; rStm.SeekRel( 522 ); rStm.Read( sBuf, 3 ); @@ -1154,7 +1154,7 @@ sal_Bool GraphicDescriptor::ImpDetectSGF( SvStream& rStm, sal_Bool ) { sal_Int32 nStmPos = rStm.Tell(); - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; rStm >> nFirst >> nSecond; @@ -1195,9 +1195,9 @@ sal_Bool GraphicDescriptor::ImpDetectSGV( SvStream&, sal_Bool ) sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 n32; + sal_uInt32 n32; sal_Bool bRet = sal_False; - BYTE cByte; + sal_uInt8 cByte; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -1212,8 +1212,8 @@ sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo if ( bExtendedInfo ) { - UINT32 nTemp32; - UINT16 nTemp16; + sal_uInt32 nTemp32; + sal_uInt16 nTemp16; rStm.SeekRel( 0x04 ); @@ -1240,7 +1240,7 @@ sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo if( n32 == 0x4D4C4356 ) { - UINT16 nTmp16; + sal_uInt16 nTmp16; rStm >> nTmp16; @@ -1302,7 +1302,7 @@ sal_Bool GraphicDescriptor::ImpDetectEMF( SvStream&, sal_Bool ) |* \************************************************************************/ -sal_Bool GraphicDescriptor::ImpDetectSVG( SvStream& rStm, sal_Bool bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectSVG( SvStream& /*rStm*/, sal_Bool /*bExtendedInfo*/ ) { sal_Bool bRet = aPathExt.CompareToAscii( "svg", 3 ) == COMPARE_EQUAL; if (bRet) diff --git a/svtools/source/filter/igif/decode.cxx b/svtools/source/filter/igif/decode.cxx index bfe77319b81a..ddea94a5555e 100644 --- a/svtools/source/filter/igif/decode.cxx +++ b/svtools/source/filter/igif/decode.cxx @@ -36,19 +36,19 @@ struct GIFLZWTableEntry { GIFLZWTableEntry* pPrev; GIFLZWTableEntry* pFirst; - BYTE nData; + sal_uInt8 nData; }; // ------------------------------------------------------------------------ -GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) : +GIFLZWDecompressor::GIFLZWDecompressor( sal_uInt8 cDataSize ) : nInputBitsBuf ( 0 ), nOutBufDataLen ( 0 ), nInputBitsBufSize ( 0 ), - bEOIFound ( FALSE ), + bEOIFound ( sal_False ), nDataSize ( cDataSize ) { - pOutBuf = new BYTE[ 4096 ]; + pOutBuf = new sal_uInt8[ 4096 ]; nClearCode = 1 << nDataSize; nEOICode = nClearCode + 1; @@ -59,11 +59,11 @@ GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) : pTable = new GIFLZWTableEntry[ 4098 ]; - for( USHORT i = 0; i < nTableSize; i++ ) + for( sal_uInt16 i = 0; i < nTableSize; i++ ) { pTable[i].pPrev = NULL; pTable[i].pFirst = pTable + i; - pTable[i].nData = (BYTE) i; + pTable[i].nData = (sal_uInt8) i; } } @@ -77,11 +77,11 @@ GIFLZWDecompressor::~GIFLZWDecompressor() // ------------------------------------------------------------------------ -HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize, - ULONG& rCount, BOOL& rEOI ) +HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize, + sal_uLong& rCount, sal_Bool& rEOI ) { - ULONG nTargetSize = 4096; - ULONG nCount = 0; + sal_uLong nTargetSize = 4096; + sal_uLong nCount = 0; HPBYTE pTarget = (HPBYTE) rtl_allocateMemory( nTargetSize ); HPBYTE pTmpTarget = pTarget; @@ -95,8 +95,8 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize, if( nCount > nTargetSize ) { - ULONG nNewSize = nTargetSize << 1; - ULONG nOffset = pTmpTarget - pTarget; + sal_uLong nNewSize = nTargetSize << 1; + sal_uLong nOffset = pTmpTarget - pTarget; HPBYTE pTmp = (HPBYTE) rtl_allocateMemory( nNewSize ); memcpy( pTmp, pTarget, nTargetSize ); @@ -123,7 +123,7 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize, // ------------------------------------------------------------------------ -void GIFLZWDecompressor::AddToTable( USHORT nPrevCode, USHORT nCodeFirstData ) +void GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData ) { GIFLZWTableEntry* pE; @@ -135,37 +135,37 @@ void GIFLZWDecompressor::AddToTable( USHORT nPrevCode, USHORT nCodeFirstData ) pE->nData = pTable[ nCodeFirstData ].pFirst->nData; nTableSize++; - if ( ( nTableSize == (USHORT) (1 << nCodeSize) ) && ( nTableSize < 4096 ) ) + if ( ( nTableSize == (sal_uInt16) (1 << nCodeSize) ) && ( nTableSize < 4096 ) ) nCodeSize++; } } // ------------------------------------------------------------------------ -BOOL GIFLZWDecompressor::ProcessOneCode() +sal_Bool GIFLZWDecompressor::ProcessOneCode() { GIFLZWTableEntry* pE; - USHORT nCode; - BOOL bRet = FALSE; - BOOL bEndOfBlock = FALSE; + sal_uInt16 nCode; + sal_Bool bRet = sal_False; + sal_Bool bEndOfBlock = sal_False; while( nInputBitsBufSize < nCodeSize ) { if( nBlockBufPos >= nBlockBufSize ) { - bEndOfBlock = TRUE; + bEndOfBlock = sal_True; break; } - nInputBitsBuf |= ( (ULONG) pBlockBuf[ nBlockBufPos++ ] ) << nInputBitsBufSize; + nInputBitsBuf |= ( (sal_uLong) pBlockBuf[ nBlockBufPos++ ] ) << nInputBitsBufSize; nInputBitsBufSize += 8; } if ( !bEndOfBlock ) { // Einen Code aus dem Eingabe-Buffer holen: - nCode = sal::static_int_cast< USHORT >( - ( (USHORT) nInputBitsBuf ) & ( ~( 0xffff << nCodeSize ) )); + nCode = sal::static_int_cast< sal_uInt16 >( + ( (sal_uInt16) nInputBitsBuf ) & ( ~( 0xffff << nCodeSize ) )); nInputBitsBuf >>= nCodeSize; nInputBitsBufSize = nInputBitsBufSize - nCodeSize; @@ -191,9 +191,9 @@ BOOL GIFLZWDecompressor::ProcessOneCode() nOutBufDataLen = 0; } else - bEOIFound = TRUE; + bEOIFound = sal_True; - return TRUE; + return sal_True; } nOldCode = nCode; @@ -208,7 +208,7 @@ BOOL GIFLZWDecompressor::ProcessOneCode() } while( pE ); - bRet = TRUE; + bRet = sal_True; } return bRet; diff --git a/svtools/source/filter/igif/decode.hxx b/svtools/source/filter/igif/decode.hxx index 3c6a61e7508d..e85cc30eaf9e 100644 --- a/svtools/source/filter/igif/decode.hxx +++ b/svtools/source/filter/igif/decode.hxx @@ -40,29 +40,29 @@ class GIFLZWDecompressor HPBYTE pOutBuf; HPBYTE pOutBufData; HPBYTE pBlockBuf; - ULONG nInputBitsBuf; - USHORT nTableSize; - USHORT nClearCode; - USHORT nEOICode; - USHORT nCodeSize; - USHORT nOldCode; - USHORT nOutBufDataLen; - USHORT nInputBitsBufSize; - BOOL bEOIFound; - BYTE nDataSize; - BYTE nBlockBufSize; - BYTE nBlockBufPos; + sal_uLong nInputBitsBuf; + sal_uInt16 nTableSize; + sal_uInt16 nClearCode; + sal_uInt16 nEOICode; + sal_uInt16 nCodeSize; + sal_uInt16 nOldCode; + sal_uInt16 nOutBufDataLen; + sal_uInt16 nInputBitsBufSize; + sal_Bool bEOIFound; + sal_uInt8 nDataSize; + sal_uInt8 nBlockBufSize; + sal_uInt8 nBlockBufPos; - void AddToTable(USHORT nPrevCode, USHORT nCodeFirstData); - BOOL ProcessOneCode(); + void AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData); + sal_Bool ProcessOneCode(); public: - GIFLZWDecompressor( BYTE cDataSize ); + GIFLZWDecompressor( sal_uInt8 cDataSize ); ~GIFLZWDecompressor(); - HPBYTE DecompressBlock( HPBYTE pSrc, BYTE cBufSize, ULONG& rCount, BOOL& rEOI ); + HPBYTE DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize, sal_uLong& rCount, sal_Bool& rEOI ); }; #endif diff --git a/svtools/source/filter/igif/gifread.cxx b/svtools/source/filter/igif/gifread.cxx index e4020c727ff4..16318e5b143e 100644 --- a/svtools/source/filter/igif/gifread.cxx +++ b/svtools/source/filter/igif/gifread.cxx @@ -54,11 +54,11 @@ GIFReader::GIFReader( SvStream& rStm ) : nLogHeight100 ( 0UL ), nLoops ( 1 ), eActAction ( GLOBAL_HEADER_READING ), - bGCTransparent ( FALSE ), - bImGraphicReady ( FALSE ) + bGCTransparent ( sal_False ), + bImGraphicReady ( sal_False ) { maUpperName = UniString::CreateFromAscii( "SVIGIF", 6 ); - pSrcBuf = new BYTE[ 256 ]; + pSrcBuf = new sal_uInt8[ 256 ]; ClearImageExtensions(); } @@ -82,14 +82,14 @@ GIFReader::~GIFReader() void GIFReader::ClearImageExtensions() { nGCDisposalMethod = 0; - bGCTransparent = FALSE; + bGCTransparent = sal_False; nTimer = 0; } // ------------------------------------------------------------------------ -BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, - BOOL bWatchForBackgroundColor ) +sal_Bool GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, + sal_Bool bWatchForBackgroundColor ) { const Size aSize( nWidth, nHeight ); @@ -106,11 +106,11 @@ BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, if( pAcc1 ) { - cTransIndex1 = (BYTE) pAcc1->GetBestPaletteIndex( aWhite ); + cTransIndex1 = (sal_uInt8) pAcc1->GetBestPaletteIndex( aWhite ); cNonTransIndex1 = cTransIndex1 ? 0 : 1; } else - bStatus = FALSE; + bStatus = sal_False; } if( bStatus ) @@ -131,12 +131,12 @@ BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, // ------------------------------------------------------------------------ -BOOL GIFReader::ReadGlobalHeader() +sal_Bool GIFReader::ReadGlobalHeader() { char pBuf[ 7 ]; - BYTE nRF; - BYTE nAspect; - BOOL bRet = FALSE; + sal_uInt8 nRF; + sal_uInt8 nAspect; + sal_Bool bRet = sal_False; rIStm.Read( pBuf, 6 ); if( NO_PENDING( rIStm ) ) @@ -149,14 +149,14 @@ BOOL GIFReader::ReadGlobalHeader() { SvMemoryStream aMemStm; - aMemStm.SetBuffer( pBuf, 7, FALSE, 7 ); + aMemStm.SetBuffer( pBuf, 7, sal_False, 7 ); aMemStm >> nGlobalWidth; aMemStm >> nGlobalHeight; aMemStm >> nRF; aMemStm >> nBackgroundColor; aMemStm >> nAspect; - bGlobalPalette = (BOOL) ( nRF & 0x80 ); + bGlobalPalette = (sal_Bool) ( nRF & 0x80 ); if( bGlobalPalette ) ReadPaletteEntries( &aGPalette, 1 << ( ( nRF & 7 ) + 1 ) ); @@ -164,11 +164,11 @@ BOOL GIFReader::ReadGlobalHeader() nBackgroundColor = 0; if( NO_PENDING( rIStm ) ) - bRet = TRUE; + bRet = sal_True; } } else - bStatus = FALSE; + bStatus = sal_False; } return bRet; @@ -176,19 +176,19 @@ BOOL GIFReader::ReadGlobalHeader() // ------------------------------------------------------------------------ -void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount ) +void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ) { - const ULONG nLen = 3UL * nCount; - BYTE* pBuf = new BYTE[ nLen ]; + const sal_uLong nLen = 3UL * nCount; + sal_uInt8* pBuf = new sal_uInt8[ nLen ]; rIStm.Read( pBuf, nLen ); if( NO_PENDING( rIStm ) ) { - BYTE* pTmp = pBuf; + sal_uInt8* pTmp = pBuf; - for( ULONG i = 0UL; i < nCount; ) + for( sal_uLong i = 0UL; i < nCount; ) { - BitmapColor& rColor = (*pPal)[ (USHORT) i++ ]; + BitmapColor& rColor = (*pPal)[ (sal_uInt16) i++ ]; rColor.SetRed( *pTmp++ ); rColor.SetGreen( *pTmp++ ); @@ -210,13 +210,13 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount ) // ------------------------------------------------------------------------ -BOOL GIFReader::ReadExtension() +sal_Bool GIFReader::ReadExtension() { - BYTE cFunction; - BYTE cSize; - BYTE cByte; - BOOL bRet = FALSE; - BOOL bOverreadDataBlocks = FALSE; + sal_uInt8 cFunction; + sal_uInt8 cSize; + sal_uInt8 cByte; + sal_Bool bRet = sal_False; + sal_Bool bOverreadDataBlocks = sal_False; // Extension-Label rIStm >> cFunction; @@ -230,7 +230,7 @@ BOOL GIFReader::ReadExtension() // 'Graphic Control Extension' case( 0xf9 ) : { - BYTE cFlags; + sal_uInt8 cFlags; rIStm >> cFlags; rIStm >> nTimer; @@ -240,9 +240,9 @@ BOOL GIFReader::ReadExtension() if ( NO_PENDING( rIStm ) ) { nGCDisposalMethod = ( cFlags >> 2) & 7; - bGCTransparent = ( cFlags & 1 ) ? TRUE : FALSE; + bGCTransparent = ( cFlags & 1 ) ? sal_True : sal_False; bStatus = ( cSize == 4 ) && ( cByte == 0 ); - bRet = TRUE; + bRet = sal_True; } } break; @@ -253,7 +253,7 @@ BOOL GIFReader::ReadExtension() if ( NO_PENDING( rIStm ) ) { // default diese Extension ueberlesen - bOverreadDataBlocks = TRUE; + bOverreadDataBlocks = sal_True; // Appl.-Extension hat Laenge 11 if ( cSize == 0x0b ) @@ -276,12 +276,12 @@ BOOL GIFReader::ReadExtension() rIStm >> cByte; nLoops = cByte; rIStm >> cByte; - nLoops |= ( (USHORT) cByte << 8 ); + nLoops |= ( (sal_uInt16) cByte << 8 ); rIStm >> cByte; bStatus = ( cByte == 0 ); bRet = NO_PENDING( rIStm ); - bOverreadDataBlocks = FALSE; + bOverreadDataBlocks = sal_False; // Netscape interpretiert den LoopCount // als reine Anzahl der _Wiederholungen_; @@ -304,7 +304,7 @@ BOOL GIFReader::ReadExtension() rIStm >> cByte; bStatus = ( cByte == 0 ); bRet = NO_PENDING( rIStm ); - bOverreadDataBlocks = FALSE; + bOverreadDataBlocks = sal_False; } else rIStm.SeekRel( -1 ); @@ -317,25 +317,25 @@ BOOL GIFReader::ReadExtension() // alles andere ueberlesen default: - bOverreadDataBlocks = TRUE; + bOverreadDataBlocks = sal_True; break; } // Sub-Blocks ueberlesen if ( bOverreadDataBlocks ) { - bRet = TRUE; + bRet = sal_True; while( cSize && bStatus && !rIStm.IsEof() ) { - USHORT nCount = (USHORT) cSize + 1; + sal_uInt16 nCount = (sal_uInt16) cSize + 1; char* pBuffer = new char[ nCount ]; - bRet = FALSE; + bRet = sal_False; rIStm.Read( pBuffer, nCount ); if( NO_PENDING( rIStm ) ) { - cSize = (BYTE) pBuffer[ cSize ]; - bRet = TRUE; + cSize = (sal_uInt8) pBuffer[ cSize ]; + bRet = sal_True; } else cSize = 0; @@ -350,19 +350,19 @@ BOOL GIFReader::ReadExtension() // ------------------------------------------------------------------------ -BOOL GIFReader::ReadLocalHeader() +sal_Bool GIFReader::ReadLocalHeader() { - BYTE pBuf[ 9 ]; - BOOL bRet = FALSE; + sal_uInt8 pBuf[ 9 ]; + sal_Bool bRet = sal_False; rIStm.Read( pBuf, 9 ); if( NO_PENDING( rIStm ) ) { SvMemoryStream aMemStm; BitmapPalette* pPal; - BYTE nFlags; + sal_uInt8 nFlags; - aMemStm.SetBuffer( (char*) pBuf, 9, FALSE, 9 ); + aMemStm.SetBuffer( (char*) pBuf, 9, sal_False, 9 ); aMemStm >> nImagePosX; aMemStm >> nImagePosY; aMemStm >> nImageWidth; @@ -390,7 +390,7 @@ BOOL GIFReader::ReadLocalHeader() if( NO_PENDING( rIStm ) ) { CreateBitmaps( nImageWidth, nImageHeight, pPal, bGlobalPalette && ( pPal == &aGPalette ) ); - bRet = TRUE; + bRet = sal_True; } } @@ -399,11 +399,11 @@ BOOL GIFReader::ReadLocalHeader() // ------------------------------------------------------------------------ -ULONG GIFReader::ReadNextBlock() +sal_uLong GIFReader::ReadNextBlock() { - ULONG nRet = 0UL; - ULONG nRead; - BYTE cBlockSize; + sal_uLong nRet = 0UL; + sal_uLong nRead; + sal_uInt8 cBlockSize; rIStm >> cBlockSize; @@ -423,7 +423,7 @@ ULONG GIFReader::ReadNextBlock() nRet = 3UL; else { - BOOL bEOI; + sal_Bool bEOI; HPBYTE pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, bEOI ); nRet = ( bEOI ? 3 : 1 ); @@ -442,9 +442,9 @@ ULONG GIFReader::ReadNextBlock() // ------------------------------------------------------------------------ -void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) +void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount ) { - for( ULONG i = 0UL; i < nCount; i++ ) + for( sal_uLong i = 0UL; i < nCount; i++ ) { if( nImageX >= nImageWidth ) { @@ -463,9 +463,9 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) if( ( nMinY > nLastImageY ) && ( nLastImageY < ( nImageHeight - 1 ) ) ) { HPBYTE pScanline8 = pAcc8->GetScanline( nYAcc ); - ULONG nSize8 = pAcc8->GetScanlineSize(); + sal_uLong nSize8 = pAcc8->GetScanlineSize(); HPBYTE pScanline1 = 0; - ULONG nSize1 = 0; + sal_uLong nSize1 = 0; if( bGCTransparent ) { @@ -507,7 +507,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) } } - nLastImageY = (USHORT) nT1; + nLastImageY = (sal_uInt16) nT1; nYAcc = nT1; } else @@ -522,7 +522,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) if( nImageY < nImageHeight ) { - const BYTE cTmp = pBytes[ i ]; + const sal_uInt8 cTmp = pBytes[ i ]; if( bGCTransparent ) { @@ -539,7 +539,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) } else { - bOverreadBlock = TRUE; + bOverreadBlock = sal_True; break; } } @@ -566,7 +566,7 @@ void GIFReader::CreateNewBitmaps() aAnimBmp.aPosPix = Point( nImagePosX, nImagePosY ); aAnimBmp.aSizePix = Size( nImageWidth, nImageHeight ); aAnimBmp.nWait = ( nTimer != 65535 ) ? nTimer : ANIMATION_TIMEOUT_ON_CLICK; - aAnimBmp.bUserInput = FALSE; + aAnimBmp.bUserInput = sal_False; if( nGCDisposalMethod == 2 ) aAnimBmp.eDisposal = DISPOSE_BACK; @@ -617,10 +617,10 @@ const Graphic& GIFReader::GetIntermediateGraphic() // ------------------------------------------------------------------------ -BOOL GIFReader::ProcessGIF() +sal_Bool GIFReader::ProcessGIF() { - BOOL bRead = FALSE; - BOOL bEnd = FALSE; + sal_Bool bRead = sal_False; + sal_Bool bEnd = sal_False; if ( !bStatus ) eActAction = ABORT_READING; @@ -633,7 +633,7 @@ BOOL GIFReader::ProcessGIF() // naechsten Marker lesen case( MARKER_READING ): { - BYTE cByte; + sal_uInt8 cByte; rIStm >> cByte; @@ -641,7 +641,7 @@ BOOL GIFReader::ProcessGIF() eActAction = END_READING; else if( NO_PENDING( rIStm ) ) { - bRead = TRUE; + bRead = sal_True; if( cByte == '!' ) eActAction = EXTENSION_READING; @@ -658,7 +658,7 @@ BOOL GIFReader::ProcessGIF() // ScreenDescriptor lesen case( GLOBAL_HEADER_READING ): { - if( ( bRead = ReadGlobalHeader() ) == TRUE ) + if( ( bRead = ReadGlobalHeader() ) == sal_True ) { ClearImageExtensions(); eActAction = MARKER_READING; @@ -670,7 +670,7 @@ BOOL GIFReader::ProcessGIF() // Extension lesen case( EXTENSION_READING ): { - if( ( bRead = ReadExtension() ) == TRUE ) + if( ( bRead = ReadExtension() ) == sal_True ) eActAction = MARKER_READING; } break; @@ -679,7 +679,7 @@ BOOL GIFReader::ProcessGIF() // Image-Descriptor lesen case( LOCAL_HEADER_READING ): { - if( ( bRead = ReadLocalHeader() ) == TRUE ) + if( ( bRead = ReadLocalHeader() ) == sal_True ) { nYAcc = nImageX = nImageY = 0; eActAction = FIRST_BLOCK_READING; @@ -691,20 +691,20 @@ BOOL GIFReader::ProcessGIF() // ersten Datenblock lesen case( FIRST_BLOCK_READING ): { - BYTE cDataSize; + sal_uInt8 cDataSize; rIStm >> cDataSize; if( rIStm.IsEof() ) eActAction = ABORT_READING; else if( cDataSize > 12 ) - bStatus = FALSE; + bStatus = sal_False; else if( NO_PENDING( rIStm ) ) { - bRead = TRUE; + bRead = sal_True; pDecomp = new GIFLZWDecompressor( cDataSize ); eActAction = NEXT_BLOCK_READING; - bOverreadBlock = FALSE; + bOverreadBlock = sal_False; } else eActAction = FIRST_BLOCK_READING; @@ -714,20 +714,20 @@ BOOL GIFReader::ProcessGIF() // naechsten Datenblock lesen case( NEXT_BLOCK_READING ): { - USHORT nLastX = nImageX; - USHORT nLastY = nImageY; - ULONG nRet = ReadNextBlock(); + sal_uInt16 nLastX = nImageX; + sal_uInt16 nLastY = nImageY; + sal_uLong nRet = ReadNextBlock(); // Return: 0:Pending / 1:OK; / 2:OK und letzter Block: / 3:EOI / 4:HardAbort if( nRet ) { - bRead = TRUE; + bRead = sal_True; if ( nRet == 1UL ) { - bImGraphicReady = TRUE; + bImGraphicReady = sal_True; eActAction = NEXT_BLOCK_READING; - bOverreadBlock = FALSE; + bOverreadBlock = sal_False; } else { @@ -741,7 +741,7 @@ BOOL GIFReader::ProcessGIF() else if( nRet == 3UL ) { eActAction = NEXT_BLOCK_READING; - bOverreadBlock = TRUE; + bOverreadBlock = sal_True; } else { @@ -763,7 +763,7 @@ BOOL GIFReader::ProcessGIF() // ein Fehler trat auf case( ABORT_READING ): { - bEnd = TRUE; + bEnd = sal_True; eActAction = END_READING; } break; @@ -787,7 +787,7 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic ) { ReadState eReadState; - bStatus = TRUE; + bStatus = sal_True; while( ProcessGIF() && ( eActAction != END_READING ) ) {} @@ -824,12 +824,12 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic ) // - ImportGIF - // ------------- -BOOL ImportGIF( SvStream & rStm, Graphic& rGraphic ) +sal_Bool ImportGIF( SvStream & rStm, Graphic& rGraphic ) { GIFReader* pGIFReader = (GIFReader*) rGraphic.GetContext(); - USHORT nOldFormat = rStm.GetNumberFormatInt(); + sal_uInt16 nOldFormat = rStm.GetNumberFormatInt(); ReadState eReadState; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -841,7 +841,7 @@ BOOL ImportGIF( SvStream & rStm, Graphic& rGraphic ) if( eReadState == GIFREAD_ERROR ) { - bRet = FALSE; + bRet = sal_False; delete pGIFReader; } else if( eReadState == GIFREAD_OK ) diff --git a/svtools/source/filter/ixbm/xbmread.cxx b/svtools/source/filter/ixbm/xbmread.cxx index 9c7faaafa88c..5084f7267e46 100644 --- a/svtools/source/filter/ixbm/xbmread.cxx +++ b/svtools/source/filter/ixbm/xbmread.cxx @@ -44,7 +44,7 @@ XBMReader::XBMReader( SvStream& rStm ) : nLastPos ( rStm.Tell() ), nWidth ( 0 ), nHeight ( 0 ), - bStatus ( TRUE ) + bStatus ( sal_True ) { pHexTable = new short[ 256 ]; maUpperName = String::CreateFromAscii( "SVIXBM", 6 ); @@ -109,7 +109,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1, long nPos2; long nPos3; - bStatus = FALSE; + bStatus = sal_False; do { @@ -120,23 +120,23 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1, { if( ( nPos1 = aRet.Search( pTok1 ) ) != STRING_NOTFOUND ) { - bStatus = TRUE; + bStatus = sal_True; if( pTok2 ) { - bStatus = FALSE; + bStatus = sal_False; if( ( ( nPos2 = aRet.Search( pTok2 ) ) != STRING_NOTFOUND ) && ( nPos2 > nPos1 ) ) { - bStatus = TRUE; + bStatus = sal_True; if( pTok3 ) { - bStatus = FALSE; + bStatus = sal_False; if( ( ( nPos3 = aRet.Search( pTok3 ) ) != STRING_NOTFOUND ) && ( nPos3 > nPos2 ) ) - bStatus = TRUE; + bStatus = sal_True; } } } @@ -199,16 +199,16 @@ long XBMReader::ParseDefine( const sal_Char* pDefine ) // ------------------------------------------------------------------------ -BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat ) +sal_Bool XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat ) { ByteString aLine; long nRow = 0; long nCol = 0; long nBits = ( eFormat == XBM10 ) ? 16 : 8; long nBit; - USHORT nValue; - USHORT nDigits; - BOOL bFirstLine = TRUE; + sal_uInt16 nValue; + sal_uInt16 nDigits; + sal_Bool bFirstLine = sal_True; while( nRow < nHeight ) { @@ -220,20 +220,20 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor if( (nPos = ( aLine = aLastLine ).Search( '{' ) ) != STRING_NOTFOUND ) aLine.Erase( 0, nPos + 1 ); - bFirstLine = FALSE; + bFirstLine = sal_False; } else if( !pInStm->ReadLine( aLine ) ) break; if( aLine.Len() ) { - const USHORT nCount = aLine.GetTokenCount( ',' ); + const sal_uInt16 nCount = aLine.GetTokenCount( ',' ); - for( USHORT i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ ) + for( sal_uInt16 i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ ) { const ByteString aToken( aLine.GetToken( i, ',' ) ); const xub_StrLen nLen = aToken.Len(); - BOOL bProcessed = FALSE; + sal_Bool bProcessed = sal_False; nBit = nDigits = nValue = 0; @@ -246,11 +246,11 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor { nValue = ( nValue << 4 ) + nTable; nDigits++; - bProcessed = TRUE; + bProcessed = sal_True; } else if( ( nTable < 0 ) && nDigits ) { - bProcessed = TRUE; + bProcessed = sal_True; break; } } @@ -267,7 +267,7 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor } } - return TRUE; + return sal_True; } // ------------------------------------------------------------------------ @@ -275,7 +275,7 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor ReadState XBMReader::ReadXBM( Graphic& rGraphic ) { ReadState eReadState; - BYTE cDummy; + sal_uInt8 cDummy; // sehen, ob wir _alles_ lesen koennen rIStm.Seek( STREAM_SEEK_TO_END ); @@ -289,7 +289,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) int nValue; rIStm.Seek( nLastPos ); - bStatus = FALSE; + bStatus = sal_False; aLine = FindTokenLine( &rIStm, "#define", "_width" ); if ( bStatus ) @@ -308,7 +308,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) } } else - bStatus = FALSE; + bStatus = sal_False; if ( bStatus ) { @@ -326,7 +326,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) else if ( aLine.Search( "char" ) != STRING_NOTFOUND ) eFormat = XBM11; else - bStatus = FALSE; + bStatus = sal_False; if ( bStatus && nWidth && nHeight ) { @@ -340,7 +340,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) bStatus = ParseData( &rIStm, aLine, eFormat ); } else - bStatus = FALSE; + bStatus = sal_False; } } } @@ -372,11 +372,11 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) // - ImportXBM - // ------------- -BOOL ImportXBM( SvStream& rStm, Graphic& rGraphic ) +sal_Bool ImportXBM( SvStream& rStm, Graphic& rGraphic ) { XBMReader* pXBMReader = (XBMReader*) rGraphic.GetContext(); ReadState eReadState; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( !pXBMReader ) pXBMReader = new XBMReader( rStm ); @@ -386,7 +386,7 @@ BOOL ImportXBM( SvStream& rStm, Graphic& rGraphic ) if( eReadState == XBMREAD_ERROR ) { - bRet = FALSE; + bRet = sal_False; delete pXBMReader; } else if( eReadState == XBMREAD_OK ) diff --git a/svtools/source/filter/ixpm/rgbtable.hxx b/svtools/source/filter/ixpm/rgbtable.hxx index afdab883b369..054e1e86b064 100644 --- a/svtools/source/filter/ixpm/rgbtable.hxx +++ b/svtools/source/filter/ixpm/rgbtable.hxx @@ -28,9 +28,9 @@ struct XPMRGBTab { const char* name; - BYTE red; - BYTE green; - BYTE blue; + sal_uInt8 red; + sal_uInt8 green; + sal_uInt8 blue; }; static XPMRGBTab pRGBTable[] = { diff --git a/svtools/source/filter/ixpm/xpmread.cxx b/svtools/source/filter/ixpm/xpmread.cxx index 7575c94e3ed9..425ed6323bcc 100644 --- a/svtools/source/filter/ixpm/xpmread.cxx +++ b/svtools/source/filter/ixpm/xpmread.cxx @@ -51,8 +51,8 @@ XPMReader::XPMReader( SvStream& rStm ) : mnHeight ( 0 ), mnColors ( 0 ), mnCpp ( 0 ), - mbTransparent ( FALSE ), - mbStatus ( TRUE ), + mbTransparent ( sal_False ), + mbStatus ( sal_True ), mnStatus ( 0 ), mnIdentifier ( XPMIDENTIFIER ), mcThisByte ( 0 ), @@ -80,7 +80,7 @@ XPMReader::~XPMReader() ReadState XPMReader::ReadXPM( Graphic& rGraphic ) { ReadState eReadState; - BYTE cDummy; + sal_uInt8 cDummy; // sehen, ob wir _alles_ lesen koennen mrIStm.Seek( STREAM_SEEK_TO_END ); @@ -91,14 +91,14 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) if ( mrIStm.GetError() != ERRCODE_IO_PENDING ) { mrIStm.Seek( mnLastPos ); - mbStatus = TRUE; + mbStatus = sal_True; if ( mbStatus ) { - mpStringBuf = new BYTE [ XPMSTRINGBUF ]; - mpTempBuf = new BYTE [ XPMTEMPBUFSIZE ]; + mpStringBuf = new sal_uInt8 [ XPMSTRINGBUF ]; + mpTempBuf = new sal_uInt8 [ XPMTEMPBUFSIZE ]; - if ( ( mbStatus = ImplGetString() ) == TRUE ) + if ( ( mbStatus = ImplGetString() ) == sal_True ) { mnIdentifier = XPMVALUES; // Bitmap informationen einholen mnWidth = ImplGetULONG( 0 ); @@ -118,14 +118,14 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) // Farbe: ( mnCpp )Byte(s)-> ASCII Eintrag der der Farbe zugeordnet ist // 1 Byte -> 0xff wenn Farbe transparent ist // 3 Bytes -> RGB Wert der Farbe - mpColMap = new BYTE[ mnColors * ( 4 + mnCpp ) ]; + mpColMap = new sal_uInt8[ mnColors * ( 4 + mnCpp ) ]; if ( mpColMap ) { - for ( ULONG i = 0; i < mnColors; i++ ) + for ( sal_uLong i = 0; i < mnColors; i++ ) { - if ( ImplGetColor( i ) == FALSE ) + if ( ImplGetColor( i ) == sal_False ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } } @@ -149,35 +149,35 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) maBmp = Bitmap( Size( mnWidth, mnHeight ), nBits ); mpAcc = maBmp.AcquireWriteAccess(); - // mbTransparent ist TRUE wenn mindestens eine Farbe Transparent ist + // mbTransparent ist sal_True wenn mindestens eine Farbe Transparent ist if ( mbTransparent ) { maMaskBmp = Bitmap( Size( mnWidth, mnHeight ), 1 ); if ( ( mpMaskAcc = maMaskBmp.AcquireWriteAccess() ) == NULL ) - mbStatus = FALSE; + mbStatus = sal_False; } if( mpAcc && mbStatus ) { - ULONG i; + sal_uLong i; if ( mnColors <=256 ) // palette is only needed by using less than 257 { // colors - BYTE* pPtr = &mpColMap[mnCpp]; + sal_uInt8* pPtr = &mpColMap[mnCpp]; for ( i = 0; i < mnColors; i++ ) { - mpAcc->SetPaletteColor( (BYTE)i, Color( pPtr[1], pPtr[2], pPtr[3] ) ); + mpAcc->SetPaletteColor( (sal_uInt8)i, Color( pPtr[1], pPtr[2], pPtr[3] ) ); pPtr += ( mnCpp + 4 ); } // using 2 charakters per pixel and less than 257 Colors we speed up if ( mnCpp == 2 ) // by using a 64kb indexing table { - mpFastColorTable = new BYTE[ 256 * 256 ]; + mpFastColorTable = new sal_uInt8[ 256 * 256 ]; for ( pPtr = mpColMap, i = 0; i < mnColors; i++, pPtr += mnCpp + 4 ) { - ULONG j = pPtr[ 0 ] << 8; + sal_uLong j = pPtr[ 0 ] << 8; j += pPtr[ 1 ]; - mpFastColorTable[ j ] = (BYTE)i; + mpFastColorTable[ j ] = (sal_uInt8)i; } } } @@ -185,9 +185,9 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) mnIdentifier = XPMPIXELS; for ( i = 0; i < mnHeight; i++ ) { - if ( ImplGetScanLine( i ) == FALSE ) + if ( ImplGetScanLine( i ) == sal_False ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } } @@ -238,17 +238,17 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) // ------------------------------------------------------------------------ // ImplGetColor ermittelt saemtliche Farbwerte, -// die Rueckgabe ist TRUE wenn saemtliche Farben zugeordnet werden konnten +// die Rueckgabe ist sal_True wenn saemtliche Farben zugeordnet werden konnten -BOOL XPMReader::ImplGetColor( ULONG nNumb ) +sal_Bool XPMReader::ImplGetColor( sal_uLong nNumb ) { - BYTE* pString = mpStringBuf; - BYTE* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) ); - BOOL bStatus = ImplGetString(); + sal_uInt8* pString = mpStringBuf; + sal_uInt8* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) ); + sal_Bool bStatus = ImplGetString(); if ( bStatus ) { - for ( ULONG i = 0; i < mnCpp; i++ ) + for ( sal_uLong i = 0; i < mnCpp; i++ ) *pPtr++ = *pString++; bStatus = ImplGetColSub ( pPtr ); } @@ -259,11 +259,11 @@ BOOL XPMReader::ImplGetColor( ULONG nNumb ) // ImpGetScanLine liest den String mpBufSize aus und schreibt die Pixel in die // Bitmap. Der Parameter nY gibt die horizontale Position an. -BOOL XPMReader::ImplGetScanLine( ULONG nY ) +sal_Bool XPMReader::ImplGetScanLine( sal_uLong nY ) { - BOOL bStatus = ImplGetString(); - BYTE* pString = mpStringBuf; - BYTE* pColor; + sal_Bool bStatus = ImplGetString(); + sal_uInt8* pString = mpStringBuf; + sal_uInt8* pColor; BitmapColor aWhite; BitmapColor aBlack; @@ -275,18 +275,18 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY ) aBlack = mpMaskAcc->GetBestMatchingColor( Color( COL_BLACK ) ); } if ( mnStringSize != ( mnWidth * mnCpp )) - bStatus = FALSE; + bStatus = sal_False; else { - ULONG i, j; + sal_uLong i, j; if ( mpFastColorTable ) { for ( i = 0; i < mnWidth; i++ ) { j = (*pString++) << 8; j += *pString++; - BYTE k = (BYTE)mpFastColorTable[ j ]; - mpAcc->SetPixel( nY, i, BitmapColor( (BYTE)k ) ); + sal_uInt8 k = (sal_uInt8)mpFastColorTable[ j ]; + mpAcc->SetPixel( nY, i, BitmapColor( (sal_uInt8)k ) ); if ( mpMaskAcc ) mpMaskAcc->SetPixel( nY, i, @@ -298,12 +298,12 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY ) pColor = mpColMap; for ( j = 0; j < mnColors; j++ ) { - if ( ImplCompare( pString, pColor, mnCpp, XPMCASESENSITIVE ) == TRUE ) + if ( ImplCompare( pString, pColor, mnCpp, XPMCASESENSITIVE ) == sal_True ) { if ( mnColors > 256 ) mpAcc->SetPixel( nY, i, Color ( pColor[3], pColor[4], pColor[5] ) ); else - mpAcc->SetPixel( nY, i, BitmapColor( (BYTE) j ) ); + mpAcc->SetPixel( nY, i, BitmapColor( (sal_uInt8) j ) ); if ( mpMaskAcc ) mpMaskAcc->SetPixel( nY, i, ( @@ -326,11 +326,11 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY ) // wurde eine Farbe gefunden wird an pDest[1]..pDest[2] der RGB wert geschrieben // pDest[0] enthaelt 0xff wenn die Farbe transparent ist sonst 0 -BOOL XPMReader::ImplGetColSub( BYTE* pDest ) +sal_Bool XPMReader::ImplGetColSub( sal_uInt8* pDest ) { unsigned char cTransparent[] = "None"; - BOOL bColStatus = FALSE; + sal_Bool bColStatus = sal_False; if ( ImplGetColKey( 'c' ) || ImplGetColKey( 'm' ) || ImplGetColKey( 'g' ) ) { @@ -338,7 +338,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) if ( *mpPara == '#' ) { *pDest++ = 0; - bColStatus = TRUE; + bColStatus = sal_True; switch ( mnParaSize ) { case 25 : @@ -351,7 +351,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) ImplGetRGBHex ( pDest, 0 ); break; default: - bColStatus = FALSE; + bColStatus = sal_False; break; } } @@ -359,14 +359,14 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) else if ( ImplCompare( &cTransparent[0], mpPara, 4 )) { *pDest++ = 0xff; - bColStatus = TRUE; - mbTransparent = TRUE; + bColStatus = sal_True; + mbTransparent = sal_True; } // last we will try to get the colorname else if ( mnParaSize > 2 ) // name must enlarge the minimum size { - ULONG i = 0; - while ( TRUE ) + sal_uLong i = 0; + while ( sal_True ) { if ( pRGBTable[ i ].name == NULL ) break; @@ -375,7 +375,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) if ( ImplCompare ( (unsigned char*)pRGBTable[ i ].name, mpPara, mnParaSize, XPMCASENONSENSITIVE ) ) { - bColStatus = TRUE; + bColStatus = sal_True; *pDest++ = 0; *pDest++ = pRGBTable[ i ].red; *pDest++ = pRGBTable[ i ].green; @@ -391,11 +391,11 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) // ------------------------------------------------------------------------ // ImplGetColKey durchsuch den String mpStringBuf nach einem Parameter 'nKey' -// und gibt einen BOOL zurueck. ( wenn TRUE werden mpPara und mnParaSize gesetzt ) +// und gibt einen sal_Bool zurueck. ( wenn sal_True werden mpPara und mnParaSize gesetzt ) -BOOL XPMReader::ImplGetColKey( BYTE nKey ) +sal_Bool XPMReader::ImplGetColKey( sal_uInt8 nKey ) { - BYTE nTemp, nPrev = ' '; + sal_uInt8 nTemp, nPrev = ' '; mpPara = mpStringBuf + mnCpp + 1; mnParaSize = 0; @@ -430,7 +430,7 @@ BOOL XPMReader::ImplGetColKey( BYTE nKey ) } } } - return ( mnParaSize ) ? TRUE : FALSE; + return ( mnParaSize ) ? sal_True : sal_False; } // ------------------------------------------------------------------------ @@ -442,12 +442,12 @@ BOOL XPMReader::ImplGetColKey( BYTE nKey ) // 6 : '#12345678abcdefab12345678' " " " " -void XPMReader::ImplGetRGBHex( BYTE* pDest,ULONG nAdd ) +void XPMReader::ImplGetRGBHex( sal_uInt8* pDest,sal_uLong nAdd ) { - BYTE* pPtr = mpPara+1; - BYTE nHex, nTemp; + sal_uInt8* pPtr = mpPara+1; + sal_uInt8 nHex, nTemp; - for ( ULONG i = 0; i < 3; i++ ) + for ( sal_uLong i = 0; i < 3; i++ ) { nHex = (*pPtr++) - '0'; if ( nHex > 9 ) @@ -459,24 +459,24 @@ void XPMReader::ImplGetRGBHex( BYTE* pDest,ULONG nAdd ) nHex = ( nHex << 4 ) + nTemp; pPtr += nAdd; - *pDest++ = (BYTE)nHex; + *pDest++ = (sal_uInt8)nHex; } } // ------------------------------------------------------------------------ // ImplGetUlong gibt den wert einer bis zu 6stelligen ASCII-Dezimalzahl zurueck. -ULONG XPMReader::ImplGetULONG( ULONG nPara ) +sal_uLong XPMReader::ImplGetULONG( sal_uLong nPara ) { if ( ImplGetPara ( nPara ) ) { - ULONG nRetValue = 0; - BYTE* pPtr = mpPara; + sal_uLong nRetValue = 0; + sal_uInt8* pPtr = mpPara; if ( ( mnParaSize > 6 ) || ( mnParaSize == 0 ) ) return 0; - for ( ULONG i = 0; i < mnParaSize; i++ ) + for ( sal_uLong i = 0; i < mnParaSize; i++ ) { - BYTE j = (*pPtr++) - 48; + sal_uInt8 j = (*pPtr++) - 48; if ( j > 9 ) return 0; // ascii is invalid nRetValue*=10; nRetValue+=j; @@ -488,28 +488,28 @@ ULONG XPMReader::ImplGetULONG( ULONG nPara ) // ------------------------------------------------------------------------ -BOOL XPMReader::ImplCompare( BYTE* pSource, BYTE* pDest, ULONG nSize, ULONG nMode ) +sal_Bool XPMReader::ImplCompare( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nSize, sal_uLong nMode ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if ( nMode == XPMCASENONSENSITIVE ) { - for ( ULONG i = 0; i < nSize; i++ ) + for ( sal_uLong i = 0; i < nSize; i++ ) { if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) ) { - bRet = FALSE; + bRet = sal_False; break; } } } else { - for ( ULONG i = 0; i < nSize; i++ ) + for ( sal_uLong i = 0; i < nSize; i++ ) { if ( pSource[i] != pDest[i] ) { - bRet = FALSE; + bRet = sal_False; break; } } @@ -520,15 +520,15 @@ BOOL XPMReader::ImplCompare( BYTE* pSource, BYTE* pDest, ULONG nSize, ULONG nMod // ------------------------------------------------------------------------ // ImplGetPara versucht den nNumb ( 0...x ) Parameter aus mpStringBuf zu ermitteln. // Ein Parameter ist durch Spaces oder Tabs von den anderen getrennt. -// Konnte der Parameter gefunden werden ist der Rueckgabewert TRUE und mpPara + mnParaSize +// Konnte der Parameter gefunden werden ist der Rueckgabewert sal_True und mpPara + mnParaSize // werden gesetzt. -BOOL XPMReader::ImplGetPara ( ULONG nNumb ) +sal_Bool XPMReader::ImplGetPara ( sal_uLong nNumb ) { - BYTE nByte; - ULONG pSize = 0; - BYTE* pPtr = mpStringBuf; - ULONG nCount = 0; + sal_uInt8 nByte; + sal_uLong pSize = 0; + sal_uInt8* pPtr = mpStringBuf; + sal_uLong nCount = 0; if ( ( *pPtr != ' ' ) && ( *pPtr != 0x09 ) ) { @@ -570,7 +570,7 @@ BOOL XPMReader::ImplGetPara ( ULONG nNumb ) pSize++; pPtr++; } - return ( ( nCount == nNumb ) && ( mpPara ) ) ? TRUE : FALSE; + return ( ( nCount == nNumb ) && ( mpPara ) ) ? sal_True : sal_False; } // ------------------------------------------------------------------------ @@ -578,10 +578,10 @@ BOOL XPMReader::ImplGetPara ( ULONG nNumb ) // mnStringSize enthaelt die Groesse des gelesenen Strings. // Bemerkungen wie '//' und '/*.....*/' werden uebersprungen. -BOOL XPMReader::ImplGetString( void ) +sal_Bool XPMReader::ImplGetString( void ) { - BYTE sID[] = "/* XPM */"; - BYTE* pString = mpStringBuf; + sal_uInt8 sID[] = "/* XPM */"; + sal_uInt8* pString = mpStringBuf; mnStringSize = 0; mpStringBuf[0] = 0; @@ -600,13 +600,13 @@ BOOL XPMReader::ImplGetString( void ) { if ( mnTempAvail <= 50 ) { - mbStatus = FALSE; // file is too short to be a correct XPM format + mbStatus = sal_False; // file is too short to be a correct XPM format break; } for ( int i = 0; i < 9; i++ ) // searching for "/* XPM */" if ( *mpTempPtr++ != sID[i] ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } mnTempAvail-=9; @@ -638,7 +638,7 @@ BOOL XPMReader::ImplGetString( void ) } if ( mnStringSize >= ( XPMSTRINGBUF - 1 ) ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } *pString++ = mcThisByte; @@ -676,11 +676,11 @@ BOOL XPMReader::ImplGetString( void ) // - ImportXPM - // ------------- -BOOL ImportXPM( SvStream& rStm, Graphic& rGraphic ) +sal_Bool ImportXPM( SvStream& rStm, Graphic& rGraphic ) { XPMReader* pXPMReader = (XPMReader*) rGraphic.GetContext(); ReadState eReadState; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( !pXPMReader ) pXPMReader = new XPMReader( rStm ); @@ -690,7 +690,7 @@ BOOL ImportXPM( SvStream& rStm, Graphic& rGraphic ) if( eReadState == XPMREAD_ERROR ) { - bRet = FALSE; + bRet = sal_False; delete pXPMReader; } else if( eReadState == XPMREAD_OK ) diff --git a/svtools/source/filter/jpeg/jpeg.cxx b/svtools/source/filter/jpeg/jpeg.cxx index a2de92171af3..dff6ec8ff51f 100644 --- a/svtools/source/filter/jpeg/jpeg.cxx +++ b/svtools/source/filter/jpeg/jpeg.cxx @@ -32,12 +32,10 @@ extern "C" { - #define INT32 JPEG_INT32 #include "stdio.h" #include "jpeg.h" #include "jpeglib.h" #include "jerror.h" - #undef INT32 } #define _JPEGPRIVATE @@ -125,7 +123,7 @@ extern "C" int empty_output_buffer (j_compress_ptr cinfo) dest->pub.next_output_byte = dest->buffer; dest->pub.free_in_buffer = BUF_SIZE; - return TRUE; + return sal_True; } extern "C" void term_destination (j_compress_ptr cinfo) @@ -189,7 +187,7 @@ extern "C" void init_source (j_decompress_ptr cinfo) * but we don't clear the input buffer. * This is correct behavior for reading a series of images from one source. */ - src->start_of_file = TRUE; + src->start_of_file = sal_True; } long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize ) @@ -238,9 +236,9 @@ extern "C" int fill_input_buffer (j_decompress_ptr cinfo) src->pub.next_input_byte = src->buffer; src->pub.bytes_in_buffer = nbytes; - src->start_of_file = FALSE; + src->start_of_file = sal_False; - return TRUE; + return sal_True; } extern "C" void skip_input_data (j_decompress_ptr cinfo, long num_bytes) @@ -255,7 +253,7 @@ extern "C" void skip_input_data (j_decompress_ptr cinfo, long num_bytes) while (num_bytes > (long) src->pub.bytes_in_buffer) { num_bytes -= (long) src->pub.bytes_in_buffer; (void) fill_input_buffer(cinfo); - /* note we assume that fill_input_buffer will never return FALSE, + /* note we assume that fill_input_buffer will never return sal_False, * so suspension need not be handled. */ } @@ -350,9 +348,9 @@ void* JPEGReader::CreateBitmap( void* pParam ) { BitmapPalette aGrayPal( 256 ); - for( USHORT n = 0; n < 256; n++ ) + for( sal_uInt16 n = 0; n < 256; n++ ) { - const BYTE cGray = (BYTE) n; + const sal_uInt8 cGray = (sal_uInt8) n; aGrayPal[ n ] = BitmapColor( cGray, cGray, cGray ); } @@ -386,7 +384,7 @@ void* JPEGReader::CreateBitmap( void* pParam ) { long nAlignedWidth; - const ULONG nFormat = pAcc->GetScanlineFormat(); + const sal_uLong nFormat = pAcc->GetScanlineFormat(); if( ( bGray && ( BMP_FORMAT_8BIT_PAL == nFormat ) ) || @@ -400,7 +398,7 @@ void* JPEGReader::CreateBitmap( void* pParam ) else { nAlignedWidth = AlignedWidth4Bytes( aSize.Width() * ( bGray ? 8 : 24 ) ); - ((JPEGCreateBitmapParam*)pParam)->bTopDown = TRUE; + ((JPEGCreateBitmapParam*)pParam)->bTopDown = sal_True; pBmpBuf = pBuffer = rtl_allocateMemory( nAlignedWidth * aSize.Height() ); } ((JPEGCreateBitmapParam*)pParam)->nAlignedWidth = nAlignedWidth; @@ -425,9 +423,9 @@ void JPEGReader::FillBitmap() { BitmapColor* pCols = new BitmapColor[ 256 ]; - for( USHORT n = 0; n < 256; n++ ) + for( sal_uInt16 n = 0; n < 256; n++ ) { - const BYTE cGray = (BYTE) n; + const sal_uInt8 cGray = (sal_uInt8) n; pCols[ n ] = pAcc->GetBestMatchingColor( BitmapColor( cGray, cGray, cGray ) ); } @@ -435,7 +433,7 @@ void JPEGReader::FillBitmap() for( long nY = 0L; nY < nHeight; nY++ ) { - pTmp = (BYTE*) pBuffer + nY * nAlignedWidth; + pTmp = (sal_uInt8*) pBuffer + nY * nAlignedWidth; for( long nX = 0L; nX < nWidth; nX++ ) pAcc->SetPixel( nY, nX, pCols[ *pTmp++ ] ); @@ -449,7 +447,7 @@ void JPEGReader::FillBitmap() for( long nY = 0L; nY < nHeight; nY++ ) { - pTmp = (BYTE*) pBuffer + nY * nAlignedWidth; + pTmp = (sal_uInt8*) pBuffer + nY * nAlignedWidth; for( long nX = 0L; nX < nWidth; nX++ ) { @@ -515,8 +513,8 @@ ReadState JPEGReader::Read( Graphic& rGraphic ) long nEndPos; long nLines; ReadState eReadState; - BOOL bRet = FALSE; - BYTE cDummy; + sal_Bool bRet = sal_False; + sal_uInt8 cDummy; #if 1 // TODO: is it possible to get rid of this seek to the end? // check if the stream's end is already available @@ -562,10 +560,10 @@ ReadState JPEGReader::Read( Graphic& rGraphic ) else rGraphic = aBmp; - bRet = TRUE; + bRet = sal_True; } else if( rIStm.GetError() == ERRCODE_IO_PENDING ) - bRet = TRUE; + bRet = sal_True; // Status setzen ( Pending hat immer Vorrang ) if( rIStm.GetError() == ERRCODE_IO_PENDING ) @@ -629,13 +627,13 @@ void* JPEGWriter::GetScanline( long nY ) { BitmapColor aColor; long nWidth = pAcc->Width(); - BYTE* pTmp = pBuffer; + sal_uInt8* pTmp = pBuffer; if( pAcc->HasPalette() ) { for( long nX = 0L; nX < nWidth; nX++ ) { - aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) ); + aColor = pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) ); *pTmp++ = aColor.GetRed(); if ( bGreys ) continue; @@ -665,9 +663,9 @@ void* JPEGWriter::GetScanline( long nY ) // ------------------------------------------------------------------------ -BOOL JPEGWriter::Write( const Graphic& rGraphic ) +sal_Bool JPEGWriter::Write( const Graphic& rGraphic ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( xStatusIndicator.is() ) { @@ -696,7 +694,7 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) BitmapColor aColor; for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ ) { - aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) ) + aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) ) : pAcc->GetPixel( nY, nX ); bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( aColor.GetRed() == aColor.GetBlue() ); } @@ -713,11 +711,11 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ); if( !bNative ) - pBuffer = new BYTE[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ]; + pBuffer = new sal_uInt8[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ]; JPEGCallbackStruct aCallbackData; aCallbackData.xStatusIndicator = xStatusIndicator; - bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData ); + bRet = (sal_Bool) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData ); delete[] pBuffer; pBuffer = NULL; @@ -735,11 +733,11 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) // - ImportJPEG - // -------------- -BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ) +sal_Bool ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ) { JPEGReader* pJPEGReader = (JPEGReader*) rGraphic.GetContext(); ReadState eReadState; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( !pJPEGReader ) pJPEGReader = new JPEGReader( rStm, pCallerData, ( nImportFlags & GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG ) != 0 ); @@ -754,7 +752,7 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 if( eReadState == JPEGREAD_ERROR ) { - bRet = FALSE; + bRet = sal_False; delete pJPEGReader; } else if( eReadState == JPEGREAD_OK ) @@ -769,7 +767,7 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 // - ExportJPEG - // -------------- -BOOL ExportJPEG( SvStream& rOStm, const Graphic& rGraphic, +sal_Bool ExportJPEG( SvStream& rOStm, const Graphic& rGraphic, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData, bool* pExportWasGrey ) diff --git a/svtools/source/filter/jpeg/jpeg.h b/svtools/source/filter/jpeg/jpeg.h index 82a2f80a838c..ca9b294d2f9d 100644 --- a/svtools/source/filter/jpeg/jpeg.h +++ b/svtools/source/filter/jpeg/jpeg.h @@ -50,7 +50,6 @@ struct JPEGCreateBitmapParam }; typedef struct my_error_mgr* my_error_ptr; -typedef unsigned char BYTE; typedef unsigned char* HPBYTE; void* JPEGMalloc( size_t size ); diff --git a/svtools/source/filter/jpeg/jpegc.c b/svtools/source/filter/jpeg/jpegc.c index 29b4749a7b51..8d3a82a86ef3 100644 --- a/svtools/source/filter/jpeg/jpegc.c +++ b/svtools/source/filter/jpeg/jpegc.c @@ -100,13 +100,13 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines ) jpeg_create_decompress( &cinfo ); bDecompCreated = 1; jpeg_svstream_src( &cinfo, pIStm ); - jpeg_read_header( &cinfo, TRUE ); + jpeg_read_header( &cinfo, sal_True ); cinfo.scale_num = 1; cinfo.scale_denom = 1; cinfo.output_gamma = 1.0; - cinfo.raw_data_out = FALSE; - cinfo.quantize_colors = FALSE; + cinfo.raw_data_out = sal_False; + cinfo.quantize_colors = sal_False; if ( cinfo.jpeg_color_space == JCS_YCbCr ) cinfo.out_color_space = JCS_RGB; else if ( cinfo.jpeg_color_space == JCS_YCCK ) @@ -138,8 +138,8 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines ) if( cinfo.scale_denom > 1 ) { cinfo.dct_method = JDCT_FASTEST; - cinfo.do_fancy_upsampling = FALSE; - cinfo.do_block_smoothing = FALSE; + cinfo.do_fancy_upsampling = sal_False; + cinfo.do_block_smoothing = sal_False; } } @@ -253,12 +253,12 @@ long WriteJPEG( void* pJPEGWriter, void* pOStm, } jpeg_set_defaults( &cinfo ); - jpeg_set_quality( &cinfo, (int) nQualityPercent, FALSE ); + jpeg_set_quality( &cinfo, (int) nQualityPercent, sal_False ); if ( ( nWidth > 128 ) || ( nHeight > 128 ) ) jpeg_simple_progression( &cinfo ); - jpeg_start_compress( &cinfo, TRUE ); + jpeg_start_compress( &cinfo, sal_True ); for( nY = 0; nY < nHeight; nY++ ) { diff --git a/svtools/source/filter/sgfbram.cxx b/svtools/source/filter/sgfbram.cxx index 3d1a71f5a2db..9b981f8c0d94 100644 --- a/svtools/source/filter/sgfbram.cxx +++ b/svtools/source/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/sgvmain.cxx b/svtools/source/filter/sgvmain.cxx index 293c6dab7964..3b0f3ebd2912 100644 --- a/svtools/source/filter/sgvmain.cxx +++ b/svtools/source/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/sgvspln.cxx b/svtools/source/filter/sgvspln.cxx index d695e171a194..aac7e1f04e0a 100644 --- a/svtools/source/filter/sgvspln.cxx +++ b/svtools/source/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/sgvtext.cxx b/svtools/source/filter/sgvtext.cxx index 9a82cd486599..f0130b21c9d6 100644 --- a/svtools/source/filter/sgvtext.cxx +++ b/svtools/source/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; diff --git a/svtools/source/filter/wmf/emfwr.cxx b/svtools/source/filter/wmf/emfwr.cxx index 4405db28966a..99ca92c76abb 100644 --- a/svtools/source/filter/wmf/emfwr.cxx +++ b/svtools/source/filter/wmf/emfwr.cxx @@ -169,18 +169,18 @@ // - EMFWriter - // ------------- -BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pFilterConfigItem ) +sal_Bool EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pFilterConfigItem ) { - const ULONG nHeaderPos = rOStm.Tell(); + const sal_uLong nHeaderPos = rOStm.Tell(); - mpHandlesUsed = new BOOL[ MAXHANDLES ]; - memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( BOOL ) ); + mpHandlesUsed = new sal_Bool[ MAXHANDLES ]; + memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( sal_Bool ) ); mnHorTextAlign = mnHandleCount = mnLastPercent = mnRecordPos = mnRecordCount = 0; mnLineHandle = mnFillHandle = mnTextHandle = HANDLE_INVALID; - mbRecordOpen = FALSE; + mbRecordOpen = sal_False; mpStm = &rOStm; - maVDev.EnableOutput( FALSE ); + maVDev.EnableOutput( sal_False ); maVDev.SetMapMode( rMtf.GetPrefMapMode() ); mpFilterConfigItem = pFilterConfigItem; @@ -198,29 +198,29 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig // set 100th mm map mode in EMF ImplBeginRecord( WIN_EMR_SETMAPMODE ); - (*mpStm) << (INT32) MM_ANISOTROPIC; + (*mpStm) << (sal_Int32) MM_ANISOTROPIC; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETVIEWPORTEXTEX ); - (*mpStm) << (INT32) maVDev.ImplGetDPIX() << (INT32) maVDev.ImplGetDPIY(); + (*mpStm) << (sal_Int32) maVDev.ImplGetDPIX() << (sal_Int32) maVDev.ImplGetDPIY(); ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETWINDOWEXTEX ); - (*mpStm) << (INT32) 2540 << (INT32) 2540; + (*mpStm) << (sal_Int32) 2540 << (sal_Int32) 2540; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETVIEWPORTORGEX ); - (*mpStm) << (INT32) 0 << (INT32) 0; + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETWINDOWORGEX ); - (*mpStm) << (INT32) 0 << (INT32) 0; + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0; ImplEndRecord(); ImplWriteRasterOp( ROP_OVERPAINT ); ImplBeginRecord( WIN_EMR_SETBKMODE ); - (*mpStm) << (UINT32) 1; // TRANSPARENT + (*mpStm) << (sal_uInt32) 1; // TRANSPARENT ImplEndRecord(); // write emf data @@ -234,17 +234,17 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig // write header - const ULONG nEndPos = mpStm->Tell(); mpStm->Seek( nHeaderPos ); - - (*mpStm) << (UINT32) 0x00000001 << (UINT32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object - << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizePix.Width() - 1 ) << (INT32) ( aMtfSizePix.Height() - 1 ) - << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizeLog.Width() - 1 ) << (INT32) ( aMtfSizeLog.Height() - 1 ) - << (UINT32) 0x464d4520 << (UINT32) 0x10000 << (UINT32) ( nEndPos - nHeaderPos ) - << (UINT32) mnRecordCount << (UINT16) ( mnHandleCount + 1 ) << (UINT16) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 - << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height() - << (INT32) ( aMtfSizeLog.Width() / 100 ) << (INT32) ( aMtfSizeLog.Height() / 100 ) - << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 - << (INT32) ( aMtfSizeLog.Width() * 10 ) << (INT32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object + const sal_uLong nEndPos = mpStm->Tell(); mpStm->Seek( nHeaderPos ); + + (*mpStm) << (sal_uInt32) 0x00000001 << (sal_uInt32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object + << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) ( aMtfSizePix.Width() - 1 ) << (sal_Int32) ( aMtfSizePix.Height() - 1 ) + << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) ( aMtfSizeLog.Width() - 1 ) << (sal_Int32) ( aMtfSizeLog.Height() - 1 ) + << (sal_uInt32) 0x464d4520 << (sal_uInt32) 0x10000 << (sal_uInt32) ( nEndPos - nHeaderPos ) + << (sal_uInt32) mnRecordCount << (sal_uInt16) ( mnHandleCount + 1 ) << (sal_uInt16) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 + << (sal_Int32) aMtfSizePix.Width() << (sal_Int32) aMtfSizePix.Height() + << (sal_Int32) ( aMtfSizeLog.Width() / 100 ) << (sal_Int32) ( aMtfSizeLog.Height() / 100 ) + << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 + << (sal_Int32) ( aMtfSizeLog.Width() * 10 ) << (sal_Int32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object mpStm->Seek( nEndPos ); delete[] mpHandlesUsed; @@ -254,15 +254,15 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig // ----------------------------------------------------------------------------- -ULONG EMFWriter::ImplAcquireHandle() +sal_uLong EMFWriter::ImplAcquireHandle() { - ULONG nHandle = HANDLE_INVALID; + sal_uLong nHandle = HANDLE_INVALID; - for( ULONG i = 0; i < MAXHANDLES && ( HANDLE_INVALID == nHandle ); i++ ) + for( sal_uLong i = 0; i < MAXHANDLES && ( HANDLE_INVALID == nHandle ); i++ ) { if( !mpHandlesUsed[ i ] ) { - mpHandlesUsed[ i ] = TRUE; + mpHandlesUsed[ i ] = sal_True; if( ( nHandle = i ) == mnHandleCount ) mnHandleCount++; @@ -275,10 +275,10 @@ ULONG EMFWriter::ImplAcquireHandle() // ----------------------------------------------------------------------------- -void EMFWriter::ImplReleaseHandle( ULONG nHandle ) +void EMFWriter::ImplReleaseHandle( sal_uLong nHandle ) { DBG_ASSERT( nHandle && ( nHandle < MAXHANDLES ), "Handle out of range" ); - mpHandlesUsed[ nHandle - 1 ] = FALSE; + mpHandlesUsed[ nHandle - 1 ] = sal_False; } // ----------------------------------------------------------------------------- @@ -289,7 +289,7 @@ void EMFWriter::ImplBeginRecord( sal_uInt32 nType ) if( !mbRecordOpen ) { - mbRecordOpen = TRUE; + mbRecordOpen = sal_True; mnRecordPos = mpStm->Tell(); (*mpStm) << nType; @@ -316,17 +316,17 @@ void EMFWriter::ImplEndRecord() while( nFillBytes-- ) *mpStm << (sal_uInt8)0; mnRecordCount++; - mbRecordOpen = FALSE; + mbRecordOpen = sal_False; } } // ----------------------------------------------------------------------------- -BOOL EMFWriter::ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType ) +sal_Bool EMFWriter::ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uLong nSelectType ) { if( rHandle != HANDLE_INVALID ) { - UINT32 nStockObject = 0x80000000; + sal_uInt32 nStockObject = 0x80000000; if( LINE_SELECT == nSelectType ) nStockObject |= 0x00000007; @@ -411,7 +411,7 @@ void EMFWriter::ImplCheckTextAttr() (*mpStm) << mnTextHandle; ImplWriteExtent( -rFont.GetSize().Height() ); ImplWriteExtent( rFont.GetSize().Width() ); - (*mpStm) << (INT32) rFont.GetOrientation() << (INT32) rFont.GetOrientation(); + (*mpStm) << (sal_Int32) rFont.GetOrientation() << (sal_Int32) rFont.GetOrientation(); switch( rFont.GetWeight() ) { @@ -429,11 +429,11 @@ void EMFWriter::ImplCheckTextAttr() } (*mpStm) << nWeight; - (*mpStm) << (BYTE) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 ); - (*mpStm) << (BYTE) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 ); - (*mpStm) << (BYTE) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 ); - (*mpStm) << (BYTE) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 ); - (*mpStm) << (BYTE) 0 << (BYTE) 0 << (BYTE) 0; + (*mpStm) << (sal_uInt8) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 ); + (*mpStm) << (sal_uInt8) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 ); + (*mpStm) << (sal_uInt8) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 ); + (*mpStm) << (sal_uInt8) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 ); + (*mpStm) << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0; switch( rFont.GetPitch() ) { @@ -466,24 +466,24 @@ void EMFWriter::ImplCheckTextAttr() (*mpStm) << (sal_Unicode) 0; // dummy elfVersion, elfStyleSize, elfMatch, elfReserved - (*mpStm) << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 ; + (*mpStm) << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 ; // dummy elfVendorId - (*mpStm) << (UINT32) 0; + (*mpStm) << (sal_uInt32) 0; // dummy elfCulture - (*mpStm) << (UINT32) 0; + (*mpStm) << (sal_uInt32) 0; // dummy elfPanose - (*mpStm) << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0; + (*mpStm) << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0; // fill record to get a record size divideable by 4 - (*mpStm) << (UINT16) 0; + (*mpStm) << (sal_uInt16) 0; ImplEndRecord(); // TextAlign - UINT32 nTextAlign; + sal_uInt32 nTextAlign; switch( rFont.GetAlign() ) { @@ -512,10 +512,10 @@ void EMFWriter::ImplCheckTextAttr() void EMFWriter::ImplWriteColor( const Color& rColor ) { - UINT32 nCol = rColor.GetRed(); + sal_uInt32 nCol = rColor.GetRed(); - nCol |= ( (UINT32) rColor.GetGreen() ) << 8; - nCol |= ( (UINT32) rColor.GetBlue() ) << 16; + nCol |= ( (sal_uInt32) rColor.GetGreen() ) << 8; + nCol |= ( (sal_uInt32) rColor.GetBlue() ) << 16; (*mpStm) << nCol; } @@ -524,7 +524,7 @@ void EMFWriter::ImplWriteColor( const Color& rColor ) void EMFWriter::ImplWriteRasterOp( RasterOp eRop ) { - UINT32 nROP2; + sal_uInt32 nROP2; switch( eRop ) { @@ -543,7 +543,7 @@ void EMFWriter::ImplWriteRasterOp( RasterOp eRop ) void EMFWriter::ImplWriteExtent( long nExtent ) { nExtent = maVDev.LogicToLogic( Size( nExtent, 0 ), maVDev.GetMapMode(), maDestMapMode ).Width(); - (*mpStm) << (INT32) nExtent; + (*mpStm) << (sal_Int32) nExtent; } // ----------------------------------------------------------------------------- @@ -551,7 +551,7 @@ void EMFWriter::ImplWriteExtent( long nExtent ) void EMFWriter::ImplWritePoint( const Point& rPoint ) { const Point aPoint( maVDev.LogicToLogic( rPoint, maVDev.GetMapMode(), maDestMapMode )); - (*mpStm) << (INT32) aPoint.X() << (INT32) aPoint.Y(); + (*mpStm) << (sal_Int32) aPoint.X() << (sal_Int32) aPoint.Y(); } // ----------------------------------------------------------------------------- @@ -559,7 +559,7 @@ void EMFWriter::ImplWritePoint( const Point& rPoint ) void EMFWriter::ImplWriteSize( const Size& rSize) { const Size aSize( maVDev.LogicToLogic( rSize, maVDev.GetMapMode(), maDestMapMode )); - (*mpStm) << (INT32) aSize.Width() << (INT32) aSize.Height(); + (*mpStm) << (sal_Int32) aSize.Width() << (sal_Int32) aSize.Height(); } // ----------------------------------------------------------------------------- @@ -572,7 +572,7 @@ void EMFWriter::ImplWriteRect( const Rectangle& rRect ) // ----------------------------------------------------------------------------- -void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose ) +void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose ) { if( rPoly.GetSize() ) { @@ -587,9 +587,9 @@ void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose ) ImplBeginRecord( bClose ? WIN_EMR_POLYGON : WIN_EMR_POLYLINE ); ImplWriteRect( rPoly.GetBoundRect() ); - (*mpStm) << (UINT32) rPoly.GetSize(); + (*mpStm) << (sal_uInt32) rPoly.GetSize(); - for( USHORT i = 0; i < rPoly.GetSize(); i++ ) + for( sal_uInt16 i = 0; i < rPoly.GetSize(); i++ ) ImplWritePoint( rPoly[ i ] ); ImplEndRecord(); @@ -606,7 +606,7 @@ void EMFWriter::ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly ) if( nPolyCount ) { if( 1 == nPolyCount ) - ImplWritePolygonRecord( rPolyPoly[ 0 ], TRUE ); + ImplWritePolygonRecord( rPolyPoly[ 0 ], sal_True ); else { sal_Bool bHasFlags = sal_False; @@ -738,7 +738,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed ) // ----------------------------------------------------------------------------- void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, - const Size& rSz, UINT32 nROP ) + const Size& rSz, sal_uInt32 nROP ) { if( !!rBmp ) { @@ -748,19 +748,19 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, ImplBeginRecord( WIN_EMR_STRETCHDIBITS ); ImplWriteRect( Rectangle( rPt, rSz ) ); ImplWritePoint( rPt ); - (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) aBmpSizePixel.Width() << (INT32) aBmpSizePixel.Height(); + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) aBmpSizePixel.Width() << (sal_Int32) aBmpSizePixel.Height(); // write offset positions and sizes later - const ULONG nOffPos = mpStm->Tell(); + const sal_uLong nOffPos = mpStm->Tell(); mpStm->SeekRel( 16 ); - (*mpStm) << (UINT32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP ); + (*mpStm) << (sal_uInt32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP ); ImplWriteSize( rSz ); - rBmp.Write( aMemStm, TRUE, FALSE ); + rBmp.Write( aMemStm, sal_True, sal_False ); - UINT32 nDIBSize = aMemStm.Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize; - UINT16 nBitCount; + sal_uInt32 nDIBSize = aMemStm.Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize; + sal_uInt16 nBitCount; // get DIB parameters aMemStm.Seek( 0 ); @@ -770,15 +770,15 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, aMemStm.SeekRel( 8 ); aMemStm >> nColsUsed; - nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (UINT32) nBitCount ) ) : + nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (sal_uInt32) nBitCount ) ) : ( ( 3 == nCompression ) ? 12 : 0 ); mpStm->Write( aMemStm.GetData(), nDIBSize ); - const ULONG nEndPos = mpStm->Tell(); + const sal_uLong nEndPos = mpStm->Tell(); mpStm->Seek( nOffPos ); - (*mpStm) << (UINT32) 80 << (UINT32)( nHeaderSize + ( nPalCount << 2 ) ); - (*mpStm) << (UINT32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize; + (*mpStm) << (sal_uInt32) 80 << (sal_uInt32)( nHeaderSize + ( nPalCount << 2 ) ); + (*mpStm) << (sal_uInt32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize; mpStm->Seek( nEndPos ); ImplEndRecord(); @@ -828,12 +828,12 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons ImplBeginRecord( WIN_EMR_EXTTEXTOUTW ); ImplWriteRect( Rectangle( rPos, Size( nNormWidth, maVDev.GetTextHeight() ) ) ); - (*mpStm) << (UINT32)1; - (*mpStm) << (INT32) 0 << (INT32) 0; + (*mpStm) << (sal_uInt32)1; + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0; ImplWritePoint( rPos ); - (*mpStm) << (UINT32) nLen << (UINT32) 76 << (UINT32) 2; - (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) 0 << (INT32) 0; - (*mpStm) << (UINT32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) ); + (*mpStm) << (sal_uInt32) nLen << (sal_uInt32) 76 << (sal_uInt32) 2; + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) 0; + (*mpStm) << (sal_uInt32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) ); // write text for( i = 0; i < nLen; i++ ) @@ -841,7 +841,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons // padding word if( nLen & 1 ) - (*mpStm) << (UINT16) 0; + (*mpStm) << (sal_uInt16) 0; // write DX array ImplWriteExtent( pDX[ 0 ] ); @@ -875,7 +875,7 @@ void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const bas for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++) { const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a)); - ImplWritePolygonRecord( Polygon(aCandidate), FALSE ); + ImplWritePolygonRecord( Polygon(aCandidate), sal_False ); } } @@ -903,10 +903,10 @@ void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const bas void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { - for( ULONG j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ ) + for( sal_uLong j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ ) { const MetaAction* pAction = rMtf.GetAction( j ); - const USHORT nType = pAction->GetType(); + const sal_uInt16 nType = pAction->GetType(); switch( nType ) { @@ -1074,7 +1074,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { if(pA->GetLineInfo().IsDefault()) { - ImplWritePolygonRecord( rPoly, FALSE ); + ImplWritePolygonRecord( rPoly, sal_False ); } else { @@ -1157,7 +1157,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) const MetaEPSAction* pA = (const MetaEPSAction*) pAction; const GDIMetaFile aSubstitute( pA->GetSubstitute() ); - for( ULONG i = 0, nCount = aSubstitute.GetActionCount(); i < nCount; i++ ) + for( sal_uLong i = 0, nCount = aSubstitute.GetActionCount(); i < nCount; i++ ) { const MetaAction* pSubstAct = aSubstitute.GetAction( i ); if( pSubstAct->GetType() == META_BMPSCALE_ACTION ) @@ -1176,7 +1176,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) maVDev.Pop(); ImplBeginRecord( WIN_EMR_RESTOREDC ); - (*mpStm) << (INT32) -1; + (*mpStm) << (sal_Int32) -1; ImplEndRecord(); break; } @@ -1307,14 +1307,14 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_LINECOLOR_ACTION ): { ( (MetaAction*) pAction )->Execute( &maVDev ); - mbLineChanged = TRUE; + mbLineChanged = sal_True; } break; case( META_FILLCOLOR_ACTION ): { ( (MetaAction*) pAction )->Execute( &maVDev ); - mbFillChanged = TRUE; + mbFillChanged = sal_True; } break; @@ -1325,7 +1325,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_FONT_ACTION ): { ( (MetaAction*) pAction )->Execute( &maVDev ); - mbTextChanged = TRUE; + mbTextChanged = sal_True; } break; @@ -1366,11 +1366,11 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) ( (MetaAction*) pAction )->Execute( &maVDev ); ImplBeginRecord( WIN_EMR_RESTOREDC ); - (*mpStm) << (INT32) -1; + (*mpStm) << (sal_Int32) -1; ImplEndRecord(); ImplWriteRasterOp( maVDev.GetRasterOp() ); - mbLineChanged = mbFillChanged = mbTextChanged = TRUE; + mbLineChanged = mbFillChanged = mbTextChanged = sal_True; } break; diff --git a/svtools/source/filter/wmf/emfwr.hxx b/svtools/source/filter/wmf/emfwr.hxx index 6334b5dfe16f..8c65e91e5f73 100644 --- a/svtools/source/filter/wmf/emfwr.hxx +++ b/svtools/source/filter/wmf/emfwr.hxx @@ -50,27 +50,27 @@ private: MapMode maDestMapMode; FilterConfigItem* mpFilterConfigItem; SvStream* mpStm; - BOOL* mpHandlesUsed; - ULONG mnHandleCount; - ULONG mnLastPercent; - ULONG mnRecordCount; - ULONG mnRecordPos; - BOOL mbRecordOpen; - BOOL mbLineChanged; + sal_Bool* mpHandlesUsed; + sal_uLong mnHandleCount; + sal_uLong mnLastPercent; + sal_uLong mnRecordCount; + sal_uLong mnRecordPos; + sal_Bool mbRecordOpen; + sal_Bool mbLineChanged; sal_uInt32 mnLineHandle; - BOOL mbFillChanged; + sal_Bool mbFillChanged; sal_uInt32 mnFillHandle; - BOOL mbTextChanged; + sal_Bool mbTextChanged; sal_uInt32 mnTextHandle; sal_uInt32 mnHorTextAlign; void ImplBeginRecord( sal_uInt32 nType ); void ImplEndRecord(); - ULONG ImplAcquireHandle(); - void ImplReleaseHandle( ULONG nHandle ); + sal_uLong ImplAcquireHandle(); + void ImplReleaseHandle( sal_uLong nHandle ); - BOOL ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType ); + sal_Bool ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uLong nSelectType ); void ImplCheckLineAttr(); void ImplCheckFillAttr(); void ImplCheckTextAttr(); @@ -82,9 +82,9 @@ private: void ImplWriteSize( const Size& rSize); void ImplWriteRect( const Rectangle& rRect ); void ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClose ); - void ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose ); + void ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose ); void ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly ); - void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, UINT32 nROP ); + void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, sal_uInt32 nROP ); void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth ); void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); @@ -94,7 +94,7 @@ public: EMFWriter() {} - BOOL WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pConfigItem = NULL ); + sal_Bool WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pConfigItem = NULL ); }; #endif // _EMFWR_HXX diff --git a/svtools/source/filter/wmf/enhwmf.cxx b/svtools/source/filter/wmf/enhwmf.cxx index 1e49e0d61446..ec7fec9fdb1e 100644 --- a/svtools/source/filter/wmf/enhwmf.cxx +++ b/svtools/source/filter/wmf/enhwmf.cxx @@ -229,7 +229,7 @@ static sal_Bool ImplReadRegion( PolyPolygon& rPolyPoly, SvStream& rSt, sal_uInt3 return bOk; } -BOOL EnhWMFReader::ReadEnhWMF() +sal_Bool EnhWMFReader::ReadEnhWMF() { sal_uInt32 nStretchBltMode = 0; sal_uInt32 nRecType, nRecSize, nNextPos, @@ -246,7 +246,7 @@ BOOL EnhWMFReader::ReadEnhWMF() if ( ( nRecSize < 8 ) || ( nRecSize & 3 ) ) // Parameter sind immer durch 4 teilbar { - bStatus = FALSE; + bStatus = sal_False; break; } @@ -254,7 +254,7 @@ BOOL EnhWMFReader::ReadEnhWMF() if ( nNextPos > nEndPos ) { - bStatus = FALSE; + bStatus = sal_False; break; } @@ -291,8 +291,8 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 16 ); *pWMF >> nPoints; - Polygon aPoly( (UINT16)nPoints ); - for( UINT16 k = 0; k < (UINT16)nPoints; k++ ) + Polygon aPoly( (sal_uInt16)nPoints ); + for( sal_uInt16 k = 0; k < (sal_uInt16)nPoints; k++ ) { *pWMF >> nX32 >> nY32; aPoly[ k ] = Point( nX32, nY32 ); @@ -307,14 +307,14 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 0x10 ); *pWMF >> nPoints; - UINT16 i = 0; + sal_uInt16 i = 0; if ( bFlag ) { i++; nPoints++; } - Polygon aPolygon( (UINT16)nPoints ); - for ( ; i < (UINT16)nPoints; i++ ) + Polygon aPolygon( (sal_uInt16)nPoints ); + for ( ; i < (sal_uInt16)nPoints; i++ ) { *pWMF >> nX32 >> nY32; aPolygon[ i ] = Point( nX32, nY32 ); @@ -325,25 +325,25 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_POLYPOLYLINE : { - UINT16* pnPoints; + sal_uInt16* pnPoints; - INT32 i, nPoly; + sal_Int32 i, nPoly; pWMF->SeekRel( 0x10 ); // Anzahl der Polygone: *pWMF >> nPoly >> i; // taking the amount of points of each polygon, retrieving the total number of points - if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(UINT16) ) + if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) { - if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) ) + if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) ) { - pnPoints = new UINT16[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; for ( i = 0; i < nPoly; i++ ) { *pWMF >> nPoints; - pnPoints[ i ] = (UINT16)nPoints; + pnPoints[ i ] = (sal_uInt16)nPoints; } // Polygonpunkte holen: @@ -351,7 +351,7 @@ BOOL EnhWMFReader::ReadEnhWMF() for ( i = 0; ( i < nPoly ) && !pWMF->IsEof(); i++ ) { Polygon aPoly( pnPoints[ i ] ); - for( UINT16 k = 0; k < pnPoints[ i ]; k++ ) + for( sal_uInt16 k = 0; k < pnPoints[ i ]; k++ ) { *pWMF >> nX32 >> nY32; aPoly[ k ] = Point( nX32, nY32 ); @@ -366,25 +366,25 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_POLYPOLYGON : { - UINT16* pnPoints; + sal_uInt16* pnPoints; Point* pPtAry; - UINT32 i, nPoly, nGesPoints; + sal_uInt32 i, nPoly, nGesPoints; pWMF->SeekRel( 0x10 ); // Anzahl der Polygone: *pWMF >> nPoly >> nGesPoints; - if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(UINT16) ) ) + if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) ) { - if ( ( nPoly * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) ) + if ( ( nPoly * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) ) { - pnPoints = new UINT16[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; for ( i = 0; i < nPoly; i++ ) { *pWMF >> nPoints; - pnPoints[ i ] = (UINT16)nPoints; + pnPoints[ i ] = (sal_uInt16)nPoints; } if ( ( nGesPoints * (sizeof(sal_uInt32)+sizeof(sal_uInt32)) ) <= ( nEndPos - pWMF->Tell() ) ) @@ -398,7 +398,7 @@ BOOL EnhWMFReader::ReadEnhWMF() pPtAry[ i ] = Point( nX32, nY32 ); } // PolyPolygon Actions erzeugen - PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry ); + PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry ); pOut->DrawPolyPolygon( aPolyPoly, bRecordPath ); delete[] pPtAry; } @@ -554,7 +554,7 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_MODIFYWORLDTRANSFORM : { - UINT32 nMode; + sal_uInt32 nMode; XForm aTempXForm; *pWMF >> aTempXForm >> nMode; pOut->ModifyWorldTransform( aTempXForm, nMode ); @@ -575,7 +575,7 @@ BOOL EnhWMFReader::ReadEnhWMF() { LineInfo aLineInfo; - UINT32 nStyle; + sal_uInt32 nStyle; Size aSize; *pWMF >> nStyle >> aSize.Width() >> aSize.Height(); @@ -583,9 +583,9 @@ BOOL EnhWMFReader::ReadEnhWMF() if ( aSize.Width() ) aLineInfo.SetWidth( aSize.Width() ); - BOOL bTransparent = FALSE; - UINT16 nDashCount = 0; - UINT16 nDotCount = 0; + sal_Bool bTransparent = sal_False; + sal_uInt16 nDashCount = 0; + sal_uInt16 nDotCount = 0; switch( nStyle ) { case PS_DASHDOTDOT : @@ -599,7 +599,7 @@ BOOL EnhWMFReader::ReadEnhWMF() nDashCount++; break; case PS_NULL : - bTransparent = TRUE; + bTransparent = sal_True; aLineInfo.SetStyle( LINE_NONE ); break; default : @@ -674,12 +674,12 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_CREATEBRUSHINDIRECT : { - UINT32 nStyle; + sal_uInt32 nStyle; *pWMF >> nIndex; if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 ) { *pWMF >> nStyle; - pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) ); + pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? sal_True : sal_False ) ); } } break; @@ -716,7 +716,7 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_ARC : { - UINT32 nStartX, nStartY, nEndX, nEndY; + sal_uInt32 nStartX, nStartY, nEndX, nEndY; *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY; pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) ); } @@ -724,7 +724,7 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_CHORD : { - UINT32 nStartX, nStartY, nEndX, nEndY; + sal_uInt32 nStartX, nStartY, nEndX, nEndY; *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY; pOut->DrawChord( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) ); } @@ -732,7 +732,7 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_PIE : { - UINT32 nStartX, nStartY, nEndX, nEndY; + sal_uInt32 nStartX, nStartY, nEndX, nEndY; *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY; const Rectangle aRect( ReadRectangle( nX32, nY32, nx32, ny32 )); @@ -754,9 +754,9 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_ARCTO : { - UINT32 nStartX, nStartY, nEndX, nEndY; + sal_uInt32 nStartX, nStartY, nEndX, nEndY; *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY; - pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), TRUE ); + pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), sal_True ); } break; @@ -813,11 +813,11 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_BITBLT : // PASSTHROUGH INTENDED case EMR_STRETCHBLT : { - INT32 xDest, yDest, cxDest, cyDest, xSrc, ySrc, cxSrc, cySrc; - UINT32 dwRop, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc; + sal_Int32 xDest, yDest, cxDest, cyDest, xSrc, ySrc, cxSrc, cySrc; + sal_uInt32 dwRop, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc; XForm xformSrc; - UINT32 nStart = pWMF->Tell() - 8; + sal_uInt32 nStart = pWMF->Tell() - 8; pWMF->SeekRel( 0x10 ); *pWMF >> xDest >> yDest >> cxDest >> cyDest >> dwRop >> xSrc >> ySrc @@ -836,27 +836,27 @@ BOOL EnhWMFReader::ReadEnhWMF() cyDest = abs( (int)cyDest ); // and also 122889 if ( (cbBitsSrc > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc) ) - bStatus = FALSE; + bStatus = sal_False; else { - UINT32 nSize = cbBmiSrc + cbBitsSrc + 14; + sal_uInt32 nSize = cbBmiSrc + cbBitsSrc + 14; if ( nSize <= ( nEndPos - nStartPos ) ) { char* pBuf = new char[ nSize ]; SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); - aTmp.ObjectOwnsMemory( TRUE ); - aTmp << (BYTE)'B' - << (BYTE)'M' - << (UINT32)cbBitsSrc - << (UINT16)0 - << (UINT16)0 - << (UINT32)cbBmiSrc + 14; + aTmp.ObjectOwnsMemory( sal_True ); + aTmp << (sal_uInt8)'B' + << (sal_uInt8)'M' + << (sal_uInt32)cbBitsSrc + << (sal_uInt16)0 + << (sal_uInt16)0 + << (sal_uInt32)cbBmiSrc + 14; pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); pWMF->Seek( nStart + offBitsSrc ); pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc ); aTmp.Seek( 0 ); - aBitmap.Read( aTmp, TRUE ); + aBitmap.Read( aTmp, sal_True ); // test if it is sensible to crop if ( ( cxSrc > 0 ) && ( cySrc > 0 ) && @@ -875,9 +875,9 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_STRETCHDIBITS : { - INT32 xDest, yDest, xSrc, ySrc, cxSrc, cySrc, cxDest, cyDest; - UINT32 offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, iUsageSrc, dwRop; - UINT32 nStart = pWMF->Tell() - 8; + sal_Int32 xDest, yDest, xSrc, ySrc, cxSrc, cySrc, cxDest, cyDest; + sal_uInt32 offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, iUsageSrc, dwRop; + sal_uInt32 nStart = pWMF->Tell() - 8; pWMF->SeekRel( 0x10 ); *pWMF >> xDest >> yDest >> xSrc >> ySrc >> cxSrc >> cySrc >> offBmiSrc >> cbBmiSrc >> offBitsSrc @@ -890,27 +890,27 @@ BOOL EnhWMFReader::ReadEnhWMF() cyDest = abs( (int)cyDest ); // and also 122889 if ( (cbBitsSrc > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc) ) - bStatus = FALSE; + bStatus = sal_False; else { - UINT32 nSize = cbBmiSrc + cbBitsSrc + 14; + sal_uInt32 nSize = cbBmiSrc + cbBitsSrc + 14; if ( nSize <= ( nEndPos - nStartPos ) ) { char* pBuf = new char[ nSize ]; SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); - aTmp.ObjectOwnsMemory( TRUE ); - aTmp << (BYTE)'B' - << (BYTE)'M' - << (UINT32)cbBitsSrc - << (UINT16)0 - << (UINT16)0 - << (UINT32)cbBmiSrc + 14; + aTmp.ObjectOwnsMemory( sal_True ); + aTmp << (sal_uInt8)'B' + << (sal_uInt8)'M' + << (sal_uInt32)cbBitsSrc + << (sal_uInt16)0 + << (sal_uInt16)0 + << (sal_uInt32)cbBmiSrc + 14; pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); pWMF->Seek( nStart + offBitsSrc ); pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc ); aTmp.Seek( 0 ); - aBitmap.Read( aTmp, TRUE ); + aBitmap.Read( aTmp, sal_True ); // test if it is sensible to crop if ( ( cxSrc > 0 ) && ( cySrc > 0 ) && @@ -941,7 +941,7 @@ BOOL EnhWMFReader::ReadEnhWMF() for ( int i = 0; i < LF_FACESIZE; i++ ) { - UINT16 nChar; + sal_uInt16 nChar; *pWMF >> nChar; lfFaceName[ i ] = nChar; } @@ -1045,14 +1045,14 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 16 ); *pWMF >> nPoints; - UINT16 i = 0; + sal_uInt16 i = 0; if ( bFlag ) { i++; nPoints++; } - Polygon aPoly( (UINT16)nPoints ); - for( ; i < (UINT16)nPoints; i++ ) + Polygon aPoly( (sal_uInt16)nPoints ); + for( ; i < (sal_uInt16)nPoints; i++ ) { *pWMF >> nX16 >> nY16; aPoly[ i ] = Point( nX16, nY16 ); @@ -1065,8 +1065,8 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 16 ); *pWMF >> nPoints; - Polygon aPoly( (UINT16)nPoints ); - for( UINT16 k = 0; k < (UINT16)nPoints; k++ ) + Polygon aPoly( (sal_uInt16)nPoints ); + for( sal_uInt16 k = 0; k < (sal_uInt16)nPoints; k++ ) { *pWMF >> nX16 >> nY16; aPoly[ k ] = Point( nX16, nY16 ); @@ -1081,15 +1081,15 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 16 ); *pWMF >> nPoints; - UINT16 i = 0; + sal_uInt16 i = 0; if ( bFlag ) { i++; nPoints++; } - Polygon aPoly( (UINT16)nPoints ); - for( ; i < (UINT16)nPoints; i++ ) + Polygon aPoly( (sal_uInt16)nPoints ); + for( ; i < (sal_uInt16)nPoints; i++ ) { *pWMF >> nX16 >> nY16; aPoly[ i ] = Point( nX16, nY16 ); @@ -1100,29 +1100,29 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_POLYPOLYLINE16 : { - UINT16* pnPoints; + sal_uInt16* pnPoints; - INT32 i, nPoly, nGesPoints; + sal_Int32 i, nPoly, nGesPoints; pWMF->SeekRel( 0x10 ); // Anzahl der Polygone: *pWMF >> nPoly >> nGesPoints; // taking the amount of points of each polygon, retrieving the total number of points - if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(UINT16) ) + if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) { - if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) ) + if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) ) { - pnPoints = new UINT16[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; for ( i = 0; i < nPoly; i++ ) { *pWMF >> nPoints; - pnPoints[ i ] = (UINT16)nPoints; + pnPoints[ i ] = (sal_uInt16)nPoints; } // Polygonpunkte holen: for ( i = 0; ( i < nPoly ) && !pWMF->IsEof(); i++ ) { Polygon aPolygon( pnPoints[ i ] ); - for ( UINT16 k = 0; k < pnPoints[ i ]; k++ ) + for ( sal_uInt16 k = 0; k < pnPoints[ i ]; k++ ) { *pWMF >> nX16 >> nY16; aPolygon[ k ] = Point( nX16, nY16 ); @@ -1137,22 +1137,22 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_POLYPOLYGON16 : { - UINT16* pnPoints; + sal_uInt16* pnPoints; Point* pPtAry; - UINT32 i, nPoly, nGesPoints; + sal_uInt32 i, nPoly, nGesPoints; pWMF->SeekRel( 0x10 ); // Anzahl der Polygone: *pWMF >> nPoly >> nGesPoints; - if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(UINT16) ) ) + if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) ) { - if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof( UINT16 ) ) <= ( nEndPos - pWMF->Tell() ) ) + if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof( sal_uInt16 ) ) <= ( nEndPos - pWMF->Tell() ) ) { - pnPoints = new UINT16[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; for ( i = 0; i < nPoly; i++ ) { *pWMF >> nPoints; - pnPoints[ i ] = (UINT16)nPoints; + pnPoints[ i ] = (sal_uInt16)nPoints; } if ( ( nGesPoints * (sizeof(sal_uInt16)+sizeof(sal_uInt16)) ) <= ( nEndPos - pWMF->Tell() ) ) { @@ -1165,7 +1165,7 @@ BOOL EnhWMFReader::ReadEnhWMF() } // PolyPolygon Actions erzeugen - PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry ); + PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry ); pOut->DrawPolyPolygon( aPolyPoly, bRecordPath ); delete[] pPtAry; } @@ -1266,16 +1266,16 @@ BOOL EnhWMFReader::ReadEnhWMF() //----------------------------------------------------------------------------------- -BOOL EnhWMFReader::ReadHeader() +sal_Bool EnhWMFReader::ReadHeader() { - UINT32 nUINT32, nHeaderSize, nPalEntries; - INT32 nLeft, nTop, nRight, nBottom; + sal_uInt32 nsal_uInt32, nHeaderSize, nPalEntries; + sal_Int32 nLeft, nTop, nRight, nBottom; // METAFILEHEADER SPARE ICH MIR HIER // Einlesen des METAHEADER - *pWMF >> nUINT32 >> nHeaderSize; - if ( nUINT32 != 1 ) // Typ - return FALSE; + *pWMF >> nsal_uInt32 >> nHeaderSize; + if ( nsal_uInt32 != 1 ) // Typ + return sal_False; // bound size Rectangle rclBounds; // rectangle in logical units 1/100th mm @@ -1293,12 +1293,12 @@ BOOL EnhWMFReader::ReadHeader() rclFrame.Right() = nRight; rclFrame.Bottom() = nBottom; - *pWMF >> nUINT32; // signature + *pWMF >> nsal_uInt32; // signature - if ( nUINT32 != 0x464d4520 ) - return FALSE; + if ( nsal_uInt32 != 0x464d4520 ) + return sal_False; - *pWMF >> nUINT32; // nVersion + *pWMF >> nsal_uInt32; // nVersion *pWMF >> nEndPos; // size of metafile nEndPos += nStartPos; @@ -1311,7 +1311,7 @@ BOOL EnhWMFReader::ReadHeader() *pWMF >> nRecordCount; if ( !nRecordCount ) - return FALSE; + return sal_False; pWMF->SeekRel( 0xc ); @@ -1324,12 +1324,12 @@ BOOL EnhWMFReader::ReadHeader() pOut->SetRefMill( Size( nMillX, nMillY ) ); pWMF->Seek( nStartPos + nHeaderSize ); - return TRUE; + return sal_True; } //----------------------------------------------------------------------------------- -Rectangle EnhWMFReader::ReadRectangle( INT32 x1, INT32 y1, INT32 x2, INT32 y2 ) +Rectangle EnhWMFReader::ReadRectangle( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) { Point aTL ( Point( x1, y1 ) ); Point aBR( Point( --x2, --y2 ) ); @@ -1340,4 +1340,3 @@ EnhWMFReader::~EnhWMFReader() { }; - diff --git a/svtools/source/filter/wmf/winmtf.cxx b/svtools/source/filter/wmf/winmtf.cxx index 787e6522b890..30fc670ac22f 100644 --- a/svtools/source/filter/wmf/winmtf.cxx +++ b/svtools/source/filter/wmf/winmtf.cxx @@ -355,7 +355,7 @@ WinMtf::WinMtf( WinMtfOutput* pWinMtfOutput, SvStream& rStreamWMF, FilterConfigI SvLockBytes *pLB = pWMF->GetLockBytes(); if ( pLB ) - pLB->SetSynchronMode( TRUE ); + pLB->SetSynchronMode( sal_True ); nStartPos = pWMF->Tell(); @@ -383,7 +383,7 @@ WinMtf::~WinMtf() // ------------------------------------------------------------------------ -void WinMtf::Callback( USHORT nPercent ) +void WinMtf::Callback( sal_uInt16 nPercent ) { if ( xStatusIndicator.is() ) xStatusIndicator->setValue( nPercent ); @@ -393,9 +393,9 @@ void WinMtf::Callback( USHORT nPercent ) Color WinMtf::ReadColor() { - UINT32 nColor; + sal_uInt32 nColor; *pWMF >> nColor; - return Color( (BYTE)nColor, (BYTE)( nColor >> 8 ), (BYTE)( nColor >> 16 ) ); + return Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) ); }; //----------------------------------------------------------------------------------- @@ -561,8 +561,8 @@ void WinMtfOutput::ImplMap( Font& rFont ) Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon ) { - UINT16 nPoints = rPolygon.GetSize(); - for ( UINT16 i = 0; i < nPoints; i++ ) + sal_uInt16 nPoints = rPolygon.GetSize(); + for ( sal_uInt16 i = 0; i < nPoints; i++ ) { rPolygon[ i ] = ImplMap( rPolygon[ i ] ); } @@ -573,14 +573,14 @@ Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon ) PolyPolygon& WinMtfOutput::ImplMap( PolyPolygon& rPolyPolygon ) { - UINT16 nPolys = rPolyPolygon.Count(); - for ( UINT16 i = 0; i < nPolys; ImplMap( rPolyPolygon[ i++ ] ) ) ; + sal_uInt16 nPolys = rPolyPolygon.Count(); + for ( sal_uInt16 i = 0; i < nPolys; ImplMap( rPolyPolygon[ i++ ] ) ) ; return rPolyPolygon; } //----------------------------------------------------------------------------------- -void WinMtfOutput::SelectObject( INT32 nIndex ) +void WinMtfOutput::SelectObject( sal_Int32 nIndex ) { GDIObj* pGDIObj = NULL; @@ -590,7 +590,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex ) { nIndex &= 0xffff; // zur Sicherheit: mehr als 65535 nicht zulassen - if ( (UINT32)nIndex < vGDIObj.size() ) + if ( (sal_uInt32)nIndex < vGDIObj.size() ) pGDIObj = vGDIObj[ nIndex ]; } @@ -599,7 +599,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex ) if ( nIndex & ENHMETA_STOCK_OBJECT ) { - UINT16 nStockId = (BYTE)nIndex; + sal_uInt16 nStockId = (sal_uInt8)nIndex; switch( nStockId ) { case WHITE_BRUSH : @@ -625,7 +625,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex ) break; case NULL_BRUSH : { - pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE ) ); + pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_TRANSPARENT ), sal_True ) ); } break; case WHITE_PEN : @@ -640,7 +640,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex ) break; case NULL_PEN : { - pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE ) ); + pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_TRANSPARENT ), sal_True ) ); } break; default: @@ -701,7 +701,7 @@ sal_uInt32 WinMtfOutput::GetTextLayoutMode() const //----------------------------------------------------------------------------------- -void WinMtfOutput::SetBkMode( UINT32 nMode ) +void WinMtfOutput::SetBkMode( sal_uInt32 nMode ) { mnBkMode = nMode; } @@ -722,14 +722,14 @@ void WinMtfOutput::SetTextColor( const Color& rColor ) //----------------------------------------------------------------------------------- -void WinMtfOutput::SetTextAlign( UINT32 nAlign ) +void WinMtfOutput::SetTextAlign( sal_uInt32 nAlign ) { mnTextAlign = nAlign; } //----------------------------------------------------------------------------------- -void WinMtfOutput::ImplResizeObjectArry( UINT32 nNewEntrys ) +void WinMtfOutput::ImplResizeObjectArry( sal_uInt32 nNewEntrys ) { sal_uInt32 i = vGDIObj.size(); vGDIObj.resize( nNewEntrys ); @@ -795,7 +795,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle ) } } } - UINT32 nIndex; + sal_uInt32 nIndex; for ( nIndex = 0; nIndex < vGDIObj.size(); nIndex++ ) { if ( vGDIObj[ nIndex ] == NULL ) @@ -809,7 +809,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle ) //----------------------------------------------------------------------------------- -void WinMtfOutput::CreateObject( INT32 nIndex, GDIObjectType eType, void* pStyle ) +void WinMtfOutput::CreateObject( sal_Int32 nIndex, GDIObjectType eType, void* pStyle ) { if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 ) { @@ -832,7 +832,7 @@ void WinMtfOutput::CreateObject( INT32 nIndex, GDIObjectType eType, void* pStyle } } } - if ( (UINT32)nIndex >= vGDIObj.size() ) + if ( (sal_uInt32)nIndex >= vGDIObj.size() ) ImplResizeObjectArry( nIndex + 16 ); if ( vGDIObj[ nIndex ] != NULL ) @@ -968,7 +968,7 @@ WinMtfOutput::~WinMtfOutput() else mpGDIMetaFile->SetPrefSize( mrclFrame.GetSize() ); - for ( UINT32 i = 0; i < vGDIObj.size(); i++ ) + for ( sal_uInt32 i = 0; i < vGDIObj.size(); i++ ) delete vGDIObj[ i ]; }; @@ -1010,7 +1010,7 @@ void WinMtfOutput::UpdateClipRegion() void WinMtfOutput::ImplSetNonPersistentLineColorTransparenz() { Color aColor( COL_TRANSPARENT); - WinMtfLineStyle aTransparentLine( aColor, TRUE ); + WinMtfLineStyle aTransparentLine( aColor, sal_True ); if ( ! ( maLatestLineStyle == aTransparentLine ) ) { maLatestLineStyle = aTransparentLine; @@ -1044,7 +1044,7 @@ void WinMtfOutput::UpdateFillStyle() //----------------------------------------------------------------------------------- -sal_uInt32 WinMtfOutput::SetRasterOp( UINT32 nRasterOp ) +sal_uInt32 WinMtfOutput::SetRasterOp( sal_uInt32 nRasterOp ) { sal_uInt32 nRetROP = mnRop; if ( nRasterOp != mnRop ) @@ -1077,8 +1077,8 @@ sal_uInt32 WinMtfOutput::SetRasterOp( UINT32 nRasterOp ) { aNopFillStyle = maFillStyle; aNopLineStyle = maLineStyle; - maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE ); - maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE ); + maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), sal_True ); + maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), sal_True ); mbNopMode = sal_True; } } @@ -1108,7 +1108,7 @@ void WinMtfOutput::StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill ) if ( !bStroke ) { mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) ); - mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) ); + mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) ); } if ( aPathObj.Count() == 1 ) mpGDIMetaFile->AddAction( new MetaPolygonAction( aPathObj.GetObject( 0 ) ) ); @@ -1173,7 +1173,7 @@ void WinMtfOutput::DrawLine( const Point& rSource, const Point& rDest ) //----------------------------------------------------------------------------------- -void WinMtfOutput::DrawRect( const Rectangle& rRect, BOOL bEdge ) +void WinMtfOutput::DrawRect( const Rectangle& rRect, sal_Bool bEdge ) { UpdateClipRegion(); UpdateFillStyle(); @@ -1247,7 +1247,7 @@ void WinMtfOutput::DrawEllipse( const Rectangle& rRect ) //----------------------------------------------------------------------------------- -void WinMtfOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, BOOL bTo ) +void WinMtfOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, sal_Bool bTo ) { UpdateClipRegion(); UpdateLineStyle(); @@ -1349,7 +1349,7 @@ void WinMtfOutput::DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath ) { if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) ) { - USHORT nCount = rPolygon.GetSize(); + sal_uInt16 nCount = rPolygon.GetSize(); if ( nCount ) { if ( rPolygon[ nCount - 1 ] != rPolygon[ 0 ] ) @@ -1564,7 +1564,7 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry pVDev->SetFont( maFont ); if( pDXArry ) { - UINT32 nLen = rText.Len(); + sal_uInt32 nLen = rText.Len(); nTextWidth = pVDev->GetTextWidth( rText.GetChar( (sal_uInt16)( nLen - 1 ) ) ); if( nLen > 1 ) nTextWidth += pDXArry[ nLen - 2 ]; @@ -1644,7 +1644,7 @@ void WinMtfOutput::ImplDrawBitmap( const Point& rPos, const Size& rSize, const B const Point aEmptyPoint; // #i50672# Extract whole VDev content (to match size of rBitmap) - aVDev.EnableMapMode( FALSE ); + aVDev.EnableMapMode( sal_False ); Bitmap aMask( aVDev.GetBitmap( aEmptyPoint, aSizePixel ).CreateMask( Color( COL_WHITE ) ) ); if ( aBmpEx.IsTransparent() ) @@ -1713,7 +1713,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) { // patterns aren't well supported yet sal_uInt32 nOldRop = SetRasterOp( ROP_OVERPAINT ); // in this case nRasterOperation is either 0 or 0xff UpdateFillStyle(); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); SetRasterOp( nOldRop ); } else @@ -1778,7 +1778,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0x1 ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1796,7 +1796,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0x7 ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1805,7 +1805,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) case 0xb : { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); SetRasterOp( R2_COPYPEN ); Bitmap aMask( aBitmap ); aBitmap.Invert(); @@ -1816,7 +1816,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0xb ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1833,7 +1833,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0xd ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1845,7 +1845,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0x9 ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1855,7 +1855,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) { // in this case nRasterOperation is either 0 or 0xff maFillStyle = WinMtfFillStyle( Color( nRasterOperation, nRasterOperation, nRasterOperation ) ); UpdateFillStyle(); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } break; @@ -1871,7 +1871,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) case 0x5 : // only destination is used { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } case 0xa : // no operation break; @@ -1900,7 +1900,7 @@ void WinMtfOutput::SetDevOrg( const Point& rPoint ) //----------------------------------------------------------------------------------- -void WinMtfOutput::SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd ) +void WinMtfOutput::SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd ) { mnDevOrgX += nXAdd; mnDevOrgY += nYAdd; @@ -1942,7 +1942,7 @@ void WinMtfOutput::SetWinOrg( const Point& rPoint ) //----------------------------------------------------------------------------------- -void WinMtfOutput::SetWinOrgOffset( INT32 nXAdd, INT32 nYAdd ) +void WinMtfOutput::SetWinOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd ) { mnWinOrgX += nXAdd; mnWinOrgY += nYAdd; @@ -2036,7 +2036,7 @@ void WinMtfOutput::SetWorldTransform( const XForm& rXForm ) //----------------------------------------------------------------------------------- -void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, UINT32 nMode ) +void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode ) { switch( nMode ) { @@ -2200,4 +2200,3 @@ void WinMtfOutput::AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile ) { rGDIMetaFile.Play( *mpGDIMetaFile, 0xFFFFFFFF ); } - diff --git a/svtools/source/filter/wmf/winmtf.hxx b/svtools/source/filter/wmf/winmtf.hxx index fb4fd2fe0c57..ca7b62b38ef3 100644 --- a/svtools/source/filter/wmf/winmtf.hxx +++ b/svtools/source/filter/wmf/winmtf.hxx @@ -144,19 +144,19 @@ struct LOGFONTW { - INT32 lfHeight; - INT32 lfWidth; - INT32 lfEscapement; - INT32 lfOrientation; - INT32 lfWeight; - BYTE lfItalic; - BYTE lfUnderline; - BYTE lfStrikeOut; - BYTE lfCharSet; - BYTE lfOutPrecision; - BYTE lfClipPrecision; - BYTE lfQuality; - BYTE lfPitchAndFamily; + sal_Int32 lfHeight; + sal_Int32 lfWidth; + sal_Int32 lfEscapement; + sal_Int32 lfOrientation; + sal_Int32 lfWeight; + sal_uInt8 lfItalic; + sal_uInt8 lfUnderline; + sal_uInt8 lfStrikeOut; + sal_uInt8 lfCharSet; + sal_uInt8 lfOutPrecision; + sal_uInt8 lfClipPrecision; + sal_uInt8 lfQuality; + sal_uInt8 lfPitchAndFamily; String alfFaceName; }; @@ -367,23 +367,23 @@ struct WinMtfFontStyle struct WinMtfFillStyle { Color aFillColor; - BOOL bTransparent; + sal_Bool bTransparent; WinMtfFillStyle() : aFillColor ( Color( COL_BLACK ) ), - bTransparent( FALSE ) + bTransparent( sal_False ) { }; - WinMtfFillStyle( const Color& rColor, BOOL bTrans = FALSE ) : + WinMtfFillStyle( const Color& rColor, sal_Bool bTrans = sal_False ) : aFillColor ( rColor ), bTransparent( bTrans ) { }; - BOOL operator==( const WinMtfFillStyle& rStyle ) + sal_Bool operator==( const WinMtfFillStyle& rStyle ) { return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) ); }; - BOOL operator==( WinMtfFillStyle* pStyle ) + sal_Bool operator==( WinMtfFillStyle* pStyle ) { return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) ); }; void operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; }; void operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; }; @@ -395,23 +395,23 @@ struct WinMtfLineStyle { Color aLineColor; LineInfo aLineInfo; - BOOL bTransparent; + sal_Bool bTransparent; WinMtfLineStyle() : aLineColor ( COL_BLACK ), - bTransparent( FALSE ) {}; + bTransparent( sal_False ) {}; - WinMtfLineStyle( const Color& rColor, BOOL bTrans = FALSE ) : + WinMtfLineStyle( const Color& rColor, sal_Bool bTrans = sal_False ) : aLineColor ( rColor ), bTransparent( bTrans ) {}; - WinMtfLineStyle( const Color& rColor, const LineInfo rStyle, BOOL bTrans = FALSE ) : + WinMtfLineStyle( const Color& rColor, const LineInfo rStyle, sal_Bool bTrans = sal_False ) : aLineColor ( rColor ), aLineInfo ( rStyle ), bTransparent( bTrans ) {}; - BOOL operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); }; - BOOL operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); }; + sal_Bool operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); }; + sal_Bool operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); }; void operator=( const WinMtfLineStyle& rStyle ) { aLineColor = rStyle.aLineColor; @@ -480,9 +480,9 @@ struct BSaveStruct { Bitmap aBmp; Rectangle aOutRect; - UINT32 nWinRop; + sal_uInt32 nWinRop; - BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, UINT32 nRop ) : + BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, sal_uInt32 nRop ) : aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ){}; }; @@ -594,7 +594,7 @@ class WinMtfOutput void ImplMap( Font& rFont ); Polygon& ImplMap( Polygon& rPolygon ); PolyPolygon& ImplMap( PolyPolygon& rPolyPolygon ); - void ImplResizeObjectArry( UINT32 nNewEntry ); + void ImplResizeObjectArry( sal_uInt32 nNewEntry ); void ImplSetNonPersistentLineColorTransparenz(); void ImplDrawClippedPolyPolygon( const PolyPolygon& rPolyPoly ); void ImplDrawBitmap( const Point& rPos, const Size& rSize, const BitmapEx rBitmap ); @@ -602,12 +602,12 @@ class WinMtfOutput public: void SetDevOrg( const Point& rPoint ); - void SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd ); + void SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd ); void SetDevExt( const Size& rSize ); void ScaleDevExt( double fX, double fY ); void SetWinOrg( const Point& rPoint ); - void SetWinOrgOffset( INT32 nX, INT32 nY ); + void SetWinOrgOffset( sal_Int32 nX, sal_Int32 nY ); void SetWinExt( const Size& rSize ); void ScaleWinExt( double fX, double fY ); @@ -619,24 +619,24 @@ class WinMtfOutput sal_uInt32 GetMapMode() const { return mnMapMode; }; void SetMapMode( sal_uInt32 mnMapMode ); void SetWorldTransform( const XForm& rXForm ); - void ModifyWorldTransform( const XForm& rXForm, UINT32 nMode ); + void ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode ); void Push(); void Pop(); - UINT32 SetRasterOp( UINT32 nRasterOp ); + sal_uInt32 SetRasterOp( sal_uInt32 nRasterOp ); void StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill ); void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; }; sal_Int32 GetGfxMode() const { return mnGfxMode; }; - void SetBkMode( UINT32 nMode ); + void SetBkMode( sal_uInt32 nMode ); void SetBkColor( const Color& rColor ); void SetTextColor( const Color& rColor ); - void SetTextAlign( UINT32 nAlign ); + void SetTextAlign( sal_uInt32 nAlign ); void CreateObject( GDIObjectType, void* pStyle = NULL ); - void CreateObject( INT32 nIndex, GDIObjectType, void* pStyle = NULL ); - void DeleteObject( INT32 nIndex ); - void SelectObject( INT32 nIndex ); + void CreateObject( sal_Int32 nIndex, GDIObjectType, void* pStyle = NULL ); + void DeleteObject( sal_Int32 nIndex ); + void SelectObject( sal_Int32 nIndex ); CharSet GetCharSet(){ return maFont.GetCharSet(); }; void SetFont( const Font& rFont ); const Font& GetFont() const; @@ -651,10 +651,10 @@ class WinMtfOutput void LineTo( const Point& rPoint, sal_Bool bRecordPath = sal_False ); void DrawPixel( const Point& rSource, const Color& rColor ); void DrawLine( const Point& rSource, const Point& rDest ); - void DrawRect( const Rectangle& rRect, BOOL bEdge = TRUE ); + void DrawRect( const Rectangle& rRect, sal_Bool bEdge = sal_True ); void DrawRoundRect( const Rectangle& rRect, const Size& rSize ); void DrawEllipse( const Rectangle& rRect ); - void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, BOOL bDrawTo = FALSE ); + void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, sal_Bool bDrawTo = sal_False ); void DrawPie( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle ); void DrawChord( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle ); void DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath = sal_False ); @@ -685,7 +685,7 @@ class WinMtf WinMtfOutput* pOut; // SvStream* pWMF; // Die einzulesende WMF/EMF-Datei - UINT32 nStartPos, nEndPos; + sal_uInt32 nStartPos, nEndPos; List aBmpSaveList; FilterConfigItem* pFilterConfigItem; @@ -695,7 +695,7 @@ class WinMtf // Sorgt dafuer, das aSampledBrush der aktuelle Brush des GDIMetaFiles ist. Color ReadColor(); - void Callback( USHORT nPercent ); + void Callback( sal_uInt16 nPercent ); WinMtf( WinMtfOutput* pOut, SvStream& rStreamWMF, FilterConfigItem* pConfigItem = NULL ); ~WinMtf(); @@ -711,16 +711,16 @@ class EnhWMFReader : public WinMtf sal_Bool bRecordPath; sal_Int32 nRecordCount; - BOOL ReadHeader(); - Rectangle ReadRectangle( INT32, INT32, INT32, INT32 ); // Liesst und konvertiert ein Rechteck - void ImplExtTextOut( BOOL bWideCharakter ); + sal_Bool ReadHeader(); + Rectangle ReadRectangle( sal_Int32, sal_Int32, sal_Int32, sal_Int32 ); // Liesst und konvertiert ein Rechteck + void ImplExtTextOut( sal_Bool bWideCharakter ); public: EnhWMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL ) : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ) {}; ~EnhWMFReader(); - BOOL ReadEnhWMF(); + sal_Bool ReadEnhWMF(); }; //============================ WMFReader ================================== @@ -730,7 +730,7 @@ class WMFReader : public WinMtf private: VirtualDevice aVDev; // just for the purpose of "IsFontAvailable" - UINT16 nUnitsPerInch; + sal_uInt16 nUnitsPerInch; sal_uInt32 nRecSize; // embedded EMF data @@ -750,10 +750,10 @@ private: sal_uInt32 nUnicodeEscapeAction; // Liesst den Kopf der WMF-Datei - BOOL ReadHeader(); + sal_Bool ReadHeader(); // Liesst die Parameter des Rocords mit der Funktionsnummer nFunction. - void ReadRecordParams( USHORT nFunction ); + void ReadRecordParams( sal_uInt16 nFunction ); Point ReadPoint(); // Liesst und konvertiert einen Punkt (erst X dann Y) Point ReadYX(); // Liesst und konvertiert einen Punkt (erst Y dann X) @@ -773,5 +773,3 @@ public: }; #endif - - diff --git a/svtools/source/filter/wmf/winwmf.cxx b/svtools/source/filter/wmf/winwmf.cxx index cea1ab490b04..feb1a2895793 100644 --- a/svtools/source/filter/wmf/winwmf.cxx +++ b/svtools/source/filter/wmf/winwmf.cxx @@ -156,7 +156,7 @@ Size WMFReader::ReadYXExt() // ------------------------------------------------------------------------ -void WMFReader::ReadRecordParams( USHORT nFunc ) +void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) { switch( nFunc ) { @@ -168,7 +168,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_SETBKMODE: { - USHORT nDat; + sal_uInt16 nDat; *pWMF >> nDat; pOut->SetBkMode( nDat ); } @@ -185,7 +185,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_SETROP2: { - UINT16 nROP2; + sal_uInt16 nROP2; *pWMF >> nROP2; pOut->SetRasterOp( nROP2 ); } @@ -322,7 +322,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_POLYGON: { - USHORT i,nPoints; + sal_uInt16 i,nPoints; *pWMF >> nPoints; Polygon aPoly( nPoints ); for( i = 0; i < nPoints; i++ ) @@ -333,13 +333,13 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_POLYPOLYGON: { - USHORT i, nPoly, nPoints; - USHORT* pnPoints; + sal_uInt16 i, nPoly, nPoints; + sal_uInt16* pnPoints; Point* pPtAry; // Anzahl der Polygone: *pWMF >> nPoly; // Anzahl der Punkte eines jeden Polygons holen, Gesammtzahl der Punkte ermitteln: - pnPoints = new USHORT[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; nPoints = 0; for( i = 0; i < nPoly; i++ ) { @@ -360,7 +360,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_POLYLINE: { - USHORT i,nPoints; + sal_uInt16 i,nPoints; *pWMF >> nPoints; Polygon aPoly( nPoints ); for( i = 0; i < nPoints; i++ ) @@ -396,7 +396,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_TEXTOUT: { - USHORT nLength; + sal_uInt16 nLength; *pWMF >> nLength; if ( nLength ) { @@ -453,7 +453,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) sal_uInt32 nMaxStreamPos = nRecordPos + ( nRecordSize << 1 ); sal_Int32 nDxArySize = nMaxStreamPos - pWMF->Tell(); sal_Int32 nDxAryEntries = nDxArySize >> 1; - sal_Bool bUseDXAry = FALSE; + sal_Bool bUseDXAry = sal_False; if ( ( ( nDxAryEntries % nOriginalTextLen ) == 0 ) && ( nNewTextLen <= nOriginalTextLen ) ) { @@ -481,7 +481,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) pDXAry[ i ] = nDx; } if ( i == nNewTextLen ) - bUseDXAry = TRUE; + bUseDXAry = sal_True; } if ( pDXAry && bUseDXAry ) pOut->DrawText( aPosition, aText, pDXAry ); @@ -496,7 +496,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_SELECTOBJECT: { - INT16 nObjIndex; + sal_Int16 nObjIndex; *pWMF >> nObjIndex; pOut->SelectObject( nObjIndex ); } @@ -504,7 +504,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_SETTEXTALIGN: { - UINT16 nAlign; + sal_uInt16 nAlign; *pWMF >> nAlign; pOut->SetTextAlign( nAlign ); } @@ -602,14 +602,14 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) { if ( nWinROP == PATCOPY ) *pWMF >> nUsage; // i don't know anything of this parameter, so its called nUsage - // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), FALSE ); + // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), sal_False ); Size aDestSize( ReadYXExt() ); if ( aDestSize.Width() && aDestSize.Height() ) // #92623# do not try to read buggy bitmaps { Rectangle aDestRect( ReadYX(), aDestSize ); if ( nWinROP != PATCOPY ) - aBmp.Read( *pWMF, FALSE ); + aBmp.Read( *pWMF, sal_False ); // test if it is sensible to crop if ( nSye && nSxe && @@ -629,18 +629,18 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) { Bitmap aBmp; BitmapReadAccess* pBmp; - UINT32 nRed = 0, nGreen = 0, nBlue = 0, nCount = 1; - UINT16 nFunction; + sal_uInt32 nRed = 0, nGreen = 0, nBlue = 0, nCount = 1; + sal_uInt16 nFunction; *pWMF >> nFunction >> nFunction; - aBmp.Read( *pWMF, FALSE ); + aBmp.Read( *pWMF, sal_False ); pBmp = aBmp.AcquireReadAccess(); if ( pBmp ) { - for ( INT32 y = 0; y < pBmp->Height(); y++ ) + for ( sal_Int32 y = 0; y < pBmp->Height(); y++ ) { - for ( INT32 x = 0; x < pBmp->Width(); x++ ) + for ( sal_Int32 x = 0; x < pBmp->Width(); x++ ) { const BitmapColor aColor( pBmp->GetColor( y, x ) ); @@ -654,14 +654,14 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) nCount++; aBmp.ReleaseAccess( pBmp ); } - Color aColor( (BYTE)( nRed / nCount ), (BYTE)( nGreen / nCount ), (BYTE)( nBlue / nCount ) ); - pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( aColor, FALSE ) ); + Color aColor( (sal_uInt8)( nRed / nCount ), (sal_uInt8)( nGreen / nCount ), (sal_uInt8)( nBlue / nCount ) ); + pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( aColor, sal_False ) ); } break; case W_META_DELETEOBJECT: { - INT16 nIndex; + sal_Int16 nIndex; *pWMF >> nIndex; pOut->DeleteObject( nIndex ); } @@ -675,29 +675,29 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_CREATEBRUSH: { - pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) ); + pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), sal_False ) ); } break; case W_META_CREATEPATTERNBRUSH: { - pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) ); + pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), sal_False ) ); } break; case W_META_CREATEPENINDIRECT: { LineInfo aLineInfo; - USHORT nStyle, nWidth, nHeight; + sal_uInt16 nStyle, nWidth, nHeight; *pWMF >> nStyle >> nWidth >> nHeight; if ( nWidth ) aLineInfo.SetWidth( nWidth ); - BOOL bTransparent = FALSE; - UINT16 nDashCount = 0; - UINT16 nDotCount = 0; + sal_Bool bTransparent = sal_False; + sal_uInt16 nDashCount = 0; + sal_uInt16 nDotCount = 0; switch( nStyle ) { case PS_DASHDOTDOT : @@ -711,7 +711,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) nDashCount++; break; case PS_NULL : - bTransparent = TRUE; + bTransparent = sal_True; aLineInfo.SetStyle( LINE_NONE ); break; default : @@ -731,9 +731,9 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_CREATEBRUSHINDIRECT: { - USHORT nStyle; + sal_uInt16 nStyle; *pWMF >> nStyle; - pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) ); + pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? sal_True : sal_False ) ); } break; @@ -741,7 +741,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) { Size aFontSize; char lfFaceName[ LF_FACESIZE ]; - INT16 lfEscapement, lfOrientation, lfWeight; // ( ehemals USHORT ) + sal_Int16 lfEscapement, lfOrientation, lfWeight; // ( ehemals sal_uInt16 ) LOGFONTW aLogFont; aFontSize = ReadYXExt(); @@ -796,11 +796,11 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_PATBLT: { - UINT32 nROP, nOldROP; + sal_uInt32 nROP, nOldROP; *pWMF >> nROP; Size aSize = ReadYXExt(); nOldROP = pOut->SetRasterOp( nROP ); - pOut->DrawRect( Rectangle( ReadYX(), aSize ), FALSE ); + pOut->DrawRect( Rectangle( ReadYX(), aSize ), sal_False ); pOut->SetRasterOp( nOldROP ); } break; @@ -996,7 +996,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) // ------------------------------------------------------------------------ -BOOL WMFReader::ReadHeader() +sal_Bool WMFReader::ReadHeader() { Rectangle aPlaceableBound; sal_uInt32 nl, nStrmPos = pWMF->Tell(); @@ -1007,7 +1007,7 @@ BOOL WMFReader::ReadHeader() Size aWMFSize; if ( nl == 0x9ac6cdd7L ) { - INT16 nVal; + sal_Int16 nVal; // hmf (Unused) ueberlesen wir pWMF->SeekRel(2); @@ -1055,7 +1055,7 @@ BOOL WMFReader::ReadHeader() if( nl != 0x00090001 ) { pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); - return FALSE; + return sal_False; } pWMF->SeekRel( 2 ); // Version (von Windows) @@ -1064,13 +1064,13 @@ BOOL WMFReader::ReadHeader() pWMF->SeekRel( 4 ); // MaxRecord (Groesse des groessten Records in Words) pWMF->SeekRel( 2 ); // NoParameters (Unused - return TRUE; + return sal_True; } void WMFReader::ReadWMF() { - USHORT nFunction; - ULONG nPos, nPercent, nLastPercent; + sal_uInt16 nFunction; + sal_uLong nPos, nPercent, nLastPercent; nSkipActions = 0; nCurrentAction = 0; @@ -1090,7 +1090,7 @@ void WMFReader::ReadWMF() nEndPos=pWMF->Seek( STREAM_SEEK_TO_END ); pWMF->Seek( nStartPos ); - Callback( (USHORT) ( nLastPercent = 0 ) ); + Callback( (sal_uInt16) ( nLastPercent = 0 ) ); if ( ReadHeader() ) { @@ -1099,14 +1099,14 @@ void WMFReader::ReadWMF() if( nEndPos - nStartPos ) { - while( TRUE ) + while( sal_True ) { nCurrentAction++; nPercent = ( nPos - nStartPos ) * 100 / ( nEndPos - nStartPos ); if( nLastPercent + 4 <= nPercent ) { - Callback( (USHORT) nPercent ); + Callback( (sal_uInt16) nPercent ); nLastPercent = nPercent; } *pWMF >> nRecSize >> nFunction; @@ -1288,7 +1288,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_POLYGON: { - USHORT i,nPoints; + sal_uInt16 i,nPoints; *pStm >> nPoints; for( i = 0; i < nPoints; i++ ) GetWinExtMax( ReadPoint(), rPlaceableBound, nMapMode ); @@ -1297,7 +1297,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_POLYPOLYGON: { - USHORT i, nPoly, nPoints = 0; + sal_uInt16 i, nPoly, nPoints = 0; *pStm >> nPoly; for( i = 0; i < nPoly; i++ ) { @@ -1312,7 +1312,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_POLYLINE: { - USHORT i,nPoints; + sal_uInt16 i,nPoints; *pStm >> nPoints; for( i = 0; i < nPoints; i++ ) GetWinExtMax( ReadPoint(), rPlaceableBound, nMapMode ); @@ -1328,7 +1328,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_TEXTOUT: { - USHORT nLength; + sal_uInt16 nLength; *pStm >> nLength; // todo: we also have to take care of the text width if ( nLength ) @@ -1383,7 +1383,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt { if ( nWinROP == PATCOPY ) *pStm >> nUsage; // i don't know anything of this parameter, so its called nUsage - // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), FALSE ); + // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), sal_False ); Size aDestSize( ReadYXExt() ); if ( aDestSize.Width() && aDestSize.Height() ) // #92623# do not try to read buggy bitmaps @@ -1397,7 +1397,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_PATBLT: { - UINT32 nROP; + sal_uInt32 nROP; *pStm >> nROP; Size aSize = ReadYXExt(); GetWinExtMax( Rectangle( ReadYX(), aSize ), rPlaceableBound, nMapMode ); @@ -1428,4 +1428,3 @@ WMFReader::~WMFReader() if( pEMFStream ) delete pEMFStream; } - diff --git a/svtools/source/filter/wmf/wmf.cxx b/svtools/source/filter/wmf/wmf.cxx index 25ca9f721b33..4e84cd920b56 100644 --- a/svtools/source/filter/wmf/wmf.cxx +++ b/svtools/source/filter/wmf/wmf.cxx @@ -35,18 +35,18 @@ // ----------------------------------------------------------------------------- -BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem ) +sal_Bool ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem ) { - UINT32 nMetaType; - UINT32 nOrgPos = rStreamWMF.Tell(); - UINT16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt(); + sal_uInt32 nMetaType; + sal_uInt32 nOrgPos = rStreamWMF.Tell(); + sal_uInt16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt(); rStreamWMF.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rStreamWMF.Seek( 0x28 ); rStreamWMF >> nMetaType; rStreamWMF.Seek( nOrgPos ); if ( nMetaType == 0x464d4520 ) { - if ( EnhWMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadEnhWMF() == FALSE ) + if ( EnhWMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadEnhWMF() == sal_False ) rStreamWMF.SetError( SVSTREAM_FILEFORMAT_ERROR ); } else @@ -59,18 +59,18 @@ BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, // ----------------------------------------------------------------------------- -BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pFilterConfigItem ) +sal_Bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pFilterConfigItem ) { - UINT32 nMetaType; - UINT32 nOrgPos = rStream.Tell(); - UINT16 nOrigNumberFormat = rStream.GetNumberFormatInt(); + sal_uInt32 nMetaType; + sal_uInt32 nOrgPos = rStream.Tell(); + sal_uInt16 nOrigNumberFormat = rStream.GetNumberFormatInt(); rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rStream.Seek( 0x28 ); rStream >> nMetaType; rStream.Seek( nOrgPos ); if ( nMetaType == 0x464d4520 ) { - if ( EnhWMFReader( rStream, rMTF, NULL ).ReadEnhWMF() == FALSE ) + if ( EnhWMFReader( rStream, rMTF, NULL ).ReadEnhWMF() == sal_False ) rStream.SetError( SVSTREAM_FILEFORMAT_ERROR ); } else @@ -83,8 +83,8 @@ BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* // ----------------------------------------------------------------------------- -BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, - FilterConfigItem* pConfigItem, BOOL bPlaceable) +sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, + FilterConfigItem* pConfigItem, sal_Bool bPlaceable) { WMFWriter aWMFWriter; return aWMFWriter.WriteWMF( rMTF, rTargetStream, pConfigItem, bPlaceable ); @@ -92,7 +92,7 @@ BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream // ----------------------------------------------------------------------------- -BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, +sal_Bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem ) { EMFWriter aEMFWriter; @@ -101,14 +101,14 @@ BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream // ----------------------------------------------------------------------------- -BOOL WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF ) +sal_Bool WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF ) { return WMFWriter().WriteWMF( rMTF, rStream, NULL ); } // ----------------------------------------------------------------------------- -BOOL WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF ) +sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF ) { - return WMFWriter().WriteWMF( rMTF, rStream, NULL, FALSE ); + return WMFWriter().WriteWMF( rMTF, rStream, NULL, sal_False ); } diff --git a/svtools/source/filter/wmf/wmfwr.cxx b/svtools/source/filter/wmf/wmfwr.cxx index 82d4101b48c9..26bda76a11d9 100644 --- a/svtools/source/filter/wmf/wmfwr.cxx +++ b/svtools/source/filter/wmf/wmfwr.cxx @@ -282,7 +282,7 @@ void WMFWriter::MayCallback() { if ( xStatusIndicator.is() ) { - ULONG nPercent; + sal_uLong nPercent; // Wir gehen mal einfach so davon aus, dass 16386 Actions einer Bitmap entsprechen // (in der Regel wird ein Metafile entweder nur Actions oder einige Bitmaps und fast @@ -303,7 +303,7 @@ void WMFWriter::MayCallback() void WMFWriter::CountActionsAndBitmaps( const GDIMetaFile & rMTF ) { - ULONG nAction, nActionCount; + sal_uLong nAction, nActionCount; nActionCount = rMTF.GetActionCount(); @@ -372,7 +372,7 @@ void WMFWriter::WriteRectangle(const Rectangle & rRect) void WMFWriter::WriteColor(const Color & rColor) { - *pWMF << (BYTE) rColor.GetRed() << (BYTE) rColor.GetGreen() << (BYTE) rColor.GetBlue() << (BYTE) 0; + *pWMF << (sal_uInt8) rColor.GetRed() << (sal_uInt8) rColor.GetGreen() << (sal_uInt8) rColor.GetBlue() << (sal_uInt8) 0; } @@ -386,12 +386,12 @@ void WMFWriter::WriteRecordHeader(sal_uInt32 nSizeWords, sal_uInt16 nType) void WMFWriter::UpdateRecordHeader() { - ULONG nPos; + sal_uLong nPos; sal_uInt32 nSize; nPos=pWMF->Tell(); nSize=nPos-nActRecordPos; if ((nSize & 1)!=0) { - *pWMF << (BYTE)0; + *pWMF << (sal_uInt8)0; nPos++; nSize++; } nSize/=2; @@ -424,19 +424,19 @@ void WMFWriter::WMFRecord_CreateBrushIndirect(const Color& rColor) WriteRecordHeader(0x00000007,W_META_CREATEBRUSHINDIRECT); if( rColor==Color(COL_TRANSPARENT) ) - *pWMF << (UINT16) W_BS_HOLLOW; + *pWMF << (sal_uInt16) W_BS_HOLLOW; else - *pWMF << (UINT16) W_BS_SOLID; + *pWMF << (sal_uInt16) W_BS_SOLID; WriteColor( rColor ); - *pWMF << (UINT16) 0; + *pWMF << (sal_uInt16) 0; } void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont) { - USHORT nWeight,i; - BYTE nPitchFamily; + sal_uInt16 nWeight,i; + sal_uInt8 nPitchFamily; WriteRecordHeader(0x00000000,W_META_CREATEFONTINDIRECT); WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height())); @@ -457,9 +457,9 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont) } *pWMF << nWeight; - if (rFont.GetItalic()==ITALIC_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1; - if (rFont.GetUnderline()==UNDERLINE_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1; - if (rFont.GetStrikeout()==STRIKEOUT_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1; + if (rFont.GetItalic()==ITALIC_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1; + if (rFont.GetUnderline()==UNDERLINE_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1; + if (rFont.GetStrikeout()==STRIKEOUT_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1; CharSet eFontNameEncoding = rFont.GetCharSet(); sal_uInt8 nCharSet = rtl_getBestWindowsCharsetFromTextEncoding( eFontNameEncoding ); @@ -469,7 +469,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont) nCharSet = W_ANSI_CHARSET; *pWMF << nCharSet; - *pWMF << (BYTE)0 << (BYTE)0 << (BYTE)0; + *pWMF << (sal_uInt8)0 << (sal_uInt8)0 << (sal_uInt8)0; switch (rFont.GetPitch()) { case PITCH_FIXED: nPitchFamily=W_FIXED_PITCH; break; @@ -498,7 +498,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont) void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo ) { WriteRecordHeader(0x00000008,W_META_CREATEPENINDIRECT); - USHORT nStyle = rColor == Color( COL_TRANSPARENT ) ? W_PS_NULL : W_PS_SOLID; + sal_uInt16 nStyle = rColor == Color( COL_TRANSPARENT ) ? W_PS_NULL : W_PS_SOLID; switch( rLineInfo.GetStyle() ) { case LINE_DASH : @@ -531,7 +531,7 @@ void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& WriteColor( rColor ); } -void WMFWriter::WMFRecord_DeleteObject(USHORT nObjectHandle) +void WMFWriter::WMFRecord_DeleteObject(sal_uInt16 nObjectHandle) { WriteRecordHeader(0x00000004,W_META_DELETEOBJECT); *pWMF << nObjectHandle; @@ -752,7 +752,7 @@ void WMFWriter::WMFRecord_Pie(const Rectangle & rRect, const Point & rStartPt, c void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly) { - USHORT nSize,i; + sal_uInt16 nSize,i; Polygon aSimplePoly; if ( rPoly.HasFlags() ) @@ -760,7 +760,7 @@ void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly) else aSimplePoly = rPoly; nSize = aSimplePoly.GetSize(); - WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYGON); + WriteRecordHeader(((sal_uLong)nSize)*2+4,W_META_POLYGON); *pWMF << nSize; for (i=0; i<nSize; i++) WritePointXY(aSimplePoly.GetPoint(i)); } @@ -768,14 +768,14 @@ void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly) void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly) { - USHORT nSize,i; + sal_uInt16 nSize,i; Polygon aSimplePoly; if ( rPoly.HasFlags() ) rPoly.AdaptiveSubdivide( aSimplePoly ); else aSimplePoly = rPoly; nSize=aSimplePoly.GetSize(); - WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYLINE); + WriteRecordHeader(((sal_uLong)nSize)*2+4,W_META_POLYLINE); *pWMF << nSize; for (i=0; i<nSize; i++) WritePointXY(aSimplePoly.GetPoint(i)); } @@ -784,7 +784,7 @@ void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly) void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly) { const Polygon * pPoly; - USHORT nCount,nSize,i,j; + sal_uInt16 nCount,nSize,i,j; nCount=rPolyPoly.Count(); PolyPolygon aSimplePolyPoly( rPolyPoly ); @@ -799,7 +799,7 @@ void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly) } WriteRecordHeader(0,W_META_POLYPOLYGON); *pWMF << nCount; - for (i=0; i<nCount; i++) *pWMF << ((USHORT)(aSimplePolyPoly.GetObject(i).GetSize())); + for (i=0; i<nCount; i++) *pWMF << ((sal_uInt16)(aSimplePolyPoly.GetObject(i).GetSize())); for (i=0; i<nCount; i++) { pPoly=&(aSimplePolyPoly.GetObject(i)); nSize=pPoly->GetSize(); @@ -837,7 +837,7 @@ void WMFWriter::WMFRecord_SaveDC() } -void WMFWriter::WMFRecord_SelectObject(USHORT nObjectHandle) +void WMFWriter::WMFRecord_SelectObject(sal_uInt16 nObjectHandle) { WriteRecordHeader(0x00000004,W_META_SELECTOBJECT); *pWMF << nObjectHandle; @@ -851,17 +851,17 @@ void WMFWriter::WMFRecord_SetBkColor(const Color & rColor) } -void WMFWriter::WMFRecord_SetBkMode(BOOL bTransparent) +void WMFWriter::WMFRecord_SetBkMode(sal_Bool bTransparent) { WriteRecordHeader(0x00000004,W_META_SETBKMODE); - if (bTransparent==TRUE) *pWMF << (USHORT)W_TRANSPARENT; - else *pWMF << (USHORT)W_OPAQUE; + if (bTransparent==sal_True) *pWMF << (sal_uInt16)W_TRANSPARENT; + else *pWMF << (sal_uInt16)W_OPAQUE; } void WMFWriter::WMFRecord_SetStretchBltMode() { WriteRecordHeader( 0x00000004, W_META_SETSTRETCHBLTMODE ); - *pWMF << (USHORT) 3; // STRETCH_DELETESCANS + *pWMF << (sal_uInt16) 3; // STRETCH_DELETESCANS } void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor) @@ -874,7 +874,7 @@ void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor) void WMFWriter::WMFRecord_SetROP2(RasterOp eROP) { - USHORT nROP2; + sal_uInt16 nROP2; switch (eROP) { case ROP_INVERT: nROP2=W_R2_NOT; break; @@ -886,9 +886,9 @@ void WMFWriter::WMFRecord_SetROP2(RasterOp eROP) } -void WMFWriter::WMFRecord_SetTextAlign(FontAlign eFontAlign, UINT32 eHorTextAlign) +void WMFWriter::WMFRecord_SetTextAlign(FontAlign eFontAlign, sal_uInt32 eHorTextAlign) { - USHORT nAlign; + sal_uInt16 nAlign; switch (eFontAlign) { case ALIGN_TOP: nAlign=W_TA_TOP; break; @@ -927,7 +927,7 @@ void WMFWriter::WMFRecord_SetWindowOrg(const Point & rPoint) void WMFWriter::WMFRecord_StretchDIB( const Point & rPoint, const Size & rSize, const Bitmap & rBitmap, sal_uInt32 nROP ) { - ULONG nPosAnf,nPosEnd; + sal_uLong nPosAnf,nPosEnd; nActBitmapPercent=50; MayCallback(); @@ -987,14 +987,14 @@ void WMFWriter::WMFRecord_TextOut(const Point & rPoint, const String & rStr) void WMFWriter::TrueTextOut(const Point & rPoint, const ByteString& rString) { - USHORT nLen,i; + sal_uInt16 nLen,i; WriteRecordHeader(0,W_META_TEXTOUT); nLen=rString.Len(); *pWMF << nLen; for ( i = 0; i < nLen; i++ ) - *pWMF << (BYTE)rString.GetChar( i ); - if ((nLen&1)!=0) *pWMF << (BYTE)0; + *pWMF << (sal_uInt8)rString.GetChar( i ); + if ((nLen&1)!=0) *pWMF << (sal_uInt8)0; WritePointYX(rPoint); UpdateRecordHeader(); } @@ -1012,30 +1012,30 @@ void WMFWriter::WMFRecord_IntersectClipRect( const Rectangle& rRect ) } -USHORT WMFWriter::AllocHandle() +sal_uInt16 WMFWriter::AllocHandle() { - USHORT i; + sal_uInt16 i; for (i=0; i<MAXOBJECTHANDLES; i++) { - if (bHandleAllocated[i]==FALSE) { - bHandleAllocated[i]=TRUE; + if (bHandleAllocated[i]==sal_False) { + bHandleAllocated[i]=sal_True; return i; } } - bStatus=FALSE; + bStatus=sal_False; return 0xffff; } -void WMFWriter::FreeHandle(USHORT nObjectHandle) +void WMFWriter::FreeHandle(sal_uInt16 nObjectHandle) { - if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=FALSE; + if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=sal_False; } void WMFWriter::CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo ) { - USHORT nOldHandle; + sal_uInt16 nOldHandle; nOldHandle=nDstPenHandle; nDstPenHandle=AllocHandle(); @@ -1050,7 +1050,7 @@ void WMFWriter::CreateSelectDeletePen( const Color& rColor, const LineInfo& rLin void WMFWriter::CreateSelectDeleteFont(const Font & rFont) { - USHORT nOldHandle; + sal_uInt16 nOldHandle; nOldHandle=nDstFontHandle; nDstFontHandle=AllocHandle(); @@ -1065,7 +1065,7 @@ void WMFWriter::CreateSelectDeleteFont(const Font & rFont) void WMFWriter::CreateSelectDeleteBrush(const Color& rColor) { - USHORT nOldHandle; + sal_uInt16 nOldHandle; nOldHandle=nDstBrushHandle; nDstBrushHandle=AllocHandle(); @@ -1097,7 +1097,7 @@ void WMFWriter::SetLineAndFillAttr() CreateSelectDeleteBrush( aDstFillColor ); } if ( bDstIsClipping != bSrcIsClipping || - (bSrcIsClipping==TRUE && aDstClipRegion!=aSrcClipRegion)) { + (bSrcIsClipping==sal_True && aDstClipRegion!=aSrcClipRegion)) { bDstIsClipping=bSrcIsClipping; aDstClipRegion=aSrcClipRegion; } @@ -1182,7 +1182,7 @@ void WMFWriter::HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx: void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) { - ULONG nA, nACount; + sal_uLong nA, nACount; MetaAction* pMA; if( bStatus ) @@ -1700,8 +1700,8 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) const MetaEPSAction* pA = (const MetaEPSAction*)pMA; const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() ); - INT32 nCount = aGDIMetaFile.GetActionCount(); - for ( INT32 i = 0; i < nCount; i++ ) + sal_Int32 nCount = aGDIMetaFile.GetActionCount(); + for ( sal_Int32 i = 0; i < nCount; i++ ) { const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i ); if ( pMetaAct->GetType() == META_BMPSCALE_ACTION ) @@ -1830,9 +1830,9 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) MayCallback(); if (pWMF->GetError()) - bStatus=FALSE; + bStatus=sal_False; - if(bStatus==FALSE) + if(bStatus==sal_False) break; } } @@ -1840,13 +1840,13 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) // ------------------------------------------------------------------------ -void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable ) +void WMFWriter::WriteHeader( const GDIMetaFile &, sal_Bool bPlaceable ) { if( bPlaceable ) { - USHORT nCheckSum, nValue; + sal_uInt16 nCheckSum, nValue; Size aSize( pVirDev->LogicToLogic(Size(1,1),MapMode(MAP_INCH), aTargetMapMode) ); - USHORT nUnitsPerInch = (USHORT) ( ( aSize.Width() + aSize.Height() ) >> 1 ); + sal_uInt16 nUnitsPerInch = (sal_uInt16) ( ( aSize.Width() + aSize.Height() ) >> 1 ); nCheckSum=0; nValue=0xcdd7; nCheckSum^=nValue; *pWMF << nValue; @@ -1854,8 +1854,8 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable ) nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; - nValue=(USHORT) aTargetSize.Width(); nCheckSum^=nValue; *pWMF << nValue; - nValue=(USHORT) aTargetSize.Height(); nCheckSum^=nValue; *pWMF << nValue; + nValue=(sal_uInt16) aTargetSize.Width(); nCheckSum^=nValue; *pWMF << nValue; + nValue=(sal_uInt16) aTargetSize.Height(); nCheckSum^=nValue; *pWMF << nValue; nValue=nUnitsPerInch; nCheckSum^=nValue; *pWMF << nValue; nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; @@ -1876,13 +1876,13 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable ) void WMFWriter::UpdateHeader() { - ULONG nPos; + sal_uLong nPos; sal_uInt32 nFileSize; nPos=pWMF->Tell(); // Endposition = Gesammtgroesse der Datei nFileSize=nPos-nMetafileHeaderPos; // Groesse des 1. Headers abziehen if ((nFileSize&1)!=0) { // ggf. auf ganze Worte aufrunden - *pWMF << (BYTE)0; + *pWMF << (sal_uInt8)0; nPos++; nFileSize++; } @@ -1896,13 +1896,13 @@ void WMFWriter::UpdateHeader() // ------------------------------------------------------------------------ -BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, - FilterConfigItem* pFConfigItem, BOOL bPlaceable ) +sal_Bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, + FilterConfigItem* pFConfigItem, sal_Bool bPlaceable ) { WMFWriterAttrStackMember * pAt; - bEmbedEMF = TRUE; - bStatus=TRUE; + bEmbedEMF = sal_True; + bStatus=sal_True; pConvert = 0; pVirDev = new VirtualDevice; @@ -1949,8 +1949,8 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, pAttrStack=NULL; - for (USHORT i=0; i<MAXOBJECTHANDLES; i++) - bHandleAllocated[i]=FALSE; + for (sal_uInt16 i=0; i<MAXOBJECTHANDLES; i++) + bHandleAllocated[i]=sal_False; nDstPenHandle=0xffff; nDstFontHandle=0xffff; @@ -1969,7 +1969,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, WriteEmbeddedEMF( rMTF ); WMFRecord_SetWindowOrg(Point(0,0)); WMFRecord_SetWindowExt(rMTF.GetPrefSize()); - WMFRecord_SetBkMode( TRUE ); + WMFRecord_SetBkMode( sal_True ); eDstROP2 = eSrcRasterOp = ROP_OVERPAINT; WMFRecord_SetROP2(eDstROP2); @@ -1982,7 +1982,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, CreateSelectDeleteBrush( aDstFillColor ); aDstClipRegion = aSrcClipRegion = Region(); - bDstIsClipping = bSrcIsClipping = FALSE; + bDstIsClipping = bSrcIsClipping = sal_False; Font aFont; aFont.SetCharSet( GetExtendedTextEncoding( gsl_getSystemTextEncoding() ) ); @@ -2022,11 +2022,11 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, // ------------------------------------------------------------------------ -USHORT WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode, +sal_uInt16 WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize) { Fraction aDivFrac(2, 1); - USHORT nDivisor = 1; + sal_uInt16 nDivisor = 1; Size aSize = pVirDev->LogicToLogic( rPrefSize, aSrcMapMode, rMapMode ); diff --git a/svtools/source/filter/wmf/wmfwr.hxx b/svtools/source/filter/wmf/wmfwr.hxx index 9fe698b22c2e..a76b39ad154f 100644 --- a/svtools/source/filter/wmf/wmfwr.hxx +++ b/svtools/source/filter/wmf/wmfwr.hxx @@ -69,9 +69,9 @@ class WMFWriter { private: - BOOL bStatus; + sal_Bool bStatus; - ULONG nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde. + sal_uLong nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde. FilterConfigItem* pFilterConfigItem; com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator; @@ -81,11 +81,11 @@ private: StarSymbolToMSMultiFont *pConvert; MapMode aTargetMapMode; Size aTargetSize; - USHORT nTargetDivisor; + sal_uInt16 nTargetDivisor; - ULONG nMetafileHeaderPos; + sal_uLong nMetafileHeaderPos; sal_uInt32 nMaxRecordSize; // in Worten - ULONG nActRecordPos; + sal_uLong nActRecordPos; // Aktuelle Attribute im Quell-Metafile: Color aSrcLineColor; @@ -96,11 +96,11 @@ private: FontAlign eSrcTextAlign; Font aSrcFont; MapMode aSrcMapMode; - BOOL bSrcIsClipping; + sal_Bool bSrcIsClipping; Region aSrcClipRegion; WMFWriterAttrStackMember * pAttrStack; - UINT32 eSrcHorTextAlign; + sal_uInt32 eSrcHorTextAlign; // Aktuelle Attribute im Ziel-Metafile: Color aDstLineColor; @@ -111,24 +111,24 @@ private: FontAlign eDstTextAlign; Font aDstFont; - UINT32 eDstHorTextAlign; + sal_uInt32 eDstHorTextAlign; - BOOL bDstIsClipping; // ???: derzeit unberuecksichtigt + sal_Bool bDstIsClipping; // ???: derzeit unberuecksichtigt Region aDstClipRegion; // ???: derzeit unberuecksichtigt - BOOL bHandleAllocated[MAXOBJECTHANDLES]; // Welche Handles vergeben sind - USHORT nDstPenHandle,nDstFontHandle,nDstBrushHandle; // Welche Handles die jeweiligen + sal_Bool bHandleAllocated[MAXOBJECTHANDLES]; // Welche Handles vergeben sind + sal_uInt16 nDstPenHandle,nDstFontHandle,nDstBrushHandle; // Welche Handles die jeweiligen // Selected-Objects besitzen // 0xffff = keines: // Damit nicht bei jeder Operation alle Attribute verglichen werden muessen: - ULONG nNumberOfActions; // Anzahl der Actions im GDIMetafile - ULONG nNumberOfBitmaps; // Anzahl der Bitmaps - ULONG nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders - ULONG nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps - ULONG nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist. + sal_uLong nNumberOfActions; // Anzahl der Actions im GDIMetafile + sal_uLong nNumberOfBitmaps; // Anzahl der Bitmaps + sal_uLong nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders + sal_uLong nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps + sal_uLong nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist. - BOOL bEmbedEMF; // optionally embedd EMF data into WMF + sal_Bool bEmbedEMF; // optionally embedd EMF data into WMF void MayCallback(); // Berechnet anhand der obigen 5 Parameter eine Prozentzahl @@ -161,7 +161,7 @@ private: void WMFRecord_CreateBrushIndirect(const Color& rColor); void WMFRecord_CreateFontIndirect(const Font & rFont); void WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo ); - void WMFRecord_DeleteObject(USHORT nObjectHandle); + void WMFRecord_DeleteObject(sal_uInt16 nObjectHandle); void WMFRecord_Ellipse(const Rectangle & rRect); void WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_Int8* pData ); sal_Bool WMFRecord_Escape_Unicode( const Point& rPoint, const String& rStr, const sal_Int32 * pDXAry ); @@ -180,13 +180,13 @@ private: void WMFRecord_RestoreDC(); void WMFRecord_RoundRect(const Rectangle & rRect, long nHorzRound, long nVertRound); void WMFRecord_SaveDC(); - void WMFRecord_SelectObject(USHORT nObjectHandle); + void WMFRecord_SelectObject(sal_uInt16 nObjectHandle); void WMFRecord_SetBkColor(const Color & rColor); - void WMFRecord_SetBkMode(BOOL bTransparent); + void WMFRecord_SetBkMode(sal_Bool bTransparent); void WMFRecord_SetStretchBltMode(); void WMFRecord_SetPixel(const Point & rPoint, const Color & rColor); void WMFRecord_SetROP2(RasterOp eROP); - void WMFRecord_SetTextAlign(FontAlign eFontAlign, UINT32 eHorTextAlign); + void WMFRecord_SetTextAlign(FontAlign eFontAlign, sal_uInt32 eHorTextAlign); void WMFRecord_SetTextColor(const Color & rColor); void WMFRecord_SetWindowExt(const Size & rSize); void WMFRecord_SetWindowOrg(const Point & rPoint); @@ -195,8 +195,8 @@ private: void WMFRecord_EndOfFile(); void WMFRecord_IntersectClipRect( const Rectangle& rRect); - USHORT AllocHandle(); - void FreeHandle(USHORT nObjectHandle); + sal_uInt16 AllocHandle(); + void FreeHandle(sal_uInt16 nObjectHandle); void CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo ); void CreateSelectDeleteFont(const Font & rFont); void CreateSelectDeleteBrush(const Color& rColor); @@ -207,7 +207,7 @@ private: void HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); void WriteRecords(const GDIMetaFile & rMTF); - void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable); + void WriteHeader(const GDIMetaFile & rMTF, sal_Bool bPlaceable); void UpdateHeader(); void WriteEmbeddedEMF( const GDIMetaFile& rMTF ); @@ -217,13 +217,13 @@ private: sal_uInt32 nRecCounts, sal_uInt16 nCheckSum ); - USHORT CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize); + sal_uInt16 CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize); public: WMFWriter() {} - BOOL WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, BOOL bPlaceable=TRUE); + sal_Bool WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, sal_Bool bPlaceable=sal_True); }; #endif |