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 | 376663c8095d6f530d9771959ef44e69a6f57ac3 (patch) | |
tree | cdb363abd9b103ea8aa2d289fa68d769c1a20406 /slideshow | |
parent | b2be9b737d52a5b5fc38f7766ab0bd3621a8bc64 (diff) |
autorecovery: ENSURE_OR_RETURN => ENSURE_OR_RETURN_FALSE, added new ENSURE_OR_RETURN taking a return value
Diffstat (limited to 'slideshow')
20 files changed, 46 insertions, 46 deletions
diff --git a/slideshow/source/engine/animationfactory.cxx b/slideshow/source/engine/animationfactory.cxx index 2431b64f7..64ac9a349 100644 --- a/slideshow/source/engine/animationfactory.cxx +++ b/slideshow/source/engine/animationfactory.cxx @@ -154,7 +154,7 @@ namespace slideshow virtual bool operator()( const ::basegfx::B2DTuple& rValue ) { - ENSURE_OR_RETURN( mpAttrLayer && mpShape, + ENSURE_OR_RETURN_FALSE( mpAttrLayer && mpShape, "TupleAnimation::operator(): Invalid ShapeAttributeLayer" ); ValueT aValue( rValue.getX(), @@ -317,7 +317,7 @@ namespace slideshow virtual bool operator()( double nValue ) { - ENSURE_OR_RETURN( mpAttrLayer && mpShape, + ENSURE_OR_RETURN_FALSE( mpAttrLayer && mpShape, "PathAnimation::operator(): Invalid ShapeAttributeLayer" ); ::basegfx::B2DPoint rOutPos = ::basegfx::tools::getPositionRelative( maPathPoly, @@ -537,7 +537,7 @@ namespace slideshow */ bool operator()( const ValueT& x ) { - ENSURE_OR_RETURN( mpAttrLayer && mpShape, + ENSURE_OR_RETURN_FALSE( mpAttrLayer && mpShape, "GenericAnimation::operator(): Invalid ShapeAttributeLayer" ); ((*mpAttrLayer).*mpSetValueFunc)( maSetterModifier( x ) ); @@ -552,7 +552,7 @@ namespace slideshow */ bool operator()( ValueT x ) { - ENSURE_OR_RETURN( mpAttrLayer && mpShape, + ENSURE_OR_RETURN_FALSE( mpAttrLayer && mpShape, "GenericAnimation::operator(): Invalid ShapeAttributeLayer" ); ((*mpAttrLayer).*mpSetValueFunc)( maSetterModifier( x ) ); diff --git a/slideshow/source/engine/animationnodes/animationnodefactory.cxx b/slideshow/source/engine/animationnodes/animationnodefactory.cxx index 548e100de..09b112871 100644 --- a/slideshow/source/engine/animationnodes/animationnodefactory.cxx +++ b/slideshow/source/engine/animationnodes/animationnodefactory.cxx @@ -201,7 +201,7 @@ bool implCreateIteratedNodes( // ================================== // TODO(E1): I'm not too sure what to expect here... - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( xIterNode->getTarget().hasValue(), "implCreateIteratedNodes(): no target on ITERATE node" ); @@ -216,14 +216,14 @@ bool implCreateIteratedNodes( { // no shape provided. Maybe a ParagraphTarget? if( !(xIterNode->getTarget() >>= aTarget) ) - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( false, "implCreateIteratedNodes(): could not extract any " "target information" ); xTargetShape = aTarget.Shape; - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( xTargetShape.is(), "implCreateIteratedNodes(): invalid shape in ParagraphTarget" ); @@ -254,7 +254,7 @@ bool implCreateIteratedNodes( // paragraph) if( bParagraphTarget ) { - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( aTarget.Paragraph >= 0 && rTreeNodeSupplier.getNumberOfTreeNodes( DocTreeNode::NODETYPE_LOGICAL_PARAGRAPH ) > aTarget.Paragraph, @@ -325,7 +325,7 @@ bool implCreateIteratedNodes( if( !::anim::for_each_childNode( xNode, aCreator ) ) { - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( false, "implCreateIteratedNodes(): iterated child node creation failed" ); } @@ -448,7 +448,7 @@ bool implCreateIteratedNodes( if( !::anim::for_each_childNode( xNode, aCreator ) ) { - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( false, "implCreateIteratedNodes(): " "iterated child node creation failed" ); } diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx index 8288eb002..d21be4c00 100644 --- a/slideshow/source/engine/animationnodes/basenode.cxx +++ b/slideshow/source/engine/animationnodes/basenode.cxx @@ -674,7 +674,7 @@ bool BaseNode::registerDeactivatingListener( if (! checkValidNode()) return false; - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( rNotifee, "BaseNode::registerDeactivatingListener(): invalid notifee" ); maDeactivatingListeners.push_back( rNotifee ); diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index cbb803404..a88fca106 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -616,7 +616,7 @@ bool EventMultiplexerImpl::notifyMouseHandlers( uno::Reference<presentation::XSlideShowView> xView( e.Source, uno::UNO_QUERY ); - ENSURE_OR_RETURN( xView.is(), "EventMultiplexer::notifyHandlers(): " + ENSURE_OR_RETURN_FALSE( xView.is(), "EventMultiplexer::notifyHandlers(): " "event source is not an XSlideShowView" ); // find corresponding view (to map mouse position into user @@ -631,7 +631,7 @@ bool EventMultiplexerImpl::notifyMouseHandlers( boost::cref( xView ), boost::bind( &UnoView::getUnoView, _1 ) ) ) ) == aEnd) { - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( false, "EventMultiplexer::notifyHandlers(): " "event source not found under registered views" ); } diff --git a/slideshow/source/engine/eventqueue.cxx b/slideshow/source/engine/eventqueue.cxx index 3fe997e73..eceddf850 100644 --- a/slideshow/source/engine/eventqueue.cxx +++ b/slideshow/source/engine/eventqueue.cxx @@ -112,7 +112,7 @@ namespace slideshow rEvent.get(), rEvent->getActivationTime(0.0)); #endif - ENSURE_OR_RETURN( rEvent, + ENSURE_OR_RETURN_FALSE( rEvent, "EventQueue::addEvent: event ptr NULL" ); // prepare entry @@ -141,7 +141,7 @@ namespace slideshow rEvent->getActivationTime(0.0)); #endif - ENSURE_OR_RETURN( rEvent.get() != NULL, + ENSURE_OR_RETURN_FALSE( rEvent.get() != NULL, "EventQueue::addEvent: event ptr NULL" ); maNextEvents.push_back( EventEntry( rEvent, rEvent->getActivationTime( @@ -161,7 +161,7 @@ namespace slideshow rpEvent->getActivationTime(0.0)); #endif - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( rpEvent.get() != NULL, "EventQueue::addEvent: event ptr NULL"); diff --git a/slideshow/source/engine/shapeattributelayer.cxx b/slideshow/source/engine/shapeattributelayer.cxx index 99b51d325..16ee04460 100644 --- a/slideshow/source/engine/shapeattributelayer.cxx +++ b/slideshow/source/engine/shapeattributelayer.cxx @@ -214,7 +214,7 @@ namespace slideshow bool ShapeAttributeLayer::revokeChildLayer( const ShapeAttributeLayerSharedPtr& rChildLayer ) { - ENSURE_OR_RETURN( rChildLayer, + ENSURE_OR_RETURN_FALSE( rChildLayer, "ShapeAttributeLayer::revokeChildLayer(): Will not remove NULL child" ); if( !haveChild() ) diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx index 9aa162482..3fce15be2 100644 --- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx +++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx @@ -703,7 +703,7 @@ bool ActivityImpl::perform() if( !isActive() ) return false; - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( mpDrawShape, "ActivityImpl::perform(): still active, but NULL draw shape" ); diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx index c94b73f3a..ea5acd715 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -330,7 +330,7 @@ namespace slideshow mbForceUpdate = false; mbAttributeLayerRevoked = false; - ENSURE_OR_RETURN( !maViewShapes.empty(), + ENSURE_OR_RETURN_FALSE( !maViewShapes.empty(), "DrawShape::implRender(): render called on DrawShape without views" ); if( maBounds.isEmpty() ) @@ -1062,7 +1062,7 @@ namespace slideshow bool DrawShape::setIntrinsicAnimationFrame( ::std::size_t nCurrFrame ) { - ENSURE_OR_RETURN( nCurrFrame < maAnimationFrames.size(), + ENSURE_OR_RETURN_FALSE( nCurrFrame < maAnimationFrames.size(), "DrawShape::setIntrinsicAnimationFrame(): frame index out of bounds" ); if( mnCurrFrame != nCurrFrame ) diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index 909a62e78..ecf8bf2b1 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -189,7 +189,7 @@ bool getMetaFile( const uno::Reference< lang::XComponent >& xSource, int mtfLoadFlags, const uno::Reference< uno::XComponentContext >& rxContext ) { - ENSURE_OR_RETURN( rxContext.is(), + ENSURE_OR_RETURN_FALSE( rxContext.is(), "getMetaFile(): Invalid context" ); // create dummy XGraphicRenderer, which receives the @@ -389,7 +389,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, break; default: - ENSURE_OR_RETURN(false, + ENSURE_OR_RETURN_FALSE(false, "getAnimationFromGraphic(): Unexpected case" ); break; } diff --git a/slideshow/source/engine/shapes/viewappletshape.cxx b/slideshow/source/engine/shapes/viewappletshape.cxx index 3055383bd..ae98d3f66 100644 --- a/slideshow/source/engine/shapes/viewappletshape.cxx +++ b/slideshow/source/engine/shapes/viewappletshape.cxx @@ -141,7 +141,7 @@ namespace slideshow bool ViewAppletShape::startApplet( const ::basegfx::B2DRectangle& rBounds ) { - ENSURE_OR_RETURN( mpViewLayer && mpViewLayer->getCanvas() && mpViewLayer->getCanvas()->getUNOCanvas().is(), + ENSURE_OR_RETURN_FALSE( mpViewLayer && mpViewLayer->getCanvas() && mpViewLayer->getCanvas()->getUNOCanvas().is(), "ViewAppletShape::startApplet(): Invalid or disposed view" ); try { diff --git a/slideshow/source/engine/shapes/viewbackgroundshape.cxx b/slideshow/source/engine/shapes/viewbackgroundshape.cxx index 0250f867d..ccbc6087a 100644 --- a/slideshow/source/engine/shapes/viewbackgroundshape.cxx +++ b/slideshow/source/engine/shapes/viewbackgroundshape.cxx @@ -71,7 +71,7 @@ namespace slideshow const GDIMetaFileSharedPtr& rMtf ) const { RTL_LOGFILE_CONTEXT( aLog, "::presentation::internal::ViewBackgroundShape::prefetch()" ); - ENSURE_OR_RETURN( rMtf, + ENSURE_OR_RETURN_FALSE( rMtf, "ViewBackgroundShape::prefetch(): no valid metafile!" ); const ::basegfx::B2DHomMatrix& rCanvasTransform( @@ -131,7 +131,7 @@ namespace slideshow *rMtf.get(), ::cppcanvas::Renderer::Parameters() ) ); - ENSURE_OR_RETURN( pRenderer, + ENSURE_OR_RETURN_FALSE( pRenderer, "ViewBackgroundShape::prefetch(): Could not create Renderer" ); pRenderer->setTransformation( aShapeTransform ); @@ -172,7 +172,7 @@ namespace slideshow if( !prefetch( rDestinationCanvas, rMtf ) ) return false; - ENSURE_OR_RETURN( mxBitmap.is(), + ENSURE_OR_RETURN_FALSE( mxBitmap.is(), "ViewBackgroundShape::draw(): Invalid background bitmap" ); ::basegfx::B2DHomMatrix aTransform( mpViewLayer->getTransformation() ); diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index 609566f73..e1ec7a6df 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -275,7 +275,7 @@ namespace slideshow { if( !mxPlayer.is() && mxShape.is() ) { - ENSURE_OR_RETURN( mpViewLayer->getCanvas(), + ENSURE_OR_RETURN_FALSE( mpViewLayer->getCanvas(), "ViewMediaShape::update(): Invalid layer canvas" ); uno::Reference< rendering::XCanvas > xCanvas( mpViewLayer->getCanvas()->getUNOCanvas() ); diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index 76be1b9aa..75c6b140b 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -81,7 +81,7 @@ namespace slideshow const ShapeAttributeLayerSharedPtr& rAttr ) const { RTL_LOGFILE_CONTEXT( aLog, "::presentation::internal::ViewShape::prefetch()" ); - ENSURE_OR_RETURN( rMtf, + ENSURE_OR_RETURN_FALSE( rMtf, "ViewShape::prefetch(): no valid metafile!" ); if( rMtf != io_rCacheEntry.mpMtf || @@ -207,7 +207,7 @@ namespace slideshow ::cppcanvas::RendererSharedPtr pRenderer( getRenderer( rDestinationCanvas, rMtf, rAttr ) ); - ENSURE_OR_RETURN( pRenderer, "ViewShape::draw(): Invalid renderer" ); + ENSURE_OR_RETURN_FALSE( pRenderer, "ViewShape::draw(): Invalid renderer" ); pRenderer->setTransformation( rTransform ); #if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 @@ -399,7 +399,7 @@ namespace slideshow mpSprite->resize( rSpriteSizePixel ); } - ENSURE_OR_RETURN( mpSprite, "ViewShape::renderSprite(): No sprite" ); + ENSURE_OR_RETURN_FALSE( mpSprite, "ViewShape::renderSprite(): No sprite" ); VERBOSE_TRACE( "ViewShape::renderSprite(): Rendering sprite 0x%X", mpSprite.get() ); @@ -873,7 +873,7 @@ namespace slideshow bool bIsVisible ) const { RTL_LOGFILE_CONTEXT( aLog, "::presentation::internal::ViewShape::update()" ); - ENSURE_OR_RETURN( mpViewLayer->getCanvas(), "ViewShape::update(): Invalid layer canvas" ); + ENSURE_OR_RETURN_FALSE( mpViewLayer->getCanvas(), "ViewShape::update(): Invalid layer canvas" ); // Shall we render to a sprite, or to a plain canvas? if( isBackgroundDetached() ) diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index 052758d20..635d1fc2d 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -342,7 +342,7 @@ bool ShapeManagerImpl::listenerAdded( if( (aIter = mrGlobalListenersMap.find( xShape )) == mrGlobalListenersMap.end() ) { - ENSURE_OR_RETURN(false, + ENSURE_OR_RETURN_FALSE(false, "ShapeManagerImpl::listenerAdded(): global " "shape listener map inconsistency!"); } diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 6da4ef2f3..6c43c6d02 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -795,9 +795,9 @@ bool SlideImpl::implPrefetchShow() if( mbShowLoaded ) return true; - ENSURE_OR_RETURN( mxDrawPage.is(), + ENSURE_OR_RETURN_FALSE( mxDrawPage.is(), "SlideImpl::implPrefetchShow(): Invalid draw page" ); - ENSURE_OR_RETURN( mpLayerManager, + ENSURE_OR_RETURN_FALSE( mpLayerManager, "SlideImpl::implPrefetchShow(): Invalid layer manager" ); // fetch desired page content @@ -908,7 +908,7 @@ bool SlideImpl::applyInitialShapeAttributes( try { - ENSURE_OR_RETURN( maContext.mxComponentContext.is(), + ENSURE_OR_RETURN_FALSE( maContext.mxComponentContext.is(), "SlideImpl::applyInitialShapeAttributes(): Invalid component context" ); uno::Reference<lang::XMultiComponentFactory> xFac( @@ -936,7 +936,7 @@ bool SlideImpl::applyInitialShapeAttributes( // could not determine initial shape attributes - this // is an error, as some effects might then be plainly // invisible - ENSURE_OR_RETURN( false, + ENSURE_OR_RETURN_FALSE( false, "SlideImpl::applyInitialShapeAttributes(): " "couldn't create TargetPropertiesCreator." ); } @@ -1041,9 +1041,9 @@ bool SlideImpl::loadShapes() if( mbShapesLoaded ) return true; - ENSURE_OR_RETURN( mxDrawPage.is(), + ENSURE_OR_RETURN_FALSE( mxDrawPage.is(), "SlideImpl::loadShapes(): Invalid draw page" ); - ENSURE_OR_RETURN( mpLayerManager, + ENSURE_OR_RETURN_FALSE( mpLayerManager, "SlideImpl::loadShapes(): Invalid layer manager" ); // fetch desired page content diff --git a/slideshow/source/engine/slidebitmap.cxx b/slideshow/source/engine/slidebitmap.cxx index 56a0a2e4a..9ce5b8f76 100644 --- a/slideshow/source/engine/slidebitmap.cxx +++ b/slideshow/source/engine/slidebitmap.cxx @@ -68,7 +68,7 @@ namespace slideshow bool SlideBitmap::draw( const ::cppcanvas::CanvasSharedPtr& rCanvas ) const { - ENSURE_OR_RETURN( rCanvas && rCanvas->getUNOCanvas().is(), + ENSURE_OR_RETURN_FALSE( rCanvas && rCanvas->getUNOCanvas().is(), "SlideBitmap::draw(): Invalid canvas" ); // selectively only copy the transformation from current viewstate, diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 5c2523462..be553052e 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -1324,8 +1324,8 @@ sal_Bool SlideShowImpl::addView( DBG_TESTSOLARMUTEX(); // first of all, check if view has a valid canvas - ENSURE_OR_RETURN( xView.is(), "addView(): Invalid view" ); - ENSURE_OR_RETURN( xView->getCanvas().is(), + ENSURE_OR_RETURN_FALSE( xView.is(), "addView(): Invalid view" ); + ENSURE_OR_RETURN_FALSE( xView->getCanvas().is(), "addView(): View does not provide a valid canvas" ); UnoViewSharedPtr const pView( createSlideView( @@ -1368,7 +1368,7 @@ sal_Bool SlideShowImpl::removeView( // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); - ENSURE_OR_RETURN( xView.is(), "removeView(): Invalid view" ); + ENSURE_OR_RETURN_FALSE( xView.is(), "removeView(): Invalid view" ); UnoViewSharedPtr const pView( maViewContainer.removeView( xView ) ); if( !pView ) diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx index b6faaca69..5200f735d 100644 --- a/slideshow/source/engine/slideview.cxx +++ b/slideshow/source/engine/slideview.cxx @@ -855,7 +855,7 @@ bool SlideView::updateScreen() const { osl::MutexGuard aGuard( m_aMutex ); - ENSURE_OR_RETURN( mpCanvas.get(), + ENSURE_OR_RETURN_FALSE( mpCanvas.get(), "SlideView::updateScreen(): Disposed" ); return mpCanvas->updateScreen( false ); @@ -865,7 +865,7 @@ bool SlideView::paintScreen() const { osl::MutexGuard aGuard( m_aMutex ); - ENSURE_OR_RETURN( mpCanvas.get(), + ENSURE_OR_RETURN_FALSE( mpCanvas.get(), "SlideView::paintScreen(): Disposed" ); return mpCanvas->updateScreen( true ); diff --git a/slideshow/source/engine/transitions/shapetransitionfactory.cxx b/slideshow/source/engine/transitions/shapetransitionfactory.cxx index 33b085011..1c2221e44 100644 --- a/slideshow/source/engine/transitions/shapetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/shapetransitionfactory.cxx @@ -185,7 +185,7 @@ void ClippingAnimation::end_() bool ClippingAnimation::operator()( double nValue ) { - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( mpAttrLayer && mpShape, "ClippingAnimation::operator(): Invalid ShapeAttributeLayer" ); diff --git a/slideshow/source/engine/usereventqueue.cxx b/slideshow/source/engine/usereventqueue.cxx index 2a08faa0c..22cfc39ee 100644 --- a/slideshow/source/engine/usereventqueue.cxx +++ b/slideshow/source/engine/usereventqueue.cxx @@ -181,7 +181,7 @@ public: virtual bool handleAnimationEvent( const AnimationNodeSharedPtr& rNode ) { - ENSURE_OR_RETURN( + ENSURE_OR_RETURN_FALSE( rNode, "AllAnimationEventHandler::handleAnimationEvent(): Invalid node" ); |