diff options
48 files changed, 100 insertions, 114 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index 7d4cdba478f4..9d9a8bdf9bb8 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -316,7 +316,7 @@ namespace cairocanvas uno::Reference<rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW); ::BitmapEx aBmpEx = vcl::unotools::bitmapExFromXBitmap(xIntBmp); - if( !!aBmpEx ) + if( !aBmpEx.IsEmpty() ) return aBmpEx; // TODO(F1): extract pixel from XBitmap interface diff --git a/canvas/source/directx/dx_vcltools.cxx b/canvas/source/directx/dx_vcltools.cxx index 323022b9caa2..68a07ae79b4a 100644 --- a/canvas/source/directx/dx_vcltools.cxx +++ b/canvas/source/directx/dx_vcltools.cxx @@ -440,7 +440,7 @@ namespace dxcanvas::tools return false; ::BitmapEx aBmpEx = vcl::unotools::bitmapExFromXBitmap( xIntBmp ); - if( !aBmpEx ) + if( aBmpEx.IsEmpty() ) return false; return drawVCLBitmapEx( rGraphics, aBmpEx ); diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx index 800ad3128342..53faa65ffa71 100644 --- a/canvas/source/vcl/impltools.cxx +++ b/canvas/source/vcl/impltools.cxx @@ -73,7 +73,7 @@ namespace vclcanvas::tools xBitmap, uno::UNO_QUERY_THROW ); ::BitmapEx aBmpEx = vcl::unotools::bitmapExFromXBitmap( xIntBmp ); - if( !!aBmpEx ) + if( !aBmpEx.IsEmpty() ) return aBmpEx; // TODO(F1): extract pixel from XBitmap interface diff --git a/cppcanvas/qa/unit/test.cxx b/cppcanvas/qa/unit/test.cxx index fbf6caf39147..c02d466dfedd 100644 --- a/cppcanvas/qa/unit/test.cxx +++ b/cppcanvas/qa/unit/test.cxx @@ -56,7 +56,7 @@ void CanvasTest::testComposite() xBitmapCanvas->clear(); CPPUNIT_ASSERT( aBitmapEx.Create( xBitmapCanvas, aSize ) ); CPPUNIT_ASSERT( aBitmapEx.IsAlpha() ); - CPPUNIT_ASSERT( aBitmapEx.GetAlpha() ); + CPPUNIT_ASSERT( !aBitmapEx.GetAlpha().IsEmpty() ); } { diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx index 2c8be33a2086..99aa597589f7 100644 --- a/drawinglayer/source/texture/texture3d.cxx +++ b/drawinglayer/source/texture/texture3d.cxx @@ -89,7 +89,7 @@ namespace drawinglayer::texture mpReadTransparence = Bitmap::ScopedReadAccess(maTransparence); } - if (maBitmap) + if (!maBitmap.IsEmpty()) mpReadBitmap = Bitmap::ScopedReadAccess(maBitmap); SAL_WARN_IF(!mpReadBitmap, "drawinglayer", "GeoTexSvxBitmapEx: Got no read access to Bitmap"); if (mpReadBitmap) diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index 1da3eda3fb1d..54c871d112e7 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -918,7 +918,7 @@ namespace emfio mpInputStream->ReadUInt16( nFunction ).ReadUInt16( nFunction ); ReadDIB(aBmp, *mpInputStream, false); - if ( !!aBmp ) + if ( !aBmp.IsEmpty() ) { Bitmap::ScopedReadAccess pBmp(aBmp); for ( tools::Long y = 0; y < pBmp->Height(); y++ ) diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx index 48a71609519e..317b7b2885e3 100644 --- a/filter/source/graphicfilter/icgm/actimpr.cxx +++ b/filter/source/graphicfilter/icgm/actimpr.cxx @@ -553,7 +553,7 @@ void CGMImpressOutAct::DrawEllipticalArc( FloatPoint const & rCenter, FloatPoint void CGMImpressOutAct::DrawBitmap( CGMBitmapDescriptor* pBmpDesc ) { - if ( !pBmpDesc->mbStatus || !pBmpDesc->mxBitmap ) + if ( !pBmpDesc->mbStatus || pBmpDesc->mxBitmap.IsEmpty() ) return; FloatPoint aOrigin = pBmpDesc->mnOrigin; diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx index 72946094ed38..fb7b365ea0a6 100644 --- a/filter/source/graphicfilter/icgm/bitmap.cxx +++ b/filter/source/graphicfilter/icgm/bitmap.cxx @@ -416,7 +416,7 @@ void CGMBitmap::ImplInsert( CGMBitmapDescriptor const & rSource, CGMBitmapDescri std::unique_ptr<CGMBitmap> CGMBitmap::GetNext() { std::unique_ptr<CGMBitmap> xCGMTempBitmap; - if (!!pCGMBitmapDescriptor->mxBitmap && pCGMBitmapDescriptor->mbStatus) + if (!pCGMBitmapDescriptor->mxBitmap.IsEmpty() && pCGMBitmapDescriptor->mbStatus) { xCGMTempBitmap.reset(new CGMBitmap(*mpCGM)); if ( ( static_cast<tools::Long>(xCGMTempBitmap->pCGMBitmapDescriptor->mnOrientation) == static_cast<tools::Long>(pCGMBitmapDescriptor->mnOrientation) ) && diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index c3ec4a8971d4..bb40c4965f7c 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2840,7 +2840,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, const Point& rSrcPt, const Size& rSrcSz, const css::uno::Reference<css::drawing::XShape>* pShape ) { - if( !rBmpEx ) + if( rBmpEx.IsEmpty() ) return; if( mpEmbeddedBitmapsMap && !mpEmbeddedBitmapsMap->empty()) { @@ -2886,7 +2886,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, if( aSrcRect != aBmpRect ) aBmpEx.Crop( aSrcRect ); - if( !aBmpEx ) + if( aBmpEx.IsEmpty() ) return; SvMemoryStream aOStm( 65535, 65535 ); diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index dbcaad592235..9bbf54b388ae 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -364,7 +364,7 @@ void ImageProducer::ImplUpdateConsumer( const Graphic& rGraphic ) return; Bitmap aMask( aBmpEx.GetMask() ); - BitmapReadAccess* pMskAcc = !!aMask ? aMask.AcquireReadAccess() : nullptr; + BitmapReadAccess* pMskAcc = !aMask.IsEmpty() ? aMask.AcquireReadAccess() : nullptr; const tools::Long nWidth = pBmpAcc->Width(); const tools::Long nHeight = pBmpAcc->Height(); const tools::Long nStartX = 0; diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx index 49eab738c1cc..ec604325139c 100644 --- a/framework/source/fwe/classes/addonsoptions.cxx +++ b/framework/source/fwe/classes/addonsoptions.cxx @@ -612,29 +612,29 @@ BitmapEx AddonsOptions_Impl::GetImageFromURL( const OUString& aURL, bool bBig, b OneImageEntry& rSizeEntry = pIter->second.aSizeEntry[nIdx]; OneImageEntry& rOtherEntry = pIter->second.aSizeEntry[nOtherIdx]; // actually read the image ... - if (!rSizeEntry.aImage) + if (rSizeEntry.aImage.IsEmpty()) rSizeEntry.aImage = ReadImageFromURL(rSizeEntry.aURL); - if (!rSizeEntry.aImage) + if (rSizeEntry.aImage.IsEmpty()) { // try the other size and scale it aImage = ScaleImage(ReadImageFromURL(rOtherEntry.aURL), bBig); rSizeEntry.aImage = aImage; - if (!rSizeEntry.aImage) + if (rSizeEntry.aImage.IsEmpty()) SAL_WARN("fwk", "failed to load addons image " << aURL); } // FIXME: bNoScale is not terribly meaningful or useful - if (!aImage && bNoScale) + if (aImage.IsEmpty() && bNoScale) aImage = rSizeEntry.aImage; - if (!aImage && !!rSizeEntry.aScaled) + if (aImage.IsEmpty() && !rSizeEntry.aScaled.IsEmpty()) aImage = rSizeEntry.aScaled; else // scale to the correct size for the theme / toolbox { aImage = rSizeEntry.aImage; - if (!aImage) // use and scale the other if one size is missing + if (aImage.IsEmpty()) // use and scale the other if one size is missing aImage = rOtherEntry.aImage; aImage = ScaleImage(aImage, bBig); diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx index 6bebdb8c57cf..611450660f82 100644 --- a/include/vcl/alpha.hxx +++ b/include/vcl/alpha.hxx @@ -43,7 +43,6 @@ public: AlphaMask& operator=( const Bitmap& rBitmap ); AlphaMask& operator=( const AlphaMask& rAlphaMask ) { return static_cast<AlphaMask&>( Bitmap::operator=( rAlphaMask ) ); } AlphaMask& operator=( AlphaMask&& rAlphaMask ) noexcept { return static_cast<AlphaMask&>( Bitmap::operator=( std::move(rAlphaMask) ) ); } - bool operator!() const { return Bitmap::operator!(); } bool operator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==(rAlphaMask); } bool operator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=(rAlphaMask); } diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 4c1a3b3dbddf..1bfc484fee5b 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -121,10 +121,8 @@ public: Bitmap& operator=( const Bitmap& rBitmap ); Bitmap& operator=( Bitmap&& rBitmap ) noexcept; - inline bool operator!() const; bool operator==( const Bitmap& rBitmap ) const; bool operator!=( const Bitmap& rBitmap ) const { return !operator==(rBitmap); } - inline operator bool() const; inline bool IsEmpty() const; void SetEmpty(); @@ -551,16 +549,6 @@ private: }; -inline Bitmap::operator bool() const -{ - return mxSalBmp != nullptr; -} - -inline bool Bitmap::operator!() const -{ - return( mxSalBmp == nullptr ); -} - inline bool Bitmap::IsEmpty() const { return( mxSalBmp == nullptr ); diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index 5736e4d38b6a..5cc5939f0001 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -59,7 +59,6 @@ public: BitmapEx& operator=( const Bitmap& rBitmap ) { return operator=(BitmapEx(rBitmap)); } bool operator==( const BitmapEx& rBitmapEx ) const; bool operator!=( const BitmapEx& rBitmapEx ) const { return !(*this==rBitmapEx); } - bool operator!() const { return !maBitmap; } bool IsEmpty() const; void SetEmpty(); diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 066fe9d8a659..704a0f77862b 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -135,7 +135,7 @@ void SdVectorizeDlg::Calculate( Bitmap const & rBmp, GDIMetaFile& rMtf ) Fraction aScale; Bitmap aTmp( GetPreparedBitmap( rBmp, aScale ) ); - if( !!aTmp ) + if( !aTmp.IsEmpty() ) { const Link<::tools::Long,void> aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) ); aTmp.Vectorize( rMtf, static_cast<sal_uInt8>(m_xMtReduce->get_value(FieldUnit::NONE)), &aPrgsHdl ); diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index 68bdf0af1f7e..28f8ca7b91e9 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -262,7 +262,7 @@ BitmapEx DrawDocShell::GetPagePreviewBitmap(SdPage* pPage) BitmapEx aPreview( pVDev->GetBitmapEx( aNullPt, pVDev->GetOutputSizePixel() ) ); - DBG_ASSERT(aPreview, "Preview-Bitmap could not be generated"); + DBG_ASSERT(!aPreview.IsEmpty(), "Preview-Bitmap could not be generated"); return aPreview; } diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index 12f3bbf58001..b6c043e91109 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -50,7 +50,7 @@ void DrawViewShell::ScannerEvent() { const BitmapEx aScanBmp( VCLUnoHelper::GetBitmap( xBitmap ) ); - if( !!aScanBmp ) + if( !aScanBmp.IsEmpty() ) { const SolarMutexGuard aGuard; SdrPage* pPage = mpDrawView->GetSdrPageView()->GetPage(); diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index 08de04b177e9..8a68ccdbba2a 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -78,7 +78,7 @@ namespace svt::table StyleSettings const & i_style, bool const i_sortAscending ) { BitmapEx& rBitmap(i_sortAscending ? m_sortAscending : m_sortDescending); - if (!rBitmap || (i_headerHeight != m_lastHeaderHeight) || (i_style.GetActiveColor() != m_lastArrowColor)) + if (rBitmap.IsEmpty() || (i_headerHeight != m_lastHeaderHeight) || (i_style.GetActiveColor() != m_lastArrowColor)) { tools::Long const nSortIndicatorWidth = 2 * i_headerHeight / 3; tools::Long const nSortIndicatorHeight = 2 * nSortIndicatorWidth / 3; diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index 698ce31b9821..bba90c16a1a0 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -636,7 +636,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void ) if( aGraphic.IsTransparent() ) aMask.CombineSimple( aGraphic.GetBitmapEx().GetMask(), BmpCombine::Or ); - if( !!aMask ) + if( !aMask.IsEmpty() ) { std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(&m_rDialog, "svx/ui/querynewcontourdialog.ui")); std::unique_ptr<weld::MessageDialog> xQBox(xBuilder->weld_message_dialog("QueryNewContourDialog")); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 34a491211bf6..504f5990dab4 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -562,7 +562,7 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj, bool bScale) pObj->SetLayer(aOldLayer); pObj->SetMergedItemSet(aOldItemSet); - if(!!aBitmapEx) + if(!aBitmapEx.IsEmpty()) { // aNewRange is inside of aOldRange and defines which part of aBitmapEx is used const double fScaleX(aBitmapEx.GetSizePixel().Width() / (aOldRange.getWidth() ? aOldRange.getWidth() : 1.0)); diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 466142b57223..125b26f0da01 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -513,7 +513,7 @@ void ImpSdrPdfImport::InsertObj(SdrObject* pObj, bool bScale) pObj->SetLayer(aOldLayer); pObj->SetMergedItemSet(aOldItemSet); - if (!!aBitmapEx) + if (!aBitmapEx.IsEmpty()) { // aNewRange is inside of aOldRange and defines which part of aBitmapEx is used const double fScaleX(aBitmapEx.GetSizePixel().Width() diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index d3c6b2fa3629..1cf15c720a31 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -454,7 +454,7 @@ BitmapEx SdrExchangeView::GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked) const } } - if( !aBmp ) + if( aBmp.IsEmpty() ) { // choose conversion directly using primitives to bitmap to avoid // rendering errors with tiled bitmap fills (these will be tiled in a diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 6f9ee4992cde..4236215fe142 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -92,7 +92,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId) { BitmapEx aThumb; - if (GalleryExplorer::GetSdrObj(nThemeId, nModelPos, pModel, &aThumb) && !!aThumb) + if (GalleryExplorer::GetSdrObj(nThemeId, nModelPos, pModel, &aThumb) && !aThumb.IsEmpty()) { VclPtr< VirtualDevice > pVDev = VclPtr<VirtualDevice>::Create(); const Point aNull(0, 0); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 82a64e7e3525..97ae1d94010e 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -1737,7 +1737,7 @@ void SwView::ScannerEventHdl() { const BitmapEx aScanBmp( VCLUnoHelper::GetBitmap( xBitmap ) ); - if( !!aScanBmp ) + if( !aScanBmp.IsEmpty() ) { Graphic aGrf(aScanBmp); m_pWrtShell->Insert( OUString(), OUString(), aGrf ); diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index b090957fc922..85651e2079e9 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -901,7 +901,7 @@ CGImageRef CreateCGImage( const Image& rImage ) BitmapEx aBmpEx( rImage.GetBitmapEx() ); Bitmap aBmp( aBmpEx.GetBitmap() ); - if( ! aBmp || ! aBmp.ImplGetSalBitmap() ) + if( aBmp.IsEmpty() || ! aBmp.ImplGetSalBitmap() ) return nullptr; // simple case, no transparency diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx index 69984bbe4566..37c9f16afa26 100644 --- a/vcl/source/animate/Animation.cxx +++ b/vcl/source/animate/Animation.cxx @@ -558,7 +558,7 @@ SvStream& WriteAnimation(SvStream& rOStm, const Animation& rAnimation) // If no BitmapEx was set we write the first Bitmap of // the Animation - if (!rAnimation.GetBitmapEx().GetBitmap()) + if (rAnimation.GetBitmapEx().GetBitmap().IsEmpty()) WriteDIBBitmapEx(rAnimation.Get(0).maBitmapEx, rOStm); else WriteDIBBitmapEx(rAnimation.GetBitmapEx(), rOStm); diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index 8f1693193e78..ca80d6650380 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -122,12 +122,12 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) : maBitmap ( rBmp ), maMask ( rMask ), maBitmapSize ( maBitmap.GetSizePixel() ), - meTransparent ( !rMask ? TransparentType::NONE : TransparentType::Bitmap ), + meTransparent ( rMask.IsEmpty() ? TransparentType::NONE : TransparentType::Bitmap ), mbAlpha ( false ) { // Ensure a mask is exactly one bit deep, // alternatively also allow 8bpp masks. - if( maMask && maMask.GetBitCount() != 1 && !(maMask.GetBitCount() == 8 && maMask.HasGreyPalette8Bit())) + if( !maMask.IsEmpty() && maMask.GetBitCount() != 1 && !(maMask.GetBitCount() == 8 && maMask.HasGreyPalette8Bit())) { SAL_WARN( "vcl", "BitmapEx: forced mask to monochrome"); BitmapEx aMaskEx(maMask); @@ -135,7 +135,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) : maMask = aMaskEx.GetBitmap(); } - if (maBitmap && maMask && maBitmap.GetSizePixel() != maMask.GetSizePixel()) + if (!maBitmap.IsEmpty() && !maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel()) { OSL_ENSURE(false, "Mask size differs from Bitmap size, corrected Mask (!)"); maMask.Scale(maBitmap.GetSizePixel()); @@ -146,10 +146,10 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) : maBitmap ( rBmp ), maMask ( rAlphaMask.ImplGetBitmap() ), maBitmapSize ( maBitmap.GetSizePixel() ), - meTransparent ( !rAlphaMask ? TransparentType::NONE : TransparentType::Bitmap ), + meTransparent ( rAlphaMask.IsEmpty() ? TransparentType::NONE : TransparentType::Bitmap ), mbAlpha ( !rAlphaMask.IsEmpty() ) { - if (maBitmap && maMask && maBitmap.GetSizePixel() != maMask.GetSizePixel()) + if (!maBitmap.IsEmpty() && !maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel()) { OSL_ENSURE(false, "Alpha size differs from Bitmap size, corrected Mask (!)"); maMask.Scale(rBmp.GetSizePixel()); @@ -306,7 +306,7 @@ bool BitmapEx::Invert() { bool bRet = false; - if (maBitmap) + if (!maBitmap.IsEmpty()) bRet = maBitmap.Invert(); return bRet; @@ -316,11 +316,11 @@ bool BitmapEx::Mirror( BmpMirrorFlags nMirrorFlags ) { bool bRet = false; - if( maBitmap ) + if( !maBitmap.IsEmpty() ) { bRet = maBitmap.Mirror( nMirrorFlags ); - if( bRet && ( meTransparent == TransparentType::Bitmap ) && !!maMask ) + if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() ) maMask.Mirror( nMirrorFlags ); } @@ -331,18 +331,18 @@ bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag { bool bRet = false; - if( maBitmap ) + if( !maBitmap.IsEmpty() ) { bRet = maBitmap.Scale( rScaleX, rScaleY, nScaleFlag ); - if( bRet && ( meTransparent == TransparentType::Bitmap ) && !!maMask ) + if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() ) { maMask.Scale( rScaleX, rScaleY, nScaleFlag ); } SetSizePixel(maBitmap.GetSizePixel()); - SAL_WARN_IF( maMask && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl", + SAL_WARN_IF( !maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl", "BitmapEx::Scale(): size mismatch for bitmap and alpha mask." ); } @@ -373,7 +373,7 @@ bool BitmapEx::Rotate( Degree10 nAngle10, const Color& rFillColor ) { bool bRet = false; - if( maBitmap ) + if( !maBitmap.IsEmpty() ) { const bool bTransRotate = ( COL_TRANSPARENT == rFillColor ); @@ -388,20 +388,20 @@ bool BitmapEx::Rotate( Degree10 nAngle10, const Color& rFillColor ) meTransparent = TransparentType::Bitmap; } - if( bRet && !!maMask ) + if( bRet && !maMask.IsEmpty() ) maMask.Rotate( nAngle10, COL_WHITE ); } else { bRet = maBitmap.Rotate( nAngle10, rFillColor ); - if( bRet && ( meTransparent == TransparentType::Bitmap ) && !!maMask ) + if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() ) maMask.Rotate( nAngle10, COL_WHITE ); } SetSizePixel(maBitmap.GetSizePixel()); - SAL_WARN_IF(maMask && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl", + SAL_WARN_IF(!maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl", "BitmapEx::Rotate(): size mismatch for bitmap and alpha mask."); } @@ -412,16 +412,16 @@ bool BitmapEx::Crop( const tools::Rectangle& rRectPixel ) { bool bRet = false; - if( maBitmap ) + if( !maBitmap.IsEmpty() ) { bRet = maBitmap.Crop( rRectPixel ); - if( bRet && ( meTransparent == TransparentType::Bitmap ) && !!maMask ) + if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() ) maMask.Crop( rRectPixel ); SetSizePixel(maBitmap.GetSizePixel()); - SAL_WARN_IF(maMask && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl", + SAL_WARN_IF(!maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl", "BitmapEx::Crop(): size mismatch for bitmap and alpha mask."); } @@ -430,19 +430,19 @@ bool BitmapEx::Crop( const tools::Rectangle& rRectPixel ) bool BitmapEx::Convert( BmpConversion eConversion ) { - return maBitmap && maBitmap.Convert( eConversion ); + return !maBitmap.IsEmpty() && maBitmap.Convert( eConversion ); } void BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, bool bExpandTransparent ) { bool bRet = false; - if( !maBitmap ) + if( maBitmap.IsEmpty() ) return; bRet = maBitmap.Expand( nDX, nDY ); - if( bRet && ( meTransparent == TransparentType::Bitmap ) && !!maMask ) + if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() ) { Color aColor( bExpandTransparent ? COL_WHITE : COL_BLACK ); maMask.Expand( nDX, nDY, &aColor ); @@ -450,7 +450,7 @@ void BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, bool bExpandTransparent ) SetSizePixel(maBitmap.GetSizePixel()); - SAL_WARN_IF(maMask && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl", + SAL_WARN_IF(!maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl", "BitmapEx::Expand(): size mismatch for bitmap and alpha mask."); } @@ -465,7 +465,7 @@ bool BitmapEx::CopyPixel( const tools::Rectangle& rRectDst, const tools::Rectang { bRet = maBitmap.CopyPixel( rRectDst, rRectSrc ); - if( bRet && ( meTransparent == TransparentType::Bitmap ) && !!maMask ) + if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() ) maMask.CopyPixel( rRectDst, rRectSrc ); } } @@ -547,11 +547,11 @@ bool BitmapEx::Erase( const Color& rFillColor ) { bool bRet = false; - if( maBitmap ) + if( !maBitmap.IsEmpty() ) { bRet = maBitmap.Erase( rFillColor ); - if( bRet && ( meTransparent == TransparentType::Bitmap ) && !!maMask ) + if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() ) { // Respect transparency on fill color if( rFillColor.IsTransparent() ) @@ -572,13 +572,13 @@ bool BitmapEx::Erase( const Color& rFillColor ) void BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor ) { - if (maBitmap) + if (!maBitmap.IsEmpty()) maBitmap.Replace( rSearchColor, rReplaceColor ); } void BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, size_t nColorCount ) { - if (maBitmap) + if (!maBitmap.IsEmpty()) maBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, /*pTols*/nullptr ); } @@ -586,7 +586,7 @@ bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, double fGamma, bool bInvert, bool msoBrightness ) { - return maBitmap && maBitmap.Adjust( nLuminancePercent, nContrastPercent, + return !maBitmap.IsEmpty() && maBitmap.Adjust( nLuminancePercent, nContrastPercent, nChannelRPercent, nChannelGPercent, nChannelBPercent, fGamma, bInvert, msoBrightness ); } @@ -1388,7 +1388,7 @@ static Bitmap DetectEdges( const Bitmap& rBmp ) } } - if( !aRetBmp ) + if( aRetBmp.IsEmpty() ) aRetBmp = rBmp; else { diff --git a/vcl/source/bitmap/alpha.cxx b/vcl/source/bitmap/alpha.cxx index ccd8f49bbe65..aee39e63c329 100644 --- a/vcl/source/bitmap/alpha.cxx +++ b/vcl/source/bitmap/alpha.cxx @@ -31,7 +31,7 @@ AlphaMask::AlphaMask() = default; AlphaMask::AlphaMask( const Bitmap& rBitmap ) : Bitmap( rBitmap ) { - if( rBitmap ) + if( !rBitmap.IsEmpty() ) Convert( BmpConversion::N8BitNoConversion ); } @@ -52,7 +52,7 @@ AlphaMask& AlphaMask::operator=( const Bitmap& rBitmap ) { *static_cast<Bitmap*>(this) = rBitmap; - if( rBitmap ) + if( !rBitmap.IsEmpty() ) Convert( BmpConversion::N8BitNoConversion ); return *this; diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index c2d79db69580..6bc60687c164 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -432,7 +432,7 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& rFillColor) pReadAcc.reset(); } - bRet = !!aRotatedBmp; + bRet = !aRotatedBmp.IsEmpty(); if (bRet) ReassignWithSize(aRotatedBmp); } diff --git a/vcl/source/bitmap/dibtools.cxx b/vcl/source/bitmap/dibtools.cxx index 31277fd6a031..a4cd7bcd8404 100644 --- a/vcl/source/bitmap/dibtools.cxx +++ b/vcl/source/bitmap/dibtools.cxx @@ -1746,7 +1746,7 @@ bool ReadDIBBitmapEx( if(bRetval) { - if(!!aMask) + if(!aMask.IsEmpty()) { // do we have an alpha mask? if((8 == aMask.GetBitCount()) && aMask.HasGreyPalette8Bit()) diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index 5e8e1b3d4c63..82675d720c9a 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -683,7 +683,7 @@ FixedBitmap::FixedBitmap( vcl::Window* pParent, WinBits nStyle ) : void FixedBitmap::ImplDraw( OutputDevice* pDev, const Point& rPos, const Size& rSize ) { // do we have a Bitmap? - if ( !!maBitmap ) + if ( !maBitmap.IsEmpty() ) { if ( GetStyle() & WB_SCALE ) pDev->DrawBitmapEx( rPos, rSize, maBitmap ); diff --git a/vcl/source/control/roadmap.cxx b/vcl/source/control/roadmap.cxx index ad9531430b50..b0841b021292 100644 --- a/vcl/source/control/roadmap.cxx +++ b/vcl/source/control/roadmap.cxx @@ -553,7 +553,7 @@ void ORoadmap::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& Control::Paint(rRenderContext, _rRect); // draw the bitmap - if (!!m_pImpl->getPicture()) + if (!m_pImpl->getPicture().IsEmpty()) { Size aBitmapSize = m_pImpl->getPicture().GetSizePixel(); Size aMySize(GetOutputSizePixel()); diff --git a/vcl/source/filter/egif/egif.cxx b/vcl/source/filter/egif/egif.cxx index bfd41d952b4c..79caa7db584b 100644 --- a/vcl/source/filter/egif/egif.cxx +++ b/vcl/source/filter/egif/egif.cxx @@ -247,7 +247,7 @@ bool GIFWriter::CreateAccess( const BitmapEx& rBmpEx ) aAccBmp = rBmpEx.GetBitmap(); bTransparent = false; - if( !!aMask ) + if( !aMask.IsEmpty() ) { if( aAccBmp.Convert( BmpConversion::N8BitTrans ) ) { diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 85b4ea910071..595e5cf18183 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -241,7 +241,7 @@ void GIFReader::CreateBitmaps(tools::Long nWidth, tools::Long nHeight, BitmapPal { aBmp8 = Bitmap(aSize, vcl::PixelFormat::N8_BPP, pPal); - if (!!aBmp8 && bWatchForBackgroundColor && aAnimation.Count()) + if (!aBmp8.IsEmpty() && bWatchForBackgroundColor && aAnimation.Count()) aBmp8.Erase((*pPal)[nBackgroundColor]); else aBmp8.Erase(COL_WHITE); diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 9f0ab33993f6..432af89ee774 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -801,7 +801,7 @@ void EMFWriter::ImplWritePath( const tools::PolyPolygon& rPolyPoly, bool bClosed void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, sal_uInt32 nROP ) { - if( !rBmp ) + if( rBmp.IsEmpty() ) return; SvMemoryStream aMemStm( 65535, 65535 ); @@ -1291,7 +1291,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) Bitmap aBmp( pA->GetBitmapEx().GetBitmap() ); Bitmap aMsk( pA->GetBitmapEx().GetMask() ); - if( !!aMsk ) + if( !aMsk.IsEmpty() ) { aBmp.Replace( aMsk, COL_WHITE ); aMsk.Invert(); @@ -1309,7 +1309,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) Bitmap aBmp( pA->GetBitmapEx().GetBitmap() ); Bitmap aMsk( pA->GetBitmapEx().GetMask() ); - if( !!aMsk ) + if( !aMsk.IsEmpty() ) { aBmp.Replace( aMsk, COL_WHITE ); aMsk.Invert(); @@ -1329,7 +1329,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) Bitmap aBmp( aBmpEx.GetBitmap() ); Bitmap aMsk( aBmpEx.GetMask() ); - if( !!aMsk ) + if( !aMsk.IsEmpty() ) { aBmp.Replace( aMsk, COL_WHITE ); aMsk.Invert(); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 480063e7967b..efb1c56403ac 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1247,7 +1247,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) Bitmap aBmp( pA->GetBitmapEx().GetBitmap() ); Bitmap aMsk( pA->GetBitmapEx().GetMask() ); - if( !!aMsk ) + if( !aMsk.IsEmpty() ) { aBmp.Replace( aMsk, COL_WHITE ); aMsk.Invert(); @@ -1265,7 +1265,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) Bitmap aBmp( pA->GetBitmapEx().GetBitmap() ); Bitmap aMsk( pA->GetBitmapEx().GetMask() ); - if( !!aMsk ) + if( !aMsk.IsEmpty() ) { aBmp.Replace( aMsk, COL_WHITE ); aMsk.Invert(); @@ -1285,7 +1285,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) Bitmap aBmp( aBmpEx.GetBitmap() ); Bitmap aMsk( aBmpEx.GetMask() ); - if( !!aMsk ) + if( !aMsk.IsEmpty() ) { aBmp.Replace( aMsk, COL_WHITE ); aMsk.Invert(); diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx index f90e992963cc..4a8f8bd8d953 100644 --- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx +++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx @@ -475,7 +475,7 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr SvFileStream aFileStream(rWidgetDraw.msSource, StreamMode::READ); vcl::bitmap::loadFromSvg(aFileStream, "", aBitmap, nScaleFactor); - if (!!aBitmap) + if (!aBitmap.IsEmpty()) { rCacheImages.insert(std::make_pair(rCacheKey, aBitmap)); } @@ -489,7 +489,7 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr tools::Long nImageHeight = aBitmap.GetSizePixel().Height(); SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, nImageWidth / nScaleFactor, nImageHeight / nScaleFactor); - if (!!aBitmap) + if (!aBitmap.IsEmpty()) { const std::shared_ptr<SalBitmap> pSalBitmap = aBitmap.GetBitmap().ImplGetSalBitmap(); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index b4b934ee2f49..df961fba47f2 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -57,7 +57,7 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText, aSize.AdjustWidth( -(2*nPixelWidth + 4*nPixel) ); aSize.AdjustHeight( -(2*nPixelWidth + 4*nPixel) ); - if( !aSize.IsEmpty() && pBitmapEx && !!*pBitmapEx ) + if( !aSize.IsEmpty() && pBitmapEx && !pBitmapEx->IsEmpty() ) { Size aBitmapSize( pOutDev->PixelToLogic( pBitmapEx->GetSizePixel() ) ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index e16e12b0ef5b..b06423adbe3e 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -629,7 +629,7 @@ Bitmap ImpGraphic::getBitmap(const GraphicConversionParameters& rParameters) con aRetBmp = maBitmapEx.GetBitmap(); } - if( !!aRetBmp ) + if( !aRetBmp.IsEmpty() ) { aRetBmp.SetPrefMapMode(getPrefMapMode()); aRetBmp.SetPrefSize(getPrefSize()); @@ -733,7 +733,7 @@ const GDIMetaFile& ImpGraphic::getGDIMetaFile() const // survive copying (change this if not wanted) ImpGraphic* pThat = const_cast< ImpGraphic* >(this); - if(maVectorGraphicData && !maBitmapEx) + if(maVectorGraphicData && maBitmapEx.IsEmpty()) { // use maBitmapEx as local buffer for rendered svg pThat->maBitmapEx = getVectorGraphicReplacement(); @@ -1012,7 +1012,7 @@ void ImpGraphic::draw(OutputDevice* pOutDev, const Point& rDestPt) const { case GraphicType::Bitmap: { - if (maVectorGraphicData && !maBitmapEx) + if (maVectorGraphicData && maBitmapEx.IsEmpty()) { // use maBitmapEx as local buffer for rendered svg const_cast<ImpGraphic*>(this)->maBitmapEx = getVectorGraphicReplacement(); diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 871c646a02e0..02fce9554f14 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1498,7 +1498,7 @@ void MetaBmpAction::Scale( double fScaleX, double fScaleY ) void MetaBmpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { - if( !!maBmp ) + if( !maBmp.IsEmpty() ) { MetaAction::Write(rOStm, pData); VersionCompatWrite aCompat(rOStm, 1); @@ -1556,7 +1556,7 @@ void MetaBmpScaleAction::Scale( double fScaleX, double fScaleY ) void MetaBmpScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { - if( !!maBmp ) + if( !maBmp.IsEmpty() ) { MetaAction::Write(rOStm, pData); VersionCompatWrite aCompat(rOStm, 1); @@ -1620,7 +1620,7 @@ void MetaBmpScalePartAction::Scale( double fScaleX, double fScaleY ) void MetaBmpScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { - if( !!maBmp ) + if( !maBmp.IsEmpty() ) { MetaAction::Write(rOStm, pData); VersionCompatWrite aCompat(rOStm, 1); @@ -1680,7 +1680,7 @@ void MetaBmpExAction::Scale( double fScaleX, double fScaleY ) void MetaBmpExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { - if( maBmpEx.GetBitmap() ) + if( !maBmpEx.GetBitmap().IsEmpty() ) { MetaAction::Write(rOStm, pData); VersionCompatWrite aCompat(rOStm, 1); @@ -1738,7 +1738,7 @@ void MetaBmpExScaleAction::Scale( double fScaleX, double fScaleY ) void MetaBmpExScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { - if( maBmpEx.GetBitmap() ) + if( !maBmpEx.GetBitmap().IsEmpty() ) { MetaAction::Write(rOStm, pData); VersionCompatWrite aCompat(rOStm, 1); @@ -1801,7 +1801,7 @@ void MetaBmpExScalePartAction::Scale( double fScaleX, double fScaleY ) void MetaBmpExScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { - if( maBmpEx.GetBitmap() ) + if( !maBmpEx.GetBitmap().IsEmpty() ) { MetaAction::Write(rOStm, pData); VersionCompatWrite aCompat(rOStm, 1); @@ -1863,7 +1863,7 @@ void MetaMaskAction::Scale( double fScaleX, double fScaleY ) void MetaMaskAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { - if( !!maBmp ) + if( !maBmp.IsEmpty() ) { MetaAction::Write(rOStm, pData); VersionCompatWrite aCompat(rOStm, 1); @@ -1923,7 +1923,7 @@ void MetaMaskScaleAction::Scale( double fScaleX, double fScaleY ) void MetaMaskScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { - if( !!maBmp ) + if( !maBmp.IsEmpty() ) { MetaAction::Write(rOStm, pData); VersionCompatWrite aCompat(rOStm, 1); @@ -1988,7 +1988,7 @@ void MetaMaskScalePartAction::Scale( double fScaleX, double fScaleY ) void MetaMaskScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { - if( !!maBmp ) + if( !maBmp.IsEmpty() ) { MetaAction::Write(rOStm, pData); VersionCompatWrite aCompat(rOStm, 1); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index b81843b459e4..365204314733 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8368,7 +8368,7 @@ void PDFWriterImpl::writeJPG( JPGEmit& rObject ) rObject.m_pStream->Seek( STREAM_SEEK_TO_BEGIN ); sal_Int32 nMaskObject = 0; - if( !!rObject.m_aMask ) + if( !rObject.m_aMask.IsEmpty() ) { if( rObject.m_aMask.GetBitCount() == 1 || ( rObject.m_aMask.GetBitCount() == 8 && m_aContext.Version >= PDFWriter::PDFVersion::PDF_1_4 && !m_bIsPDF_A1 ) @@ -9020,7 +9020,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const // load stream to bitmap and draw the bitmap instead Graphic aGraphic; GraphicConverter::Import( rDCTData, aGraphic, ConvertDataFormat::JPG ); - if( !!rMask && rMask.GetSizePixel() == aGraphic.GetSizePixel() ) + if( !rMask.IsEmpty() && rMask.GetSizePixel() == aGraphic.GetSizePixel() ) { Bitmap aBmp( aGraphic.GetBitmapEx().GetBitmap() ); BitmapEx aBmpEx( aBmp, rMask ); @@ -9054,7 +9054,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const rEmit.m_aID = aID; rEmit.m_pStream = std::move( pStream ); rEmit.m_bTrueColor = bIsTrueColor; - if( !! rMask && rMask.GetSizePixel() == rSizePixel ) + if( !rMask.IsEmpty() && rMask.GetSizePixel() == rSizePixel ) rEmit.m_aMask = rMask; createEmbeddedFile(rGraphic, rEmit.m_aReferenceXObject, rEmit.m_nObject); diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx index db2d0804d747..3fb7acaaff1b 100644 --- a/vcl/source/gdi/wall.cxx +++ b/vcl/source/gdi/wall.cxx @@ -218,7 +218,7 @@ WallpaperStyle Wallpaper::GetStyle() const void Wallpaper::SetBitmap( const BitmapEx& rBitmap ) { - if ( !rBitmap ) + if ( rBitmap.IsEmpty() ) { if ( mpImplWallpaper->mpBitmap ) { diff --git a/vcl/source/image/ImplImage.cxx b/vcl/source/image/ImplImage.cxx index ad9429e00cca..ba8b85802ac9 100644 --- a/vcl/source/image/ImplImage.cxx +++ b/vcl/source/image/ImplImage.cxx @@ -96,7 +96,7 @@ Size ImplImage::getSizePixel() { if (loadStockAtScale(1.0, maBitmapEx)) { - assert(!maDisabledBitmapEx); + assert(maDisabledBitmapEx.IsEmpty()); assert(maBitmapChecksum == 0); maSizePixel = maBitmapEx.GetSizePixel(); aRet = maSizePixel; diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 970b833e0c73..20c5998c185e 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -104,7 +104,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize, Pop(); return; } - else if( !!aBmp ) + else if( !aBmp.IsEmpty() ) { if ( mnDrawMode & DrawModeFlags::GrayBitmap ) aBmp.Convert( BmpConversion::N8BitGreys ); @@ -348,7 +348,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, aBmpEx = BitmapEx( aColorBmp, aBmpEx.GetMask() ); } } - else if( !!aBmpEx ) + else if( !aBmpEx.IsEmpty() ) { if ( mnDrawMode & DrawModeFlags::GrayBitmap ) aBmpEx.Convert( BmpConversion::N8BitGreys ); @@ -515,7 +515,7 @@ void OutputDevice::DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize { DrawDeviceAlphaBitmap(rBitmapEx.GetBitmap(), rBitmapEx.GetAlpha(), rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel); } - else if (!!rBitmapEx) + else if (!rBitmapEx.IsEmpty()) { SalTwoRect aPosAry(rSrcPtPixel.X(), rSrcPtPixel.Y(), rSrcSizePixel.Width(), rSrcSizePixel.Height(), ImplLogicXToDevicePixel(rDestPt.X()), ImplLogicYToDevicePixel(rDestPt.Y()), diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index c0a47d0cecd8..3229949523d0 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -238,7 +238,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout ) rSalLayout.DrawText( *pVDev->mpGraphics ); Bitmap aBmp = pVDev->GetBitmap( Point(), aBoundRect.GetSize() ); - if ( !aBmp || !aBmp.Rotate( mpFontInstance->mnOwnOrientation, COL_WHITE ) ) + if ( aBmp.IsEmpty() || !aBmp.Rotate( mpFontInstance->mnOwnOrientation, COL_WHITE ) ) return false; // calculate rotation offset diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 4d983c37f72c..a9712a22ee2d 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -401,7 +401,7 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, Bitmap aPolyMask( aVDev->GetBitmap( Point(), aDstSz ) ); // #107766# check for non-empty bitmaps before accessing them - if( !!aPaint && !!aPolyMask ) + if( !aPaint.IsEmpty() && !aPolyMask.IsEmpty() ) { BitmapScopedWriteAccess pW(aPaint); Bitmap::ScopedReadAccess pR(aPolyMask); diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index c0c12dcd1cf7..eea2ecd340c6 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -4595,7 +4595,7 @@ static LRESULT ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam ) //Size bmpSize = aBitmap.GetSizePixel(); Size bmpSize(16, 16); - if( pSalMenuItem->maBitmap ) + if( !pSalMenuItem->maBitmap.IsEmpty() ) { Bitmap aBitmap( pSalMenuItem->maBitmap ); diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx index cc39309ed91a..7ac5a3b234b6 100644 --- a/vcl/workben/fftester.cxx +++ b/vcl/workben/fftester.cxx @@ -156,7 +156,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { SvFileStream aFileStream(out, StreamMode::READ); vcl::PngImageReader aReader(aFileStream); - ret = static_cast<int>(!!aReader.read()); + ret = static_cast<int>(!aReader.read().IsEmpty()); } else if (strcmp(argv[2], "bmp") == 0) { |