vcl/source/animate/AnimationRenderer.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
New commits: commit 29113a6c63e98216d98b93e4f6790640470f6796 Author: Christopher Sherlock <chris.sherloc...@gmail.com> AuthorDate: Sun Feb 23 18:51:12 2025 +1100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Sep 9 10:52:27 2025 +0200 vcl: move variables closer to first use in AnimationRenderer::draw() Change-Id: I66844a3a7f7d7e1b8496ac73fabc1a44f5c93b30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182061 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/source/animate/AnimationRenderer.cxx b/vcl/source/animate/AnimationRenderer.cxx index 71d0dbf6fbab..63de2817b81e 100644 --- a/vcl/source/animate/AnimationRenderer.cxx +++ b/vcl/source/animate/AnimationRenderer.cxx @@ -197,17 +197,18 @@ void AnimationRenderer::draw( sal_uLong nIndex, VirtualDevice* pVDev ) if(mbIsPaused) return; - VclPtr<VirtualDevice> pDev; - Point aPosPix; - Point aBmpPosPix; - Size aSizePix; - Size aBmpSizePix; - const sal_uLong nLastPos = mpParent->Count() - 1; - mnActIndex = std::min( nIndex, nLastPos ); + mnActIndex = std::min(nIndex, static_cast<sal_uLong>(mpParent->Count() - 1)); + const AnimationFrame& rAnimationFrame = mpParent->Get( static_cast<sal_uInt16>( mnActIndex ) ); + Point aPosPix; + Size aSizePix; + getPosSize( rAnimationFrame, aPosPix, aSizePix ); + Point aBmpPosPix; + Size aBmpSizePix; + // Mirrored horizontally? if( mbIsMirroredHorizontally ) { @@ -232,6 +233,8 @@ void AnimationRenderer::draw( sal_uLong nIndex, VirtualDevice* pVDev ) aBmpSizePix.setHeight( aSizePix.Height() ); } + VclPtr<VirtualDevice> pDev; + // get output device if( !pVDev ) {