diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-26 13:35:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-26 18:02:19 +0100 |
commit | b624b13b3d5a8e573c7de8158cadc66b1982d157 (patch) | |
tree | 56948e6a5e8d7f5a7cbde6328a27f13ecd8a72bc /slideshow | |
parent | 8136620ff432bf17815bef1f88c7531edb839d23 (diff) |
loplugin:flatten
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/animationfactory.cxx | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/slideshow/source/engine/animationfactory.cxx b/slideshow/source/engine/animationfactory.cxx index e874b0924cd8..e5a7d3b9e74c 100644 --- a/slideshow/source/engine/animationfactory.cxx +++ b/slideshow/source/engine/animationfactory.cxx @@ -278,21 +278,21 @@ namespace slideshow::internal virtual void end() override { end_(); } void end_() { - if( mbAnimationStarted ) - { - mbAnimationStarted = false; + if( !mbAnimationStarted ) + return; - if( !(mnFlags & AnimationFactory::FLAG_NO_SPRITE) ) - mpShapeManager->leaveAnimationMode( mpShape ); + mbAnimationStarted = false; - if( mpShape->isContentChanged() ) - mpShapeManager->notifyShapeUpdate( mpShape ); + if( !(mnFlags & AnimationFactory::FLAG_NO_SPRITE) ) + mpShapeManager->leaveAnimationMode( mpShape ); - // if there is a physics animation going on report the animation ending - // and zero out the velocity of the shape - if( mpBox2DWorld->isInitialized() ) - mpBox2DWorld->queueLinearVelocityUpdate( mpShape->getXShape(), {0,0}); - } + if( mpShape->isContentChanged() ) + mpShapeManager->notifyShapeUpdate( mpShape ); + + // if there is a physics animation going on report the animation ending + // and zero out the velocity of the shape + if( mpBox2DWorld->isInitialized() ) + mpBox2DWorld->queueLinearVelocityUpdate( mpShape->getXShape(), {0,0}); } // NumberAnimation interface @@ -441,25 +441,25 @@ namespace slideshow::internal mpBox2DWorld->setHasWorldStepper(false); } - if( mbAnimationStarted ) - { - mbAnimationStarted = false; + if( !mbAnimationStarted ) + return; - if( !(mnFlags & AnimationFactory::FLAG_NO_SPRITE) ) - mpShapeManager->leaveAnimationMode( mpShape ); + mbAnimationStarted = false; - if( mpShape->isContentChanged() ) - mpShapeManager->notifyShapeUpdate( mpShape ); + if( !(mnFlags & AnimationFactory::FLAG_NO_SPRITE) ) + mpShapeManager->leaveAnimationMode( mpShape ); - mpBox2DWorld->alertPhysicsAnimationEnd(mpShape); - // if this was the only physics animation effect going on - // all box2d bodies were destroyed on alertPhysicsAnimationEnd - // except the one owned by the animation. - // Try to destroy the remaining body - if it is unique - // (it being unique means all physics animation effects have ended - // since otherwise mpBox2DWorld would own a copy of the shared_ptr ) - mpBox2DBody.reset(); - } + if( mpShape->isContentChanged() ) + mpShapeManager->notifyShapeUpdate( mpShape ); + + mpBox2DWorld->alertPhysicsAnimationEnd(mpShape); + // if this was the only physics animation effect going on + // all box2d bodies were destroyed on alertPhysicsAnimationEnd + // except the one owned by the animation. + // Try to destroy the remaining body - if it is unique + // (it being unique means all physics animation effects have ended + // since otherwise mpBox2DWorld would own a copy of the shared_ptr ) + mpBox2DBody.reset(); } |