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/source/outdev/gradient.cxx | |
parent | a08f0aa2857f4a5342cedf2038488fc98fb716fb (diff) |
masses of coverity FORWARD_NULL warnings from copied assert
Change-Id: I8f698bbcf4d53a4477cc0ee0c3f2c7f08e521f8a
Diffstat (limited to 'vcl/source/outdev/gradient.cxx')
-rw-r--r-- | vcl/source/outdev/gradient.cxx | 22 |
1 files changed, 15 insertions, 7 deletions
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, |