vcl/inc/animate/AnimationRenderer.hxx    |    6 +++---
 vcl/qa/cppunit/animationrenderer.cxx     |    8 ++++----
 vcl/source/animate/AnimationRenderer.cxx |   20 ++++++++++----------
 3 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit a19e01812b60580c656cf31619e212803e2ca0fa
Author:     Chris Sherlock <chris.sherloc...@gmail.com>
AuthorDate: Fri Jun 24 17:52:41 2022 +1000
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Mon Jul 11 11:05:33 2022 +0200

    vcl: change drawToPos() to drawToIndex()
    
    Change-Id: Iaf102e529cdfd3d758e4e6976f6a99330d8fc64b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76405
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/vcl/inc/animate/AnimationRenderer.hxx 
b/vcl/inc/animate/AnimationRenderer.hxx
index c7fc42a55aa3..18128558a44e 100644
--- a/vcl/inc/animate/AnimationRenderer.hxx
+++ b/vcl/inc/animate/AnimationRenderer.hxx
@@ -60,7 +60,7 @@ private:
     vcl::Region     maClip;
     VclPtr<VirtualDevice>  mpBackground;
     VclPtr<VirtualDevice>  mpRestore;
-    sal_uLong       mnActPos;
+    sal_uLong       mnActIndex;
     Disposal        meLastDisposal;
     bool            mbIsPaused;
     bool            mbIsMarked;
@@ -75,8 +75,8 @@ public:
                     ~AnimationRenderer();
 
     bool            matches(const OutputDevice* pOut, tools::Long nRendererId) 
const;
-    void            drawToPos( sal_uLong nPos );
-    void            draw( sal_uLong nPos, VirtualDevice* pVDev=nullptr );
+    void            drawToIndex( sal_uLong nIndex );
+    void            draw( sal_uLong nIndex, VirtualDevice* pVDev=nullptr );
     void            repaint();
     AInfo*          createAInfo() const;
 
diff --git a/vcl/qa/cppunit/animationrenderer.cxx 
b/vcl/qa/cppunit/animationrenderer.cxx
index 25dfdc44dab5..b4e7f235e883 100644
--- a/vcl/qa/cppunit/animationrenderer.cxx
+++ b/vcl/qa/cppunit/animationrenderer.cxx
@@ -76,10 +76,10 @@ void VclAnimationRendererTest::testDrawToPos()
 
     AnimationRenderer* pAnimationRenderer
         = new AnimationRenderer(&aTestAnim, pTestRC.get(), Point(0, 0), 
Size(10, 10), 5);
-    pAnimationRenderer->drawToPos(0);
-    pAnimationRenderer->drawToPos(1);
-    pAnimationRenderer->drawToPos(2);
-    pAnimationRenderer->drawToPos(10);
+    pAnimationRenderer->drawToIndex(0);
+    pAnimationRenderer->drawToIndex(1);
+    pAnimationRenderer->drawToIndex(2);
+    pAnimationRenderer->drawToIndex(10);
 
     CPPUNIT_ASSERT_EQUAL(Size(1, 1), pTestRC->GetOutputSizePixel());
 }
diff --git a/vcl/source/animate/AnimationRenderer.cxx 
b/vcl/source/animate/AnimationRenderer.cxx
index 611d1c71fd6e..59843e19c893 100644
--- a/vcl/source/animate/AnimationRenderer.cxx
+++ b/vcl/source/animate/AnimationRenderer.cxx
@@ -39,7 +39,7 @@ AnimationRenderer::AnimationRenderer( Animation* pParent, 
OutputDevice* pOut,
         maClip          ( mpRenderContext->GetClipRegion() ),
         mpBackground    ( VclPtr<VirtualDevice>::Create() ),
         mpRestore       ( VclPtr<VirtualDevice>::Create() ),
-        mnActPos        ( 0 ),
+        mnActIndex      ( 0 ),
         meLastDisposal  ( Disposal::Back ),
         mbIsPaused      ( false ),
         mbIsMarked      ( false ),
@@ -79,7 +79,7 @@ AnimationRenderer::AnimationRenderer( Animation* pParent, 
OutputDevice* pOut,
     mpRenderContext->SaveBackground(*mpBackground, maDispPt, maDispSz, 
maSzPix);
 
     // Initialize drawing to actual position
-    drawToPos( mpParent->ImplGetCurPos() );
+    drawToIndex( mpParent->ImplGetCurPos() );
 
     // If first frame OutputDevice is set, update variables now for real 
OutputDevice
     if( pFirstFrameOutDev )
@@ -139,7 +139,7 @@ void AnimationRenderer::getPosSize( const AnimationBitmap& 
rAnimationBitmap, Poi
         rPosPix.setY( maSzPix.Height() - 1 - aPt2.Y() );
 }
 
-void AnimationRenderer::drawToPos( sal_uLong nPos )
+void AnimationRenderer::drawToIndex( sal_uLong nIndex )
 {
     VclPtr<vcl::RenderContext> pRenderContext = mpRenderContext;
 
@@ -157,9 +157,9 @@ void AnimationRenderer::drawToPos( sal_uLong nPos )
         xOldClip = pRenderContext->GetClipRegion();
 
     aVDev->SetOutputSizePixel( maSzPix, false );
-    nPos = std::min( nPos, static_cast<sal_uLong>(mpParent->Count()) - 1 );
+    nIndex = std::min( nIndex, static_cast<sal_uLong>(mpParent->Count()) - 1 );
 
-    for( sal_uLong i = 0; i <= nPos; i++ )
+    for( sal_uLong i = 0; i <= nIndex; i++ )
         draw( i, aVDev.get() );
 
     if (xOldClip)
@@ -173,7 +173,7 @@ void AnimationRenderer::drawToPos( sal_uLong nPos )
         pRenderContext->SetClipRegion(*xOldClip);
 }
 
-void AnimationRenderer::draw( sal_uLong nPos, VirtualDevice* pVDev )
+void AnimationRenderer::draw( sal_uLong nIndex, VirtualDevice* pVDev )
 {
     VclPtr<vcl::RenderContext> pRenderContext = mpRenderContext;
 
@@ -198,8 +198,8 @@ void AnimationRenderer::draw( sal_uLong nPos, 
VirtualDevice* pVDev )
         Size                    aSizePix;
         Size                    aBmpSizePix;
         const sal_uLong             nLastPos = mpParent->Count() - 1;
-        mnActPos = std::min( nPos, nLastPos );
-        const AnimationBitmap&  rAnimationBitmap = mpParent->Get( 
static_cast<sal_uInt16>( mnActPos ) );
+        mnActIndex = std::min( nIndex, nLastPos );
+        const AnimationBitmap&  rAnimationBitmap = mpParent->Get( 
static_cast<sal_uInt16>( mnActIndex ) );
 
         getPosSize( rAnimationBitmap, aPosPix, aSizePix );
 
@@ -238,7 +238,7 @@ void AnimationRenderer::draw( sal_uLong nPos, 
VirtualDevice* pVDev )
             pDev = pVDev;
 
         // restore background after each run
-        if( !nPos )
+        if( !nIndex )
         {
             meLastDisposal = Disposal::Back;
             maRestPt = Point();
@@ -303,7 +303,7 @@ void AnimationRenderer::repaint()
     mpRenderContext->SaveBackground(*mpBackground, maDispPt, maDispSz, 
maSzPix);
 
     mbIsPaused = false;
-    drawToPos( mnActPos );
+    drawToIndex( mnActIndex );
     mbIsPaused = bOldPause;
 }
 

Reply via email to