diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-29 08:49:42 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-29 08:49:42 +0100 |
commit | 40ae7d9aca558a8ebfd3279b9bc96ec0e03bbd48 (patch) | |
tree | 3adc5149d0b31cb840c7039913c0936d0a993f09 | |
parent | b418f6485a7e703c334f40c6b9ac2d4613ccb992 (diff) |
autorecovery: ENSURE_OR_RETURN => ENSURE_OR_RETURN_FALSE, added new ENSURE_OR_RETURN taking a return value
-rwxr-xr-x | canvas/source/directx/dx_5rm.cxx | 2 | ||||
-rwxr-xr-x | canvas/source/directx/dx_9rm.cxx | 2 | ||||
-rwxr-xr-x | canvas/source/directx/dx_canvashelper_texturefill.cxx | 2 | ||||
-rw-r--r-- | canvas/source/vcl/canvashelper.cxx | 2 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 30 | ||||
-rw-r--r-- | tools/inc/tools/diagnose_ex.h | 12 |
6 files changed, 28 insertions, 22 deletions
diff --git a/canvas/source/directx/dx_5rm.cxx b/canvas/source/directx/dx_5rm.cxx index 4937934732cd..71c65feb3b6f 100755 --- a/canvas/source/directx/dx_5rm.cxx +++ b/canvas/source/directx/dx_5rm.cxx @@ -1008,7 +1008,7 @@ namespace dxcanvas break; default: - ENSURE_OR_RETURN(false, + ENSURE_OR_RETURN_FALSE(false, "DXSurface::update(): Unknown/unimplemented buffer format" ); break; } diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index acef323ddc1b..a50d0d5abeb7 100755 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.cxx @@ -544,7 +544,7 @@ namespace dxcanvas break; default: - ENSURE_OR_RETURN(false, + ENSURE_OR_RETURN_FALSE(false, "DXSurface::update(): Unknown/unimplemented buffer format" ); break; } diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx index 73a2d49bfb62..f5836e56d668 100755 --- a/canvas/source/directx/dx_canvashelper_texturefill.cxx +++ b/canvas/source/directx/dx_canvashelper_texturefill.cxx @@ -345,7 +345,7 @@ namespace dxcanvas GraphicsPathSharedPtr pGradientPath( tools::graphicsPathFromB2DPolygon( rValues.maGradientPoly ) ); - ENSURE_OR_RETURN( pGradientPath.get(), + ENSURE_OR_RETURN_FALSE( pGradientPath.get(), "ParametricPolyPolygon::fillPolygonalGradient(): Could not clone path" ); PathGradientBrushSharedPtr pGradientBrush; diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 20b489144d0e..144a41fb0212 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -1390,7 +1390,7 @@ namespace vclcanvas const ::Size& rSz, const GraphicAttr& rAttr ) const { - ENSURE_OR_RETURN( rGrf, + ENSURE_OR_RETURN_FALSE( rGrf, "Invalid Graphic" ); if( !mpOutDev ) diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 8ea2ae453a97..0f51216b190e 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -1876,16 +1876,16 @@ namespace cppcanvas ::vcl::unotools::xBitmapFromBitmapEx( rCanvas->getUNOCanvas()->getDevice(), aBmpEx ); - if( aFill.isTiling() )
- {
- aTexture.RepeatModeX = rendering::TexturingMode::REPEAT;
- aTexture.RepeatModeY = rendering::TexturingMode::REPEAT;
- }
- else
- {
- aTexture.RepeatModeX = rendering::TexturingMode::CLAMP;
- aTexture.RepeatModeY = rendering::TexturingMode::CLAMP;
- }
+ if( aFill.isTiling() ) + { + aTexture.RepeatModeX = rendering::TexturingMode::REPEAT; + aTexture.RepeatModeY = rendering::TexturingMode::REPEAT; + } + else + { + aTexture.RepeatModeX = rendering::TexturingMode::CLAMP; + aTexture.RepeatModeY = rendering::TexturingMode::CLAMP; + } ::PolyPolygon aPath; aFill.getPath( aPath ); @@ -2877,7 +2877,7 @@ namespace cppcanvas aSubset.mnSubsetEnd = ::std::min( aRangeBegin->mpAction->getActionCount(), nEndIndex - aRangeBegin->mnOrigIndex ); - ENSURE_OR_RETURN( aSubset.mnSubsetBegin >= 0 && aSubset.mnSubsetEnd >= 0, + ENSURE_OR_RETURN_FALSE( aSubset.mnSubsetBegin >= 0 && aSubset.mnSubsetEnd >= 0, "ImplRenderer::forSubsetRange(): Invalid indices" ); rFunctor( *aRangeBegin, aSubset ); @@ -2893,7 +2893,7 @@ namespace cppcanvas nStartIndex - aRangeBegin->mnOrigIndex ); aSubset.mnSubsetEnd = aRangeBegin->mpAction->getActionCount(); - ENSURE_OR_RETURN( aSubset.mnSubsetBegin >= 0 && aSubset.mnSubsetEnd >= 0, + ENSURE_OR_RETURN_FALSE( aSubset.mnSubsetBegin >= 0 && aSubset.mnSubsetEnd >= 0, "ImplRenderer::forSubsetRange(): Invalid indices" ); rFunctor( *aRangeBegin, aSubset ); @@ -2922,7 +2922,7 @@ namespace cppcanvas aSubset.mnSubsetBegin = 0; aSubset.mnSubsetEnd = nEndIndex - aRangeEnd->mnOrigIndex; - ENSURE_OR_RETURN( aSubset.mnSubsetBegin >= 0 && aSubset.mnSubsetEnd >= 0, + ENSURE_OR_RETURN_FALSE( aSubset.mnSubsetBegin >= 0 && aSubset.mnSubsetEnd >= 0, "ImplRenderer::forSubsetRange(): Invalid indices" ); rFunctor( *aRangeEnd, aSubset ); @@ -2937,10 +2937,10 @@ namespace cppcanvas ActionVector::const_iterator& o_rRangeBegin, ActionVector::const_iterator& o_rRangeEnd ) const { - ENSURE_OR_RETURN( io_rStartIndex<=io_rEndIndex, + ENSURE_OR_RETURN_FALSE( io_rStartIndex<=io_rEndIndex, "ImplRenderer::getSubsetIndices(): invalid action range" ); - ENSURE_OR_RETURN( !maActions.empty(), + ENSURE_OR_RETURN_FALSE( !maActions.empty(), "ImplRenderer::getSubsetIndices(): no actions to render" ); const sal_Int32 nMinActionIndex( maActions.front().mnOrigIndex ); diff --git a/tools/inc/tools/diagnose_ex.h b/tools/inc/tools/diagnose_ex.h index 5ca7a71cf62c..eee965fcfd76 100644 --- a/tools/inc/tools/diagnose_ex.h +++ b/tools/inc/tools/diagnose_ex.h @@ -121,11 +121,17 @@ ifc ); } /** This macro asserts the given condition (in debug mode), and - returns false afterwards. + returns the given value afterwards. */ -#define ENSURE_OR_RETURN(c, m) if( !(c) ) { \ +#define ENSURE_OR_RETURN(c, m, r) if( !(c) ) { \ OSL_ENSURE(c, m); \ - return false; } + return r; } + +/** This macro asserts the given condition (in debug mode), and + returns false afterwards. + */ +#define ENSURE_OR_RETURN_FALSE(c, m) \ + ENSURE_OR_RETURN(c, m, false) |