diff options
author | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-09-29 15:46:40 +0800 |
---|---|---|
committer | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-09-29 15:46:40 +0800 |
commit | 94ff531ca59a495547530f5c080d8e04e1f34ace (patch) | |
tree | 50597c12e13de7688d1eb42a7bb72e5fbd25f3eb /vcl/source/gdi/impgraph.cxx | |
parent | af9614943d37f8e7c6a068cde7497dd7f6248451 (diff) |
removetooltypes: #i112600# some more changes in vcl and tools, reverted config strings in l10ntools and rsc
Diffstat (limited to 'vcl/source/gdi/impgraph.cxx')
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 186 |
1 files changed, 93 insertions, 93 deletions
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 397a5d6b704a..01952913c2eb 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -70,7 +70,7 @@ struct ImpSwapFile { INetURLObject aSwapURL; - ULONG nRefCount; + sal_uIntPtr nRefCount; }; // ----------------- @@ -90,15 +90,15 @@ GraphicReader::~GraphicReader() // ------------------------------------------------------------------------ -BOOL GraphicReader::IsPreviewModeEnabled() const +sal_Bool GraphicReader::IsPreviewModeEnabled() const { if( !mpReaderData ) - return FALSE; + return sal_False; if( mpReaderData->maPreviewSize.Width() ) - return TRUE; + return sal_True; if( mpReaderData->maPreviewSize.Height() ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } // ------------------------------------------------------------------------ @@ -141,8 +141,8 @@ ImpGraphic::ImpGraphic() : mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), - mbSwapOut ( FALSE ), - mbSwapUnderway ( FALSE ) + mbSwapOut ( sal_False ), + mbSwapUnderway ( sal_False ) { } @@ -159,7 +159,7 @@ ImpGraphic::ImpGraphic( const ImpGraphic& rImpGraphic ) : mnSizeBytes ( rImpGraphic.mnSizeBytes ), mnRefCount ( 1UL ), mbSwapOut ( rImpGraphic.mbSwapOut ), - mbSwapUnderway ( FALSE ) + mbSwapUnderway ( sal_False ) { if( mpSwapFile ) mpSwapFile->nRefCount++; @@ -190,8 +190,8 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) : mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), - mbSwapOut ( FALSE ), - mbSwapUnderway ( FALSE ) + mbSwapOut ( sal_False ), + mbSwapUnderway ( sal_False ) { } @@ -207,8 +207,8 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) : mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), - mbSwapOut ( FALSE ), - mbSwapUnderway ( FALSE ) + mbSwapOut ( sal_False ), + mbSwapUnderway ( sal_False ) { } @@ -224,8 +224,8 @@ ImpGraphic::ImpGraphic( const Animation& rAnimation ) : mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), - mbSwapOut ( FALSE ), - mbSwapUnderway ( FALSE ) + mbSwapOut ( sal_False ), + mbSwapUnderway ( sal_False ) { } @@ -241,8 +241,8 @@ ImpGraphic::ImpGraphic( const GDIMetaFile& rMtf ) : mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), - mbSwapOut ( FALSE ), - mbSwapUnderway ( FALSE ) + mbSwapOut ( sal_False ), + mbSwapUnderway ( sal_False ) { } @@ -252,7 +252,7 @@ ImpGraphic::~ImpGraphic() { ImplClear(); - if( (ULONG) mpContext > 1UL ) + if( (sal_uIntPtr) mpContext > 1UL ) delete mpContext; } @@ -306,24 +306,24 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic ) // ------------------------------------------------------------------------ -BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const +sal_Bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( this == &rImpGraphic ) - bRet = TRUE; + bRet = sal_True; else if( !ImplIsSwapOut() && ( rImpGraphic.meType == meType ) ) { switch( meType ) { case( GRAPHIC_NONE ): - bRet = TRUE; + bRet = sal_True; break; case( GRAPHIC_GDIMETAFILE ): { if( rImpGraphic.maMetaFile == maMetaFile ) - bRet = TRUE; + bRet = sal_True; } break; @@ -332,10 +332,10 @@ BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const if( mpAnimation ) { if( rImpGraphic.mpAnimation && ( *rImpGraphic.mpAnimation == *mpAnimation ) ) - bRet = TRUE; + bRet = sal_True; } else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maEx == maEx ) ) - bRet = TRUE; + bRet = sal_True; } break; @@ -349,7 +349,7 @@ BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const // ------------------------------------------------------------------------ -void ImpGraphic::ImplClearGraphics( BOOL bCreateSwapInfo ) +void ImpGraphic::ImplClearGraphics( sal_Bool bCreateSwapInfo ) { if( bCreateSwapInfo && !ImplIsSwapOut() ) { @@ -411,12 +411,12 @@ void ImpGraphic::ImplClear() mpSwapFile = NULL; } - mbSwapOut = FALSE; + mbSwapOut = sal_False; mnDocFilePos = 0UL; maDocFileURLStr.Erase(); // cleanup - ImplClearGraphics( FALSE ); + ImplClearGraphics( sal_False ); meType = GRAPHIC_NONE; mnSizeBytes = 0; } @@ -438,42 +438,42 @@ void ImpGraphic::ImplSetDefaultType() // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplIsSupportedGraphic() const +sal_Bool ImpGraphic::ImplIsSupportedGraphic() const { return( meType != GRAPHIC_NONE ); } // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplIsTransparent() const +sal_Bool ImpGraphic::ImplIsTransparent() const { - BOOL bRet; + sal_Bool bRet; if( meType == GRAPHIC_BITMAP ) bRet = ( mpAnimation ? mpAnimation->IsTransparent() : maEx.IsTransparent() ); else - bRet = TRUE; + bRet = sal_True; return bRet; } // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplIsAlpha() const +sal_Bool ImpGraphic::ImplIsAlpha() const { - BOOL bRet; + sal_Bool bRet; if( meType == GRAPHIC_BITMAP ) bRet = ( NULL == mpAnimation ) && maEx.IsAlpha(); else - bRet = FALSE; + bRet = sal_False; return bRet; } // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplIsAnimated() const +sal_Bool ImpGraphic::ImplIsAnimated() const { return( mpAnimation != NULL ); } @@ -729,7 +729,7 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode ) // ------------------------------------------------------------------------ -ULONG ImpGraphic::ImplGetSizeBytes() const +sal_uIntPtr ImpGraphic::ImplGetSizeBytes() const { if( 0 == mnSizeBytes ) { @@ -856,7 +856,7 @@ Link ImpGraphic::ImplGetAnimationNotifyHdl() const // ------------------------------------------------------------------------ -ULONG ImpGraphic::ImplGetAnimationLoopCount() const +sal_uIntPtr ImpGraphic::ImplGetAnimationLoopCount() const { return( mpAnimation ? mpAnimation->GetLoopCount() : 0UL ); } @@ -892,7 +892,7 @@ void ImpGraphic::ImplSetContext( GraphicReader* pReader ) // ------------------------------------------------------------------------ -void ImpGraphic::ImplSetDocFileName( const String& rName, ULONG nFilePos ) +void ImpGraphic::ImplSetDocFileName( const String& rName, sal_uIntPtr nFilePos ) { const INetURLObject aURL( rName ); @@ -911,29 +911,29 @@ const String& ImpGraphic::ImplGetDocFileName() const // ------------------------------------------------------------------------ -ULONG ImpGraphic::ImplGetDocFilePos() const +sal_uIntPtr ImpGraphic::ImplGetDocFilePos() const { return mnDocFilePos; } // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap ) +sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap ) { MapMode aMapMode; Size aSize; - const ULONG nStartPos = rIStm.Tell(); + const sal_uIntPtr nStartPos = rIStm.Tell(); sal_uInt32 nId; - ULONG nHeaderLen; + sal_uIntPtr nHeaderLen; long nType; long nLen; - const USHORT nOldFormat = rIStm.GetNumberFormatInt(); - BOOL bRet = FALSE; + const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); + sal_Bool bRet = sal_False; if( !mbSwapUnderway ) { const String aTempURLStr( maDocFileURLStr ); - const ULONG nTempPos = mnDocFilePos; + const sal_uIntPtr nTempPos = mnDocFilePos; ImplClear(); @@ -1018,7 +1018,7 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap ) if( maDocFileURLStr.Len() ) { rIStm.Seek( nStartPos + nHeaderLen + nLen ); - bRet = mbSwapOut = TRUE; + bRet = mbSwapOut = sal_True; } else { @@ -1031,9 +1031,9 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap ) if( pOStm ) { - ULONG nFullLen = nHeaderLen + nLen; - ULONG nPartLen = Min( nFullLen, (ULONG) GRAPHIC_MAXPARTLEN ); - BYTE* pBuffer = (BYTE*) rtl_allocateMemory( nPartLen ); + sal_uIntPtr nFullLen = nHeaderLen + nLen; + sal_uIntPtr nPartLen = Min( nFullLen, (sal_uIntPtr) GRAPHIC_MAXPARTLEN ); + sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( nPartLen ); pOStm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -1053,12 +1053,12 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap ) } rtl_freeMemory( pBuffer ); - ULONG nReadErr = rIStm.GetError(), nWriteErr = pOStm->GetError(); + sal_uIntPtr nReadErr = rIStm.GetError(), nWriteErr = pOStm->GetError(); delete pOStm, pOStm = NULL; if( !nReadErr && !nWriteErr ) { - bRet = mbSwapOut = TRUE; + bRet = mbSwapOut = sal_True; mpSwapFile = new ImpSwapFile; mpSwapFile->nRefCount = 1; mpSwapFile->aSwapURL = aTmpURL; @@ -1101,9 +1101,9 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap ) else if( meType >= SYS_WINMETAFILE && meType <= SYS_MACMETAFILE ) { Graphic aSysGraphic; - ULONG nCvtType; + sal_uIntPtr nCvtType; - switch( sal::static_int_cast<ULONG>(meType) ) + switch( sal::static_int_cast<sal_uIntPtr>(meType) ) { case( SYS_WINMETAFILE ): case( SYS_WNTMETAFILE ): nCvtType = CVT_WMF; break; @@ -1131,7 +1131,7 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap ) } } else - bRet = TRUE; + bRet = sal_True; rIStm.SetNumberFormatInt( nOldFormat ); @@ -1140,16 +1140,16 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap ) // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) +sal_Bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( ( meType != GRAPHIC_NONE ) && ( meType != GRAPHIC_DEFAULT ) && !ImplIsSwapOut() ) { const MapMode aMapMode( ImplGetPrefMapMode() ); const Size aSize( ImplGetPrefSize() ); - const USHORT nOldFormat = rOStm.GetNumberFormatInt(); - ULONG nDataFieldPos; + const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt(); + sal_uIntPtr nDataFieldPos; rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -1196,18 +1196,18 @@ BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) // write data block if( !rOStm.GetError() ) { - const ULONG nDataStart = rOStm.Tell(); + const sal_uIntPtr nDataStart = rOStm.Tell(); if( ImplIsSupportedGraphic() ) rOStm << *this; if( !rOStm.GetError() ) { - const ULONG nStmPos2 = rOStm.Tell(); + const sal_uIntPtr nStmPos2 = rOStm.Tell(); rOStm.Seek( nDataFieldPos ); rOStm << (long) ( nStmPos2 - nDataStart ); rOStm.Seek( nStmPos2 ); - bRet = TRUE; + bRet = sal_True; } } @@ -1219,9 +1219,9 @@ BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplSwapOut() +sal_Bool ImpGraphic::ImplSwapOut() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !ImplIsSwapOut() ) { @@ -1239,7 +1239,7 @@ BOOL ImpGraphic::ImplSwapOut() pOStm->SetVersion( SOFFICE_FILEFORMAT_50 ); pOStm->SetCompressMode( COMPRESSMODE_NATIVE ); - if( ( bRet = ImplSwapOut( pOStm ) ) == TRUE ) + if( ( bRet = ImplSwapOut( pOStm ) ) == sal_True ) { mpSwapFile = new ImpSwapFile; mpSwapFile->nRefCount = 1; @@ -1277,8 +1277,8 @@ BOOL ImpGraphic::ImplSwapOut() } else { - ImplClearGraphics( TRUE ); - bRet = mbSwapOut = TRUE; + ImplClearGraphics( sal_True ); + bRet = mbSwapOut = sal_True; } } @@ -1287,9 +1287,9 @@ BOOL ImpGraphic::ImplSwapOut() // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm ) +sal_Bool ImpGraphic::ImplSwapOut( SvStream* pOStm ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( pOStm ) { @@ -1301,15 +1301,15 @@ BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm ) if( !pOStm->GetError() ) { - ImplClearGraphics( TRUE ); - bRet = mbSwapOut = TRUE; + ImplClearGraphics( sal_True ); + bRet = mbSwapOut = sal_True; } } } else { - ImplClearGraphics( TRUE ); - bRet = mbSwapOut = TRUE; + ImplClearGraphics( sal_True ); + bRet = mbSwapOut = sal_True; } return bRet; @@ -1317,9 +1317,9 @@ BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm ) // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplSwapIn() +sal_Bool ImpGraphic::ImplSwapIn() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( ImplIsSwapOut() ) { @@ -1386,9 +1386,9 @@ BOOL ImpGraphic::ImplSwapIn() // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm ) +sal_Bool ImpGraphic::ImplSwapIn( SvStream* pIStm ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( pIStm ) { @@ -1396,14 +1396,14 @@ BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm ) if( !pIStm->GetError() ) { - mbSwapUnderway = TRUE; + mbSwapUnderway = sal_True; bRet = ImplReadEmbedded( *pIStm ); - mbSwapUnderway = FALSE; + mbSwapUnderway = sal_False; if( !bRet ) ImplClear(); else - mbSwapOut = FALSE; + mbSwapOut = sal_False; } } @@ -1412,7 +1412,7 @@ BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm ) // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplIsSwapOut() const +sal_Bool ImpGraphic::ImplIsSwapOut() const { return mbSwapOut; } @@ -1437,16 +1437,16 @@ GfxLink ImpGraphic::ImplGetLink() // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplIsLink() const +sal_Bool ImpGraphic::ImplIsLink() const { - return ( mpGfxLink != NULL ) ? TRUE : FALSE; + return ( mpGfxLink != NULL ) ? sal_True : sal_False; } // ------------------------------------------------------------------------ -ULONG ImpGraphic::ImplGetChecksum() const +sal_uIntPtr ImpGraphic::ImplGetChecksum() const { - ULONG nRet = 0; + sal_uIntPtr nRet = 0; if( ImplIsSupportedGraphic() && !ImplIsSwapOut() ) { @@ -1475,9 +1475,9 @@ ULONG ImpGraphic::ImplGetChecksum() const // ------------------------------------------------------------------------ -BOOL ImpGraphic::ImplExportNative( SvStream& rOStm ) const +sal_Bool ImpGraphic::ImplExportNative( SvStream& rOStm ) const { - BOOL bResult = FALSE; + sal_Bool bResult = sal_False; if( !rOStm.GetError() ) { @@ -1504,7 +1504,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic ) { if( !rIStm.GetError() ) { - const ULONG nStmPos1 = rIStm.Tell(); + const sal_uIntPtr nStmPos1 = rIStm.Tell(); sal_uInt32 nTmp; if ( !rImpGraphic.mbSwapUnderway ) @@ -1538,7 +1538,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic ) if( !rIStm.GetError() && aLink.LoadNative( aGraphic ) ) { // set link only, if no other link was set - const BOOL bSetLink = ( rImpGraphic.mpGfxLink == NULL ); + const sal_Bool bSetLink = ( rImpGraphic.mpGfxLink == NULL ); // assign graphic rImpGraphic = *aGraphic.ImplGetImpGraphic(); @@ -1561,7 +1561,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic ) else { BitmapEx aBmpEx; - const USHORT nOldFormat = rIStm.GetNumberFormatInt(); + const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); rIStm.SeekRel( -4 ); rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -1569,8 +1569,8 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic ) if( !rIStm.GetError() ) { - UINT32 nMagic1(0), nMagic2(0); - ULONG nActPos = rIStm.Tell(); + sal_uInt32 nMagic1(0), nMagic2(0); + sal_uIntPtr nActPos = rIStm.Tell(); rIStm >> nMagic1 >> nMagic2; rIStm.Seek( nActPos ); @@ -1640,7 +1640,7 @@ SvStream& operator<<( SvStream& rOStm, const ImpGraphic& rImpGraphic ) else { // own format - const USHORT nOldFormat = rOStm.GetNumberFormatInt(); + const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt(); rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); switch( rImpGraphic.ImplGetType() ) |