diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-06-18 10:37:01 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-06-18 11:43:19 +0300 |
commit | dc3d621411a1de2ec6b61da07741bdf1c80ffc1f (patch) | |
tree | 71c1eef613e033f05baac4bd8304a91691eda955 /vcl/source/outdev/gradient.cxx | |
parent | 0aa10c0b3d5794cd5b701b57de2387eee12076b6 (diff) |
Assertions should tell the line number where the problem is
Let's not hide the assert() in a function whose sole purpose is to
call assert().
Change-Id: I7a8a04aad560b0f22398daabf12d00bbe58e89f1
Diffstat (limited to 'vcl/source/outdev/gradient.cxx')
-rw-r--r-- | vcl/source/outdev/gradient.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index 41c245558899..75520bee5111 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <cassert> + #include <tools/poly.hxx> #include <vcl/gradient.hxx> @@ -32,7 +34,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect, const Gradient& rGradient ) { - assert_if_double_buffered_window(); + assert(!is_double_buffered_window()); // Convert rectangle to a tools::PolyPolygon by first converting to a Polygon Polygon aPolygon ( rRect ); @@ -44,7 +46,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect, void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient ) { - assert_if_double_buffered_window(); + assert(!is_double_buffered_window()); if ( mnDrawMode & DrawModeFlags::NoGradient ) return; // nothing to draw! @@ -172,7 +174,7 @@ void OutputDevice::ClipAndDrawGradientMetafile ( const Gradient &rGradient, cons void OutputDevice::DrawGradientToMetafile ( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient ) { - assert_if_double_buffered_window(); + assert(!is_double_buffered_window()); if ( !mpMetaFile ) return; @@ -260,7 +262,7 @@ void OutputDevice::DrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, const tools::PolyPolygon* pClixPolyPoly ) { - assert_if_double_buffered_window(); + assert(!is_double_buffered_window()); // get BoundRect of rotated rectangle Rectangle aRect; @@ -438,19 +440,17 @@ void OutputDevice::DrawLinearGradient( const Rectangle& rRect, } } -void OutputDevice::assert_if_double_buffered_window() const +bool OutputDevice::is_double_buffered_window() const { -#ifndef NDEBUG const vcl::Window *pWindow = dynamic_cast<const vcl::Window*>(this); - assert(!pWindow || !pWindow->SupportsDoubleBuffering()); -#endif + return pWindow && pWindow->SupportsDoubleBuffering(); } void OutputDevice::DrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, const tools::PolyPolygon* pClixPolyPoly ) { - assert_if_double_buffered_window(); + assert(!is_double_buffered_window()); // Determine if we output via Polygon or PolyPolygon // For all rasteroperations other then Overpaint always use PolyPolygon, @@ -616,7 +616,7 @@ void OutputDevice::DrawComplexGradient( const Rectangle& rRect, void OutputDevice::DrawLinearGradientToMetafile( const Rectangle& rRect, const Gradient& rGradient ) { - assert_if_double_buffered_window(); + assert(!is_double_buffered_window()); // get BoundRect of rotated rectangle Rectangle aRect; @@ -796,7 +796,7 @@ void OutputDevice::DrawLinearGradientToMetafile( const Rectangle& rRect, void OutputDevice::DrawComplexGradientToMetafile( const Rectangle& rRect, const Gradient& rGradient ) { - assert_if_double_buffered_window(); + assert(!is_double_buffered_window()); // Determine if we output via Polygon or PolyPolygon // For all rasteroperations other then Overpaint always use PolyPolygon, |