diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-05-31 20:28:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-01 17:41:20 +0100 |
commit | 7e5d98c427cdcd10566b8f5a7a35c0561ec82d72 (patch) | |
tree | 6dfddf4cfae2c6308668b290090dcb88e764e81e /vcl | |
parent | a08f0aa2857f4a5342cedf2038488fc98fb716fb (diff) |
masses of coverity FORWARD_NULL warnings from copied assert
Change-Id: I8f698bbcf4d53a4477cc0ee0c3f2c7f08e521f8a
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 26 | ||||
-rw-r--r-- | vcl/source/outdev/curvedshapes.cxx | 8 | ||||
-rw-r--r-- | vcl/source/outdev/gradient.cxx | 22 | ||||
-rw-r--r-- | vcl/source/outdev/hatch.cxx | 6 | ||||
-rw-r--r-- | vcl/source/outdev/line.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/mask.cxx | 8 | ||||
-rw-r--r-- | vcl/source/outdev/nativecontrols.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/pixel.cxx | 8 | ||||
-rw-r--r-- | vcl/source/outdev/polygon.cxx | 8 | ||||
-rw-r--r-- | vcl/source/outdev/polyline.cxx | 8 | ||||
-rw-r--r-- | vcl/source/outdev/rect.cxx | 8 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 10 | ||||
-rw-r--r-- | vcl/source/outdev/textline.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/transparent.cxx | 10 | ||||
-rw-r--r-- | vcl/source/outdev/wallpaper.cxx | 10 |
15 files changed, 75 insertions, 67 deletions
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index f59e441523a6..718cef96f455 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -36,7 +36,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); const Size aSizePix( rBitmap.GetSizePixel() ); DrawBitmap( rDestPt, PixelToLogic( aSizePix ), Point(), aSizePix, rBitmap, MetaActionType::BMP ); @@ -44,7 +44,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap ) void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); DrawBitmap( rDestPt, rDestSize, Point(), rBitmap.GetSizePixel(), rBitmap, MetaActionType::BMPSCALE ); } @@ -54,7 +54,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, const Bitmap& rBitmap, const MetaActionType nAction ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( ImplIsRecordLayout() ) return; @@ -236,7 +236,7 @@ Bitmap OutputDevice::GetDownsampledBitmap( const Size& rDstSz, void OutputDevice::DrawBitmapEx( const Point& rDestPt, const BitmapEx& rBitmapEx ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( ImplIsRecordLayout() ) return; @@ -255,7 +255,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const BitmapEx& rBitmapEx ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( ImplIsRecordLayout() ) return; @@ -275,7 +275,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, const BitmapEx& rBitmapEx, const MetaActionType nAction ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( ImplIsRecordLayout() ) return; @@ -492,7 +492,7 @@ void OutputDevice::DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize const Point& rSrcPtPixel, const Size& rSrcSizePixel, BitmapEx& rBitmapEx ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if (rBitmapEx.IsAlpha()) { @@ -622,7 +622,7 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); Point aOutPt(LogicToPixel(rDestPt)); Size aOutSz(LogicToPixel(rDestSize)); @@ -918,7 +918,7 @@ private: void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, const AlphaMask& rAlpha, Rectangle aDstRect, Rectangle aBmpRect, Size& aOutSize, Point& aOutPoint) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); VirtualDevice* pOldVDev = mpAlphaVDev; @@ -1036,7 +1036,7 @@ bool OutputDevice::DrawTransformBitmapExDirect( const basegfx::B2DHomMatrix& aFullTransform, const BitmapEx& rBitmapEx) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); bool bDone = false; @@ -1157,7 +1157,7 @@ void OutputDevice::DrawTransformedBitmapEx( const basegfx::B2DHomMatrix& rTransformation, const BitmapEx& rBitmapEx) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( ImplIsRecordLayout() ) return; @@ -1330,7 +1330,7 @@ namespace void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, DrawImageFlags nStyle ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); DrawImage( rPos, Size(), rImage, nStyle ); } @@ -1338,7 +1338,7 @@ void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, DrawImageF void OutputDevice::DrawImage( const Point& rPos, const Size& rSize, const Image& rImage, DrawImageFlags nStyle ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); bool bIsSizeValid = rSize.getWidth() != 0 && rSize.getHeight() != 0; diff --git a/vcl/source/outdev/curvedshapes.cxx b/vcl/source/outdev/curvedshapes.cxx index db8f7d6ad7de..0190a4d67fd4 100644 --- a/vcl/source/outdev/curvedshapes.cxx +++ b/vcl/source/outdev/curvedshapes.cxx @@ -25,7 +25,7 @@ void OutputDevice::DrawEllipse( const Rectangle& rRect ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaEllipseAction( rRect ) ); @@ -73,7 +73,7 @@ void OutputDevice::DrawEllipse( const Rectangle& rRect ) void OutputDevice::DrawArc( const Rectangle& rRect, const Point& rStartPt, const Point& rEndPt ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaArcAction( rRect, rStartPt, rEndPt ) ); @@ -117,7 +117,7 @@ void OutputDevice::DrawArc( const Rectangle& rRect, void OutputDevice::DrawPie( const Rectangle& rRect, const Point& rStartPt, const Point& rEndPt ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaPieAction( rRect, rStartPt, rEndPt ) ); @@ -168,7 +168,7 @@ void OutputDevice::DrawPie( const Rectangle& rRect, void OutputDevice::DrawChord( const Rectangle& rRect, const Point& rStartPt, const Point& rEndPt ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaChordAction( rRect, rStartPt, rEndPt ) ); diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index ca0e9490dc97..41c245558899 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -32,7 +32,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect, const Gradient& rGradient ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // Convert rectangle to a tools::PolyPolygon by first converting to a Polygon Polygon aPolygon ( rRect ); @@ -44,7 +44,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect, void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mnDrawMode & DrawModeFlags::NoGradient ) return; // nothing to draw! @@ -172,7 +172,7 @@ void OutputDevice::ClipAndDrawGradientMetafile ( const Gradient &rGradient, cons void OutputDevice::DrawGradientToMetafile ( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( !mpMetaFile ) return; @@ -260,7 +260,7 @@ void OutputDevice::DrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, const tools::PolyPolygon* pClixPolyPoly ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // get BoundRect of rotated rectangle Rectangle aRect; @@ -438,11 +438,19 @@ void OutputDevice::DrawLinearGradient( const Rectangle& rRect, } } +void OutputDevice::assert_if_double_buffered_window() const +{ +#ifndef NDEBUG + const vcl::Window *pWindow = dynamic_cast<const vcl::Window*>(this); + assert(!pWindow || !pWindow->SupportsDoubleBuffering()); +#endif +} + void OutputDevice::DrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, const tools::PolyPolygon* pClixPolyPoly ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // Determine if we output via Polygon or PolyPolygon // For all rasteroperations other then Overpaint always use PolyPolygon, @@ -608,7 +616,7 @@ void OutputDevice::DrawComplexGradient( const Rectangle& rRect, void OutputDevice::DrawLinearGradientToMetafile( const Rectangle& rRect, const Gradient& rGradient ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // get BoundRect of rotated rectangle Rectangle aRect; @@ -788,7 +796,7 @@ void OutputDevice::DrawLinearGradientToMetafile( const Rectangle& rRect, void OutputDevice::DrawComplexGradientToMetafile( const Rectangle& rRect, const Gradient& rGradient ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // Determine if we output via Polygon or PolyPolygon // For all rasteroperations other then Overpaint always use PolyPolygon, diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx index a33fae384222..1ccdcc7c4195 100644 --- a/vcl/source/outdev/hatch.cxx +++ b/vcl/source/outdev/hatch.cxx @@ -44,7 +44,7 @@ extern "C" int SAL_CALL HatchCmpFnc( const void* p1, const void* p2 ) void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); Hatch aHatch( rHatch ); @@ -139,7 +139,7 @@ void OutputDevice::AddHatchActions( const tools::PolyPolygon& rPolyPoly, const H void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch, bool bMtf ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if(rPolyPoly.Count()) { @@ -322,7 +322,7 @@ void OutputDevice::CalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt void OutputDevice::DrawHatchLine( const Line& rLine, const tools::PolyPolygon& rPolyPoly, Point* pPtBuffer, bool bMtf ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); double fX, fY; long nAdd, nPCounter = 0; diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx index f37280fbb52f..f8eba4ab6089 100644 --- a/vcl/source/outdev/line.cxx +++ b/vcl/source/outdev/line.cxx @@ -35,7 +35,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt, const LineInfo& rLineInfo ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( rLineInfo.IsDefault() ) { @@ -89,7 +89,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt, void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaLineAction( rStartPt, rEndPt ) ); diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx index 29737a1d5f75..facbb9ae7c04 100644 --- a/vcl/source/outdev/mask.cxx +++ b/vcl/source/outdev/mask.cxx @@ -34,7 +34,7 @@ extern const sal_uLong nVCLLut[ 256 ]; void OutputDevice::DrawMask( const Point& rDestPt, const Bitmap& rBitmap, const Color& rMaskColor ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); const Size aSizePix( rBitmap.GetSizePixel() ); DrawMask( rDestPt, PixelToLogic( aSizePix ), Point(), aSizePix, rBitmap, rMaskColor, MetaActionType::MASK ); @@ -43,7 +43,7 @@ void OutputDevice::DrawMask( const Point& rDestPt, void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap, const Color& rMaskColor ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); DrawMask( rDestPt, rDestSize, Point(), rBitmap.GetSizePixel(), rBitmap, rMaskColor, MetaActionType::MASKSCALE ); } @@ -53,7 +53,7 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap, const Color& rMaskColor, const MetaActionType nAction ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( ImplIsRecordLayout() ) return; @@ -108,7 +108,7 @@ void OutputDevice::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor, const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); const ImpBitmap* pImpBmp = rMask.ImplGetImpBitmap(); if ( pImpBmp ) diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx index 6e9279c8c75c..071102141a31 100644 --- a/vcl/source/outdev/nativecontrols.cxx +++ b/vcl/source/outdev/nativecontrols.cxx @@ -273,7 +273,7 @@ bool OutputDevice::DrawNativeControl( ControlType nType, const ImplControlValue& aValue, const OUString& aCaption ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( !EnableNativeWidget( *this ) ) return false; diff --git a/vcl/source/outdev/pixel.cxx b/vcl/source/outdev/pixel.cxx index c4f65283970f..8310a72c3d0b 100644 --- a/vcl/source/outdev/pixel.cxx +++ b/vcl/source/outdev/pixel.cxx @@ -57,7 +57,7 @@ Color OutputDevice::GetPixel( const Point& rPt ) const void OutputDevice::DrawPixel( const Point& rPt ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaPointAction( rPt ) ); @@ -87,7 +87,7 @@ void OutputDevice::DrawPixel( const Point& rPt ) void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); Color aColor = ImplDrawModeToColor( rColor ); @@ -116,7 +116,7 @@ void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor ) void OutputDevice::DrawPixel( const Polygon& rPts, const Color* pColors ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( !pColors ) { @@ -163,7 +163,7 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color* pColors ) void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( rColor != COL_TRANSPARENT && ! ImplIsRecordLayout() ) { diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx index c25025c09026..9b703a09be79 100644 --- a/vcl/source/outdev/polygon.cxx +++ b/vcl/source/outdev/polygon.cxx @@ -33,7 +33,7 @@ void OutputDevice::DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( mpMetaFile ) mpMetaFile->AddAction( new MetaPolyPolygonAction( rPolyPoly ) ); @@ -131,7 +131,7 @@ void OutputDevice::DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly ) void OutputDevice::DrawPolygon( const basegfx::B2DPolygon& rB2DPolygon) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // AW: Do NOT paint empty polygons if(rB2DPolygon.count()) @@ -143,7 +143,7 @@ void OutputDevice::DrawPolygon( const basegfx::B2DPolygon& rB2DPolygon) void OutputDevice::DrawPolygon( const Polygon& rPoly ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( mpMetaFile ) mpMetaFile->AddAction( new MetaPolygonAction( rPoly ) ); @@ -239,7 +239,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly ) void OutputDevice::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rB2DPolyPoly ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( mpMetaFile ) mpMetaFile->AddAction( new MetaPolyPolygonAction( tools::PolyPolygon( rB2DPolyPoly ) ) ); diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx index 236d2cd21671..3be82cfadd9a 100644 --- a/vcl/source/outdev/polyline.cxx +++ b/vcl/source/outdev/polyline.cxx @@ -31,7 +31,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( mpMetaFile ) mpMetaFile->AddAction( new MetaPolyLineAction( rPoly ) ); @@ -101,7 +101,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly ) void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( rLineInfo.IsDefault() ) { @@ -129,7 +129,7 @@ void OutputDevice::DrawPolyLine( const basegfx::B2DPolygon& rB2DPolygon, basegfx::B2DLineJoin eLineJoin, css::drawing::LineCap eLineCap) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( mpMetaFile ) { @@ -275,7 +275,7 @@ bool OutputDevice::DrawPolyLineDirect( const basegfx::B2DPolygon& rB2DPolygon, css::drawing::LineCap eLineCap, bool bBypassAACheck ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // AW: Do NOT paint empty PolyPolygons if(!rB2DPolygon.count()) diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx index 44923529c1ad..a9ebc0a676d2 100644 --- a/vcl/source/outdev/rect.cxx +++ b/vcl/source/outdev/rect.cxx @@ -29,7 +29,7 @@ void OutputDevice::DrawRect( const Rectangle& rRect ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaRectAction( rRect ) ); @@ -68,7 +68,7 @@ void OutputDevice::DrawRect( const Rectangle& rRect ) void OutputDevice::DrawRect( const Rectangle& rRect, sal_uLong nHorzRound, sal_uLong nVertRound ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaRoundRectAction( rRect, nHorzRound, nVertRound ) ); @@ -128,7 +128,7 @@ void OutputDevice::DrawRect( const Rectangle& rRect, void OutputDevice::DrawCheckered(const Point& rPos, const Size& rSize, sal_uInt32 nLen, Color aStart, Color aEnd) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); const sal_uInt32 nMaxX(rPos.X() + rSize.Width()); const sal_uInt32 nMaxY(rPos.Y() + rSize.Height()); @@ -154,7 +154,7 @@ void OutputDevice::DrawCheckered(const Point& rPos, const Size& rSize, sal_uInt3 void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, DrawGridFlags nFlags ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); Rectangle aDstRect( PixelToLogic( Point() ), GetOutputSize() ); aDstRect.Intersection( rRect ); diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 15e59bf6cd83..639151d50a76 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -838,7 +838,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const OUString& rStr, MetricVector* pVector, OUString* pDisplayText ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if(nLen == 0x0FFFF) { @@ -961,7 +961,7 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr, const long* pDXAry, sal_Int32 nIndex, sal_Int32 nLen, SalLayoutFlags flags ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if(nLen == 0x0FFFF) { @@ -1166,7 +1166,7 @@ void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth, const OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if(nIndex < 0 || nIndex == 0x0FFFF || nLen == 0x0FFFF) { @@ -1840,7 +1840,7 @@ void OutputDevice::DrawText( const Rectangle& rRect, const OUString& rOrigStr, D MetricVector* pVector, OUString* pDisplayText, vcl::ITextLayout* _pTextLayout ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if (mpOutDevData->mpRecordLayout) { @@ -2148,7 +2148,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen, DrawTextFlags nStyle, MetricVector* pVector, OUString* pDisplayText ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if(nLen == 0x0FFFF) { diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index 8e55eca4656e..551e55649cec 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -941,7 +941,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth, FontUnderline eOverline, bool bUnderlineAbove ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaTextLineAction( rPos, nWidth, eStrikeout, eUnderline, eOverline ) ); @@ -985,7 +985,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth, void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() ) return; diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 7d4e0270d80d..6827fc3b0f30 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -218,7 +218,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, double fTransparency) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // AW: Do NOT paint empty PolyPolygons if(!rB2DPolyPoly.count()) @@ -282,7 +282,7 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, void OutputDevice::DrawInvisiblePolygon( const tools::PolyPolygon& rPolyPoly ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // short circuit if the polygon border is invisible too if( !mbLineColor ) @@ -298,7 +298,7 @@ void OutputDevice::DrawInvisiblePolygon( const tools::PolyPolygon& rPolyPoly ) bool OutputDevice::DrawTransparentNatively ( const tools::PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); bool bDrawn = false; @@ -607,7 +607,7 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, void OutputDevice::DrawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // short circuit for drawing an opaque polygon if( (nTransparencePercent < 1) || (mnDrawMode & DrawModeFlags::NoTransparency) ) @@ -659,7 +659,7 @@ void OutputDevice::DrawTransparent( const tools::PolyPolygon& rPolyPoly, void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, const Size& rSize, const Gradient& rTransparenceGradient ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); const Color aBlack( COL_BLACK ); diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx index c9f3c4c02db1..367eceae7f7e 100644 --- a/vcl/source/outdev/wallpaper.cxx +++ b/vcl/source/outdev/wallpaper.cxx @@ -26,7 +26,7 @@ void OutputDevice::DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if ( mpMetaFile ) mpMetaFile->AddAction( new MetaWallpaperAction( rRect, rWallpaper ) ); @@ -54,7 +54,7 @@ void OutputDevice::DrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); if( rWallpaper.IsBitmap() ) DrawBitmapWallpaper( nX, nY, nWidth, nHeight, rWallpaper ); @@ -68,7 +68,7 @@ void OutputDevice::DrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); // draw wallpaper without border Color aOldLineColor = GetLineColor(); @@ -107,7 +107,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); BitmapEx aBmpEx; const BitmapEx* pCached = rWallpaper.ImplGetImpWallpaper()->ImplGetCachedBitmap(); @@ -345,7 +345,7 @@ void OutputDevice::DrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ) { - assert(!dynamic_cast<vcl::Window*>(this) || !dynamic_cast<vcl::Window*>(this)->SupportsDoubleBuffering()); + assert_if_double_buffered_window(); Rectangle aBound; GDIMetaFile* pOldMetaFile = mpMetaFile; |