diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2013-06-12 10:26:29 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2013-06-12 13:33:02 +0900 |
commit | d9b7d3a2dd943d246e7d09b3539628e2e357a307 (patch) | |
tree | ffed34a518801b81a6514d602379f31155894fff /vcl | |
parent | a8e52f12d277d9f6ee508f6512f3028810ec12ab (diff) |
sal_Bool to bool
Change-Id: I85944f6912f01d883da976d5dd967f435104bad0
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/impimagetree.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/outdev6.cxx | 22 | ||||
-rw-r--r-- | vcl/source/gdi/outmap.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfextoutdevdata.cxx | 14 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.hxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 28 | ||||
-rw-r--r-- | vcl/source/gdi/pngread.cxx | 146 |
8 files changed, 114 insertions, 114 deletions
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx index fbeccef1bd17..426738bef45e 100644 --- a/vcl/source/gdi/impimagetree.cxx +++ b/vcl/source/gdi/impimagetree.cxx @@ -106,7 +106,7 @@ static void loadImageFromStream( if (rPath.endsWith(".png")) { vcl::PNGReader aPNGReader( *pStream ); - aPNGReader.SetIgnoreGammaChunk( sal_True ); + aPNGReader.SetIgnoreGammaChunk( true ); rBitmap = aPNGReader.Read(); } else { *pStream >> rBitmap; diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index d63ce7ad6bbc..6b4f90e5e87a 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -791,9 +791,9 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY, GDIMetaFile* pOldMetaFile = mpMetaFile; const WallpaperStyle eStyle = rWallpaper.GetStyle(); const sal_Bool bOldMap = mbMap; - sal_Bool bDrawn = sal_False; - sal_Bool bDrawGradientBackground = sal_False; - sal_Bool bDrawColorBackground = sal_False; + bool bDrawn = false; + bool bDrawGradientBackground = false; + bool bDrawColorBackground = false; if( pCached ) aBmpEx = *pCached; @@ -808,7 +808,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY, if( bTransparent ) { if( rWallpaper.IsGradient() ) - bDrawGradientBackground = sal_True; + bDrawGradientBackground = true; else { if( !pCached && !rWallpaper.GetColor().GetTransparency() ) @@ -820,15 +820,15 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY, aBmpEx = aVDev.GetBitmap( Point(), aVDev.GetOutputSizePixel() ); } - bDrawColorBackground = sal_True; + bDrawColorBackground = true; } } else if( eStyle != WALLPAPER_TILE && eStyle != WALLPAPER_SCALE ) { if( rWallpaper.IsGradient() ) - bDrawGradientBackground = sal_True; + bDrawGradientBackground = true; else - bDrawColorBackground = sal_True; + bDrawColorBackground = true; } // background of bitmap? @@ -837,7 +837,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY, else if( bDrawColorBackground && bTransparent ) { ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper ); - bDrawColorBackground = sal_False; + bDrawColorBackground = false; } // calc pos and size @@ -954,7 +954,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY, for( long nBmpX = nStartX; nBmpX <= nRight; nBmpX += nBmpWidth ) DrawBitmapEx( Point( nBmpX, nBmpY ), aBmpEx ); - bDrawn = sal_True; + bDrawn = true; } break; } @@ -1030,7 +1030,7 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY, Rectangle aBound; GDIMetaFile* pOldMetaFile = mpMetaFile; const sal_Bool bOldMap = mbMap; - sal_Bool bNeedGradient = sal_True; + bool bNeedGradient = true; aBound = Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ); @@ -1052,7 +1052,7 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY, if( mnOutOffX+nWidth > gradientWidth ) ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper.GetGradient().GetEndColor() ); if( mnOutOffX > gradientWidth ) - bNeedGradient = sal_False; + bNeedGradient = false; else aBound = Rectangle( Point( -mnOutOffX, nY ), Size( gradientWidth, nHeight ) ); } diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx index ed02ae063460..25cbb53460bf 100644 --- a/vcl/source/gdi/outmap.cxx +++ b/vcl/source/gdi/outmap.cxx @@ -740,7 +740,7 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode ) { DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice ); - sal_Bool bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE); + bool bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE); if ( mpMetaFile ) { diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index 9895867062b4..c2cb6aecbf1c 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -299,9 +299,9 @@ struct SAL_DLLPRIVATE PageSyncData mControls; GlobalSyncData* mpGlobalData; - sal_Bool mbGroupIgnoreGDIMtfActions; + bool mbGroupIgnoreGDIMtfActions; - PageSyncData( GlobalSyncData* pGlobal ) : mbGroupIgnoreGDIMtfActions ( sal_False ) { mpGlobalData = pGlobal; } + PageSyncData( GlobalSyncData* pGlobal ) : mbGroupIgnoreGDIMtfActions ( false ) { mpGlobalData = pGlobal; } void PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDataSync::Action eAct ); sal_Bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const PDFExtOutDevData& rOutDevData ); @@ -393,7 +393,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM { /* first determining if this BeginGroup is starting a GfxLink, by searching for a EndGroup or a EndGroupGfxLink */ - mbGroupIgnoreGDIMtfActions = sal_False; + mbGroupIgnoreGDIMtfActions = false; std::deque< PDFExtOutDevDataSync >::iterator aBeg = mActions.begin(); std::deque< PDFExtOutDevDataSync >::iterator aEnd = mActions.end(); while ( aBeg != aEnd ) @@ -409,7 +409,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM Graphic& rGraphic = mGraphics.front(); if ( rGraphic.IsLink() && rGraphic.GetLink().GetType() == GFX_LINK_TYPE_NATIVE_JPG ) { - mbGroupIgnoreGDIMtfActions = sal_True; + mbGroupIgnoreGDIMtfActions = true; } } break; @@ -420,7 +420,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM break; case PDFExtOutDevDataSync::EndGroup : { - mbGroupIgnoreGDIMtfActions = sal_False; + mbGroupIgnoreGDIMtfActions = false; } break; case PDFExtOutDevDataSync::EndGroupGfxLink : @@ -437,7 +437,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM if ( mbGroupIgnoreGDIMtfActions ) { - sal_Bool bClippingNeeded = ( aOutputRect != aVisibleOutputRect ) && !aVisibleOutputRect.IsEmpty(); + bool bClippingNeeded = ( aOutputRect != aVisibleOutputRect ) && !aVisibleOutputRect.IsEmpty(); GfxLink aGfxLink( aGraphic.GetLink() ); if ( aGfxLink.GetType() == GFX_LINK_TYPE_NATIVE_JPG ) @@ -463,7 +463,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM if ( bClippingNeeded ) rWriter.Pop(); } - mbGroupIgnoreGDIMtfActions = sal_False; + mbGroupIgnoreGDIMtfActions = false; } } break; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index bae72fe48e94..ed69f76e99c1 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2163,11 +2163,11 @@ bool PDFWriterImpl::writeBuffer( const void* pBuffer, sal_uInt64 nBytes ) } else { - sal_Bool buffOK = sal_True; + bool buffOK = true; if( m_bEncryptThisStream ) { /* implement the encryption part of the PDF spec encryption algorithm 3.1 */ - if( ( buffOK = checkEncryptionBufferSize( static_cast<sal_Int32>(nBytes) ) ) != sal_False ) + if( ( buffOK = checkEncryptionBufferSize( static_cast<sal_Int32>(nBytes) ) ) ) rtl_cipher_encodeARCFOUR( m_aCipher, (sal_uInt8*)pBuffer, static_cast<sal_Size>(nBytes), m_pEncryptionBuffer, static_cast<sal_Size>(nBytes) ); @@ -4587,7 +4587,7 @@ we check in the following sequence: sal_Int32 nSetGoToRMode = 0; sal_Bool bTargetHasPDFExtension = sal_False; INetProtocol eTargetProtocol = aTargetURL.GetProtocol(); - sal_Bool bIsUNCPath = sal_False; + bool bIsUNCPath = false; // check if the protocol is a known one, or if there is no protocol at all (on target only) // if there is no protocol, make the target relative to the current document directory // getting the needed URL information from the current document path @@ -4595,7 +4595,7 @@ we check in the following sequence: { if( rLink.m_aURL.getLength() > 4 && rLink.m_aURL.startsWith("\\\\\\\\")) { - bIsUNCPath = sal_True; + bIsUNCPath = true; } else { diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 81ccbf649341..890bba6eb8fb 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -802,7 +802,7 @@ i12626 sal_Int32 m_nRC4KeyLength; // key length, 16 or 10, to be input to the algorith 3.1 /* set to true if the following stream must be encrypted, used inside writeBuffer() */ - sal_Bool m_bEncryptThisStream; + bool m_bEncryptThisStream; /* the numerical value of the access permissions, according to PDF spec, must be signed */ sal_Int32 m_nAccessPermissions; @@ -816,7 +816,7 @@ i12626 sal_Int32 m_nEncryptionBufferSize; /* check and reallocate the buffer for encryption */ - sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize ); + bool checkEncryptionBufferSize( register sal_Int32 newSize ); /* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */ void checkAndEnableStreamEncryption( register sal_Int32 nObject ); @@ -1015,7 +1015,7 @@ i12626 void drawEmphasisMark( long nX, long nY, const PolyPolygon& rPolyPoly, sal_Bool bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 ); /* true if PDF/A-1a or PDF/A-1b is output */ - sal_Bool m_bIsPDF_A1; + bool m_bIsPDF_A1; PDFWriter& m_rOuterFace; /* diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index a8e0d7d96f73..4cae63095920 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -151,9 +151,9 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz if( nDepth > 1 ) aBitmapEx.Convert( eConv ); } - sal_Bool bUseJPGCompression = !i_rContext.m_bOnlyLosslessCompression; + bool bUseJPGCompression = !i_rContext.m_bOnlyLosslessCompression; if ( ( aSizePixel.Width() < 32 ) || ( aSizePixel.Height() < 32 ) ) - bUseJPGCompression = sal_False; + bUseJPGCompression = false; SvMemoryStream aStrm; Bitmap aMask; @@ -206,7 +206,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz xOut->flush(); if ( xSeekable->getLength() > nZippedFileSize ) { - bUseJPGCompression = sal_False; + bUseJPGCompression = false; } else { @@ -229,7 +229,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz } catch( uno::Exception& ) { - bUseJPGCompression = sal_False; + bUseJPGCompression = false; } } if ( bUseJPGCompression ) @@ -518,7 +518,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa if( pA->GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_BEGIN")) { const MetaGradientExAction* pGradAction = NULL; - sal_Bool bDone = sal_False; + bool bDone = false; while( !bDone && ( ++i < nCount ) ) { @@ -529,7 +529,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa else if( ( pAction->GetType() == META_COMMENT_ACTION ) && ( ( (const MetaCommentAction*) pAction )->GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_END")) ) { - bDone = sal_True; + bDone = true; } } @@ -548,7 +548,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa if ( pData ) { SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ ); - sal_Bool bSkipSequence = sal_False; + bool bSkipSequence = false; OString sSeqEnd; if( pA->GetComment() == "XPATHSTROKE_SEQ_BEGIN" ) @@ -570,11 +570,11 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa aStroke.getEndArrow( aEndArrow ); aStroke.getDashArray( aDashArray ); - bSkipSequence = sal_True; + bSkipSequence = true; if ( aStartArrow.Count() || aEndArrow.Count() ) - bSkipSequence = sal_False; + bSkipSequence = false; if ( aDashArray.size() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) ) - bSkipSequence = sal_False; + bSkipSequence = false; if ( bSkipSequence ) { PDFWriter::ExtLineInfo aInfo; @@ -650,11 +650,11 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa PolyPolygon aPath; aFill.getPath( aPath ); - bSkipSequence = sal_True; + bSkipSequence = true; m_rOuterFace.DrawPolyPolygon( aPath ); } else if ( fTransparency == 1.0 ) - bSkipSequence = sal_True; + bSkipSequence = true; } /* #i81548# removing optimization for fill textures, because most of the texture settings are not exported properly. In OpenOffice 3.1 the drawing layer will support graphic primitives, then it @@ -735,7 +735,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa aFill.getPath( aPath ); m_rOuterFace.DrawPolyPolygon( aPath, nPattern, aFill.getFillRule() == SvtGraphicFill::fillEvenOdd ); - bSkipSequence = sal_True; + bSkipSequence = true; } */ } @@ -1133,7 +1133,7 @@ EncHashTransporter* EncHashTransporter::getEncHashTransporter( const uno::Refere return pResult; } -sal_Bool PDFWriterImpl::checkEncryptionBufferSize( register sal_Int32 newSize ) +bool PDFWriterImpl::checkEncryptionBufferSize( register sal_Int32 newSize ) { if( m_nEncryptionBufferSize < newSize ) { diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 4eeb6f57d891..777cb3625325 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -111,36 +111,36 @@ private: sal_uInt8 mnInterlaceType; BitmapColor mcTranspColor; // transparency mask's transparency "color" BitmapColor mcOpaqueColor; // transparency mask's opaque "color" - sal_Bool mbTransparent; // graphic includes an tRNS Chunk or an alpha Channel - sal_Bool mbAlphaChannel; // is true for ColorType 4 and 6 - sal_Bool mbRGBTriple; - sal_Bool mbPalette; // sal_False if we need a Palette - sal_Bool mbGrayScale; - sal_Bool mbzCodecInUse; - sal_Bool mbStatus; - sal_Bool mbIDAT; // sal_True if finished with enough IDAT chunks - sal_Bool mbGamma; // sal_True if Gamma Correction available - sal_Bool mbpHYs; // sal_True if pysical size of pixel available - sal_Bool mbIgnoreGammaChunk; + bool mbTransparent; // graphic includes an tRNS Chunk or an alpha Channel + bool mbAlphaChannel; // is true for ColorType 4 and 6 + bool mbRGBTriple; + bool mbPalette; // false if we need a Palette + bool mbGrayScale; + bool mbzCodecInUse; + bool mbStatus; + bool mbIDAT; // true if finished with enough IDAT chunks + bool mbGamma; // true if Gamma Correction available + bool mbpHYs; // true if pysical size of pixel available + bool mbIgnoreGammaChunk; bool ReadNextChunk(); void ReadRemainingChunks(); void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor & ); void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, sal_uInt8 nPalIndex ); - void ImplSetTranspPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor &, sal_Bool bTrans ); + void ImplSetTranspPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor &, bool bTrans ); void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, sal_uInt8 nPalIndex, sal_uInt8 nAlpha ); void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor&, sal_uInt8 nAlpha ); void ImplReadIDAT(); bool ImplPreparePass(); void ImplApplyFilter(); void ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ); - sal_Bool ImplReadTransparent(); + bool ImplReadTransparent(); void ImplGetGamma(); void ImplGetBackground(); sal_uInt8 ImplScaleColor(); - sal_Bool ImplReadHeader( const Size& rPreviewSizeHint ); - sal_Bool ImplReadPalette(); + bool ImplReadHeader( const Size& rPreviewSizeHint ); + bool ImplReadPalette(); void ImplGetGrayPalette( sal_uInt16 ); sal_uInt32 ImplReadsal_uInt32(); @@ -151,7 +151,7 @@ public: BitmapEx GetBitmapEx( const Size& rPreviewSizeHint ); const std::vector< PNGReader::ChunkData >& GetAllChunks(); - void SetIgnoreGammaChunk( sal_Bool bIgnore ){ mbIgnoreGammaChunk = bIgnore; }; + void SetIgnoreGammaChunk( bool bIgnore ){ mbIgnoreGammaChunk = bIgnore; }; }; PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream ) @@ -168,13 +168,13 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream ) mpScanCurrent ( NULL ), mpColorTable ( (sal_uInt8*) mpDefaultColorTable ), mnPass ( 0 ), - mbPalette( sal_False ), - mbzCodecInUse ( sal_False ), - mbStatus( sal_True), - mbIDAT( sal_False ), - mbGamma ( sal_False ), - mbpHYs ( sal_False ), - mbIgnoreGammaChunk ( sal_False ) + mbPalette( false ), + mbzCodecInUse ( false ), + mbStatus( true ), + mbIDAT( false ), + mbGamma ( false ), + mbpHYs ( false ), + mbIgnoreGammaChunk ( false ) { // prepare the PNG data stream mnOrigStreamMode = mrPNGStream.GetNumberFormatInt(); @@ -195,7 +195,7 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream ) mrPNGStream >> nDummy; mbStatus = (nDummy == 0x89504e47); mrPNGStream >> nDummy; - mbStatus &= (nDummy == 0x0d0a1a0a); + mbStatus = (nDummy == 0x0d0a1a0a) && mbStatus; mnPreviewShift = 0; mnPreviewMask = (1 << mnPreviewShift) - 1; @@ -325,7 +325,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) case PNGCHUNK_gAMA : // the gamma chunk must precede { // the 'IDAT' and also the 'PLTE'(if available ) - if ( !mbIgnoreGammaChunk && ( mbIDAT == sal_False ) ) + if ( !mbIgnoreGammaChunk && !mbIDAT ) ImplGetGamma(); } break; @@ -346,7 +346,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) case PNGCHUNK_bKGD : // the background chunk must appear { - if ( ( mbIDAT == sal_False ) && mbPalette ) // before the 'IDAT' and after the + if ( !mbIDAT && mbPalette ) // before the 'IDAT' and after the ImplGetBackground(); // PLTE(if available ) chunk. } break; @@ -354,7 +354,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) case PNGCHUNK_IDAT : { if ( !mpInflateInBuf ) // taking care that the header has properly been read - mbStatus = sal_False; + mbStatus = false; else if ( !mbIDAT ) // the gfx is finished, but there may be left a zlibCRC of about 4Bytes ImplReadIDAT(); } @@ -370,7 +370,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) sal_uInt8 nUnitSpecifier = *maDataIter++; if( (nUnitSpecifier == 1) && nXPixelPerMeter && nYPixelPerMeter ) { - mbpHYs = sal_True; + mbpHYs = true; // convert into MAP_100TH_MM maPhysSize.Width() = (sal_Int32)( (100000.0 * maOrigSize.Width()) / nXPixelPerMeter ); @@ -423,27 +423,27 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) return aRet; } -sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) +bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) { if( mnChunkLen < 13 ) - return sal_False; + return false; maOrigSize.Width() = ImplReadsal_uInt32(); maOrigSize.Height() = ImplReadsal_uInt32(); if (maOrigSize.Width() <= 0 || maOrigSize.Height() <= 0) - return sal_False; + return false; mnPngDepth = *(maDataIter++); mnColorType = *(maDataIter++); mnCompressionType = *(maDataIter++); if( mnCompressionType != 0 ) // unknown compression type - return sal_False; + return false; mnFilterType = *(maDataIter++); if( mnFilterType != 0 ) // unknown filter type - return sal_False; + return false; mnInterlaceType = *(maDataIter++); switch ( mnInterlaceType ) // filter type valid ? @@ -455,12 +455,12 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) mnPass = 0; break; default: - return sal_False; + return false; } - mbPalette = sal_True; - mbIDAT = mbAlphaChannel = mbTransparent = sal_False; - mbGrayScale = mbRGBTriple = sal_False; + mbPalette = true; + mbIDAT = mbAlphaChannel = mbTransparent = false; + mbGrayScale = mbRGBTriple = false; mnTargetDepth = mnPngDepth; sal_uInt64 nScansize64 = ( ( static_cast< sal_uInt64 >( maOrigSize.Width() ) * mnPngDepth ) + 7 ) >> 3; @@ -473,7 +473,7 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) { case 2 : // 2bit target not available -> use four bits mnTargetDepth = 4; // we have to expand the bitmap - mbGrayScale = sal_True; + mbGrayScale = true; break; case 16 : mnTargetDepth = 8; // we have to reduce the bitmap @@ -481,17 +481,17 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) case 1 : case 4 : case 8 : - mbGrayScale = sal_True; + mbGrayScale = true; break; default : - return sal_False; + return false; } } break; case 2 : // each pixel is an RGB triple { - mbRGBTriple = sal_True; + mbRGBTriple = true; nScansize64 *= 3; switch ( mnPngDepth ) { @@ -500,7 +500,7 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) mnTargetDepth = 24; break; default : - return sal_False; + return false; } } break; @@ -515,10 +515,10 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) case 1 : case 4 : case 8 : - mbPalette = sal_False; + mbPalette = false; break; default : - return sal_False; + return false; } } break; @@ -526,25 +526,25 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) case 4 : // each pixel is a grayscale sample followed by an alpha sample { nScansize64 *= 2; - mbAlphaChannel = sal_True; + mbAlphaChannel = true; switch ( mnPngDepth ) { case 16 : mnTargetDepth = 8; // we have to reduce the bitmap case 8 : - mbGrayScale = sal_True; + mbGrayScale = true; break; default : - return sal_False; + return false; } } break; case 6 : // each pixel is an RGB triple followed by an alpha sample { - mbRGBTriple = sal_True; + mbRGBTriple = true; nScansize64 *= 4; - mbAlphaChannel = sal_True; + mbAlphaChannel = true; switch (mnPngDepth ) { case 16 : // we have to reduce the bitmap @@ -552,13 +552,13 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) mnTargetDepth = 24; break; default : - return sal_False; + return false; } } break; default : - return sal_False; + return false; } mnBPP = static_cast< sal_uInt32 >( nScansize64 / maOrigSize.Width() ); @@ -568,7 +568,7 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) nScansize64++; // each scanline includes one filterbyte if ( nScansize64 > SAL_MAX_UINT32 ) - return sal_False; + return false; mnScansize = static_cast< sal_uInt32 >( nScansize64 ); @@ -614,7 +614,7 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) { SAL_WARN( "vcl.gdi", "overlarge png dimensions: " << maTargetSize.Width() << " x " << maTargetSize.Height() << " depth: " << mnTargetDepth); - return sal_False; + return false; } // TODO: switch between both scanlines instead of copying @@ -623,12 +623,12 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) mpScanPrior = new (std::nothrow) sal_uInt8[ mnScansize ]; if ( !mpInflateInBuf || !mpScanPrior ) - return sal_False; + return false; mpBmp = new Bitmap( maTargetSize, mnTargetDepth ); mpAcc = mpBmp->AcquireWriteAccess(); if( !mpAcc ) - return sal_False; + return false; mpBmp->SetSourceSizePixel( maOrigSize ); @@ -638,7 +638,7 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) mpAlphaMask->Erase( 128 ); mpMaskAcc = mpAlphaMask->AcquireWriteAccess(); if( !mpMaskAcc ) - return sal_False; + return false; } if ( mbGrayScale ) @@ -646,7 +646,7 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) ImplPreparePass(); - return sal_True; + return true; } void PNGReaderImpl::ImplGetGrayPalette( sal_uInt16 nBitDepth ) @@ -668,13 +668,13 @@ void PNGReaderImpl::ImplGetGrayPalette( sal_uInt16 nBitDepth ) mpColorTable[ nStart ], mpColorTable[ nStart ] ) ); } -sal_Bool PNGReaderImpl::ImplReadPalette() +bool PNGReaderImpl::ImplReadPalette() { sal_uInt16 nCount = static_cast<sal_uInt16>( mnChunkLen / 3 ); if ( ( ( mnChunkLen % 3 ) == 0 ) && ( ( 0 < nCount ) && ( nCount <= 256 ) ) && mpAcc ) { - mbPalette = sal_True; + mbPalette = true; mpAcc->SetPaletteEntryCount( (sal_uInt16) nCount ); for ( sal_uInt16 i = 0; i < nCount; i++ ) @@ -686,12 +686,12 @@ sal_Bool PNGReaderImpl::ImplReadPalette() } } else - mbStatus = sal_False; + mbStatus = false; return mbStatus; } -sal_Bool PNGReaderImpl::ImplReadTransparent() +bool PNGReaderImpl::ImplReadTransparent() { bool bNeedAlpha = false; @@ -761,13 +761,13 @@ sal_Bool PNGReaderImpl::ImplReadTransparent() } mbTransparent = (mpMaskAcc != NULL); if( !mbTransparent ) - return sal_False; + return false; mcOpaqueColor = BitmapColor( 0x00 ); mcTranspColor = BitmapColor( 0xFF ); mpMaskAcc->Erase( 0x00 ); } - return sal_True; + return true; } void PNGReaderImpl::ImplGetGamma() @@ -781,7 +781,7 @@ void PNGReaderImpl::ImplGetGamma() if ( fInvGamma != 1.0 ) { - mbGamma = sal_True; + mbGamma = true; if ( mpColorTable == mpDefaultColorTable ) mpColorTable = new sal_uInt8[ 256 ]; @@ -861,9 +861,9 @@ void PNGReaderImpl::ImplReadIDAT() { if( mnChunkLen > 0 ) { - if ( mbzCodecInUse == sal_False ) + if ( !mbzCodecInUse ) { - mbzCodecInUse = sal_True; + mbzCodecInUse = true; mpZCodec->BeginCompression( ZCODEC_PNG_DEFAULT ); } mpZCodec->SetBreak( mnChunkLen ); @@ -876,7 +876,7 @@ void PNGReaderImpl::ImplReadIDAT() sal_Int32 nRead = mpZCodec->ReadAsynchron( aIStrm, mpScanCurrent, nToRead ); if ( nRead < 0 ) { - mbStatus = sal_False; + mbStatus = false; break; } if ( nRead < nToRead ) @@ -907,7 +907,7 @@ void PNGReaderImpl::ImplReadIDAT() if( mbIDAT ) { mpZCodec->EndCompression(); - mbzCodecInUse = sal_False; + mbzCodecInUse = false; } } @@ -1280,7 +1280,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) break; default : - mbStatus = sal_False; + mbStatus = false; break; } } @@ -1329,7 +1329,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) sal_uInt8 nRed = pTmp[ 0 ]; sal_uInt8 nGreen = pTmp[ 1 ]; sal_uInt8 nBlue = pTmp[ 2 ]; - sal_Bool bTransparent = ( ( nRed == mnTransRed ) + bool bTransparent = ( ( nRed == mnTransRed ) && ( nGreen == mnTransGreen ) && ( nBlue == mnTransBlue ) ); @@ -1345,7 +1345,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) sal_uInt8 nRed = pTmp[ 0 ]; sal_uInt8 nGreen = pTmp[ 2 ]; sal_uInt8 nBlue = pTmp[ 4 ]; - sal_Bool bTransparent = ( ( nRed == mnTransRed ) + bool bTransparent = ( ( nRed == mnTransRed ) && ( nGreen == mnTransGreen ) && ( nBlue == mnTransBlue ) ); @@ -1412,7 +1412,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, sal_uInt8 nPalIn mpAcc->SetPixelIndex( nY, nX, nPalIndex ); } -void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, sal_Bool bTrans ) +void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, bool bTrans ) { // TODO: get preview mode checks out of inner loop if( nX & mnPreviewMask ) @@ -1484,7 +1484,7 @@ const std::vector< vcl::PNGReader::ChunkData >& PNGReader::GetChunks() const return mpImpl->GetAllChunks(); } -void PNGReader::SetIgnoreGammaChunk( sal_Bool b ) +void PNGReader::SetIgnoreGammaChunk( bool b ) { mpImpl->SetIgnoreGammaChunk( b ); } |