include/vcl/animate/Animation.hxx        |    4 ++--
 sw/inc/ndgrf.hxx                         |    6 +++---
 vcl/inc/animate/AnimationRenderer.hxx    |    8 ++++----
 vcl/inc/impgraph.hxx                     |    4 ++--
 vcl/source/animate/Animation.cxx         |   18 ++++++++++--------
 vcl/source/animate/AnimationRenderer.cxx |   10 +++++-----
 vcl/source/gdi/graph.cxx                 |    8 ++++----
 vcl/source/gdi/impgraph.cxx              |    8 ++++----
 vcl/source/graphic/GraphicObject.cxx     |    8 ++++----
 9 files changed, 38 insertions(+), 36 deletions(-)

New commits:
commit 903403c1e3d5c0f882189fa87ed2b19c16a9893e
Author:     Chris Sherlock <[email protected]>
AuthorDate: Sat Jun 18 16:18:37 2022 +1000
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Tue Jun 21 07:48:58 2022 +0200

    vcl: rename mnExtraData to mnRendererId
    
    The name "extra data" doesn't really describe what this field does. What
    it actually does it to specify what animation renderer should be used.
    
    Change-Id: I1e705ba89d09ceb41a8649c8947225c7b6816e7a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76403
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/include/vcl/animate/Animation.hxx 
b/include/vcl/animate/Animation.hxx
index 57f1c9d6227e..2df9f51d0221 100644
--- a/include/vcl/animate/Animation.hxx
+++ b/include/vcl/animate/Animation.hxx
@@ -43,9 +43,9 @@ public:
     void Clear();
 
     bool Start(OutputDevice& rOutDev, const Point& rDestPt, const Size& 
rDestSz,
-               tools::Long nExtraData, OutputDevice* pFirstFrameOutDev);
+               tools::Long nRendererId, OutputDevice* pFirstFrameOutDev);
 
-    void Stop(const OutputDevice* pOutDev = nullptr, tools::Long nExtraData = 
0);
+    void Stop(const OutputDevice* pOutDev = nullptr, tools::Long nRendererId = 
0);
 
     void Draw(OutputDevice& rOutDev, const Point& rDestPt) const;
     void Draw(OutputDevice& rOutDev, const Point& rDestPt, const Size& 
rDestSz) const;
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 391dc82d6623..418b3b49d0c9 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -83,9 +83,9 @@ public:
     void TriggerGraphicArrived();
 
     /// wrappers for non-const calls at GraphicObject
-    void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const 
Size& rSz, tools::Long nExtraData, OutputDevice* pFirstFrameOutDev)
-    { maGrfObj.StartAnimation(*pOut, rPt, rSz, nExtraData, pFirstFrameOutDev); 
}
-    void StopGraphicAnimation(const OutputDevice* pOut, tools::Long 
nExtraData) { maGrfObj.StopAnimation(pOut, nExtraData); }
+    void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const 
Size& rSz, tools::Long nRendererId, OutputDevice* pFirstFrameOutDev)
+    { maGrfObj.StartAnimation(*pOut, rPt, rSz, nRendererId, 
pFirstFrameOutDev); }
+    void StopGraphicAnimation(const OutputDevice* pOut, tools::Long 
nRendererId) { maGrfObj.StopAnimation(pOut, nRendererId); }
 
     virtual Size GetTwipSize() const override;
     void SetTwipSize( const Size& rSz );
diff --git a/vcl/inc/animate/AnimationRenderer.hxx 
b/vcl/inc/animate/AnimationRenderer.hxx
index a9fc425e20bb..c7fc42a55aa3 100644
--- a/vcl/inc/animate/AnimationRenderer.hxx
+++ b/vcl/inc/animate/AnimationRenderer.hxx
@@ -34,7 +34,7 @@ struct AInfo
     Size            aStartSize;
     VclPtr<OutputDevice>   pOutDev;
     void*           pRendererData;
-    tools::Long            nExtraData;
+    tools::Long     nRendererId;
     bool            bPause;
 
     AInfo();
@@ -49,7 +49,7 @@ private:
 
     Animation*      mpParent;
     VclPtr<OutputDevice>  mpRenderContext;
-    tools::Long            mnExtraData;
+    tools::Long     mnRendererId;
     Point           maPt;
     Point           maDispPt;
     Point           maRestPt;
@@ -69,12 +69,12 @@ private:
 
 public:
                     AnimationRenderer( Animation* pParent, OutputDevice* pOut,
-                                  const Point& rPt, const Size& rSz, sal_uLong 
nExtraData,
+                                  const Point& rPt, const Size& rSz, sal_uLong 
nRendererId,
                                   OutputDevice* pFirstFrameOutDev = nullptr );
                     AnimationRenderer(AnimationRenderer&&) = delete;
                     ~AnimationRenderer();
 
-    bool            matches(const OutputDevice* pOut, tools::Long nExtraData) 
const;
+    bool            matches(const OutputDevice* pOut, tools::Long nRendererId) 
const;
     void            drawToPos( sal_uLong nPos );
     void            draw( sal_uLong nPos, VirtualDevice* pVDev=nullptr );
     void            repaint();
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 81db551e4f49..dbeee7208c9d 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -166,10 +166,10 @@ private:
     void                startAnimation(OutputDevice& rOutDev,
                                        const Point& rDestPt,
                                        const Size& rDestSize,
-                                       tools::Long nExtraData,
+                                       tools::Long nRendererId,
                                        OutputDevice* pFirstFrameOutDev);
     void                stopAnimation( const OutputDevice* pOutputDevice,
-                                           tools::Long nExtraData );
+                                           tools::Long nRendererId );
 
     void                setAnimationNotifyHdl( const Link<Animation*,void>& 
rLink );
     Link<Animation*,void> getAnimationNotifyHdl() const;
diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx
index 04a52cfd79cb..05924660fb16 100644
--- a/vcl/source/animate/Animation.cxx
+++ b/vcl/source/animate/Animation.cxx
@@ -162,7 +162,7 @@ BitmapChecksum Animation::GetChecksum() const
 }
 
 bool Animation::Start(OutputDevice& rOut, const Point& rDestPt, const Size& 
rDestSz,
-                      tools::Long nExtraData, OutputDevice* pFirstFrameOutDev)
+                      tools::Long nRendererId, OutputDevice* pFirstFrameOutDev)
 {
     bool bRet = false;
 
@@ -175,8 +175,8 @@ bool Animation::Start(OutputDevice& rOut, const Point& 
rDestPt, const Size& rDes
 
             auto itAnimView = std::find_if(
                 maRenderers.begin(), maRenderers.end(),
-                [&rOut, nExtraData](const std::unique_ptr<AnimationRenderer>& 
pAnimView) -> bool {
-                    return pAnimView->matches(&rOut, nExtraData);
+                [&rOut, nRendererId](const std::unique_ptr<AnimationRenderer>& 
pAnimView) -> bool {
+                    return pAnimView->matches(&rOut, nRendererId);
                 });
 
             if (itAnimView != maRenderers.end())
@@ -200,7 +200,7 @@ bool Animation::Start(OutputDevice& rOut, const Point& 
rDestPt, const Size& rDes
 
             if (differs)
                 maRenderers.emplace_back(new AnimationRenderer(this, &rOut, 
rDestPt, rDestSz,
-                                                               nExtraData, 
pFirstFrameOutDev));
+                                                               nRendererId, 
pFirstFrameOutDev));
 
             if (!mbIsInAnimation)
             {
@@ -217,12 +217,12 @@ bool Animation::Start(OutputDevice& rOut, const Point& 
rDestPt, const Size& rDes
     return bRet;
 }
 
-void Animation::Stop(const OutputDevice* pOut, tools::Long nExtraData)
+void Animation::Stop(const OutputDevice* pOut, tools::Long nRendererId)
 {
     maRenderers.erase(
         std::remove_if(maRenderers.begin(), maRenderers.end(),
                        [=](const std::unique_ptr<AnimationRenderer>& 
pAnimView) -> bool {
-                           return pAnimView->matches(pOut, nExtraData);
+                           return pAnimView->matches(pOut, nRendererId);
                        }),
         maRenderers.end());
 
@@ -300,12 +300,14 @@ IMPL_LINK_NOARG(Animation, ImplTimeoutHdl, Timer*, void)
                 if (!pAInfo->pRendererData)
                 {
                     pRenderer = new AnimationRenderer(this, pAInfo->pOutDev, 
pAInfo->aStartOrg,
-                                                      pAInfo->aStartSize, 
pAInfo->nExtraData);
+                                                      pAInfo->aStartSize, 
pAInfo->nRendererId);
 
                     
maRenderers.push_back(std::unique_ptr<AnimationRenderer>(pRenderer));
                 }
                 else
+                {
                     pRenderer = 
static_cast<AnimationRenderer*>(pAInfo->pRendererData);
+                }
 
                 pRenderer->pause(pAInfo->bPause);
                 pRenderer->setMarked(true);
@@ -677,7 +679,7 @@ SvStream& ReadAnimation(SvStream& rIStm, Animation& 
rAnimation)
 AInfo::AInfo()
     : pOutDev(nullptr)
     , pRendererData(nullptr)
-    , nExtraData(0)
+    , nRendererId(0)
     , bPause(false)
 {
 }
diff --git a/vcl/source/animate/AnimationRenderer.cxx 
b/vcl/source/animate/AnimationRenderer.cxx
index 77faf0205255..611d1c71fd6e 100644
--- a/vcl/source/animate/AnimationRenderer.cxx
+++ b/vcl/source/animate/AnimationRenderer.cxx
@@ -28,11 +28,11 @@
 
 AnimationRenderer::AnimationRenderer( Animation* pParent, OutputDevice* pOut,
                             const Point& rPt, const Size& rSz,
-                            sal_uLong nExtraData,
+                            sal_uLong nRendererId,
                             OutputDevice* pFirstFrameOutDev ) :
         mpParent        ( pParent ),
         mpRenderContext ( pFirstFrameOutDev ? pFirstFrameOutDev : pOut ),
-        mnExtraData     ( nExtraData ),
+        mnRendererId     ( nRendererId ),
         maPt            ( rPt ),
         maSz            ( rSz ),
         maSzPix         ( mpRenderContext->LogicToPixel( maSz ) ),
@@ -97,9 +97,9 @@ AnimationRenderer::~AnimationRenderer()
     Animation::ImplDecAnimCount();
 }
 
-bool AnimationRenderer::matches(const OutputDevice* pOut, tools::Long 
nExtraData) const
+bool AnimationRenderer::matches(const OutputDevice* pOut, tools::Long 
nRendererId) const
 {
-    return (!pOut || pOut == mpRenderContext) && (nExtraData == 0 || 
nExtraData == mnExtraData);
+    return (!pOut || pOut == mpRenderContext) && (nRendererId == 0 || 
nRendererId == mnRendererId);
 }
 
 void AnimationRenderer::getPosSize( const AnimationBitmap& rAnimationBitmap, 
Point& rPosPix, Size& rSizePix )
@@ -315,7 +315,7 @@ AInfo* AnimationRenderer::createAInfo() const
     pAInfo->aStartSize = maSz;
     pAInfo->pOutDev = mpRenderContext;
     pAInfo->pRendererData = const_cast<AnimationRenderer *>(this);
-    pAInfo->nExtraData = mnExtraData;
+    pAInfo->nRendererId = mnRendererId;
     pAInfo->bPause = mbIsPaused;
 
     return pAInfo;
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index c56ddb7204eb..2407744820f8 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -447,17 +447,17 @@ void Graphic::DrawEx(OutputDevice& rOutDev, const 
OUString& rText,
 }
 
 void Graphic::StartAnimation(OutputDevice& rOutDev, const Point& rDestPt,
-                             const Size& rDestSz, tools::Long nExtraData,
+                             const Size& rDestSz, tools::Long nRendererId,
                              OutputDevice* pFirstFrameOutDev)
 {
     ImplTestRefCount();
-    mxImpGraphic->startAnimation(rOutDev, rDestPt, rDestSz, nExtraData, 
pFirstFrameOutDev);
+    mxImpGraphic->startAnimation(rOutDev, rDestPt, rDestSz, nRendererId, 
pFirstFrameOutDev);
 }
 
-void Graphic::StopAnimation( const OutputDevice* pOutDev, tools::Long 
nExtraData )
+void Graphic::StopAnimation( const OutputDevice* pOutDev, tools::Long 
nRendererId )
 {
     ImplTestRefCount();
-    mxImpGraphic->stopAnimation( pOutDev, nExtraData );
+    mxImpGraphic->stopAnimation( pOutDev, nRendererId );
 }
 
 void Graphic::SetAnimationNotifyHdl( const Link<Animation*,void>& rLink )
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 37e13abc57a3..5d7740e2c440 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1085,21 +1085,21 @@ void ImpGraphic::draw(OutputDevice& rOutDev,
 }
 
 void ImpGraphic::startAnimation(OutputDevice& rOutDev, const Point& rDestPt,
-                                const Size& rDestSize, tools::Long nExtraData,
+                                const Size& rDestSize, tools::Long nRendererId,
                                 OutputDevice* pFirstFrameOutDev )
 {
     ensureAvailable();
 
     if( isSupportedGraphic() && !isSwappedOut() && mpAnimation )
-        mpAnimation->Start(rOutDev, rDestPt, rDestSize, nExtraData, 
pFirstFrameOutDev);
+        mpAnimation->Start(rOutDev, rDestPt, rDestSize, nRendererId, 
pFirstFrameOutDev);
 }
 
-void ImpGraphic::stopAnimation( const OutputDevice* pOutDev, tools::Long 
nExtraData )
+void ImpGraphic::stopAnimation( const OutputDevice* pOutDev, tools::Long 
nRendererId )
 {
     ensureAvailable();
 
     if( isSupportedGraphic() && !isSwappedOut() && mpAnimation )
-        mpAnimation->Stop( pOutDev, nExtraData );
+        mpAnimation->Stop( pOutDev, nRendererId );
 }
 
 void ImpGraphic::setAnimationNotifyHdl( const Link<Animation*,void>& rLink )
diff --git a/vcl/source/graphic/GraphicObject.cxx 
b/vcl/source/graphic/GraphicObject.cxx
index 86b49077804a..413355e60680 100644
--- a/vcl/source/graphic/GraphicObject.cxx
+++ b/vcl/source/graphic/GraphicObject.cxx
@@ -541,7 +541,7 @@ void GraphicObject::DrawTiled(OutputDevice& rOut, const 
tools::Rectangle& rArea,
 }
 
 bool GraphicObject::StartAnimation(OutputDevice& rOut, const Point& rPt, const 
Size& rSz,
-                                   tools::Long nExtraData,
+                                   tools::Long nRendererId,
                                    OutputDevice* pFirstFrameOutDev)
 {
     bool bRet = false;
@@ -579,7 +579,7 @@ bool GraphicObject::StartAnimation(OutputDevice& rOut, 
const Point& rPt, const S
             
mxSimpleCache->maGraphic.SetAnimationNotifyHdl(GetGraphic().GetAnimationNotifyHdl());
         }
 
-        mxSimpleCache->maGraphic.StartAnimation(rOut, aPt, aSz, nExtraData, 
pFirstFrameOutDev);
+        mxSimpleCache->maGraphic.StartAnimation(rOut, aPt, aSz, nRendererId, 
pFirstFrameOutDev);
 
         if( bCropped )
             rOut.Pop();
@@ -592,10 +592,10 @@ bool GraphicObject::StartAnimation(OutputDevice& rOut, 
const Point& rPt, const S
     return bRet;
 }
 
-void GraphicObject::StopAnimation( const OutputDevice* pOut, tools::Long 
nExtraData )
+void GraphicObject::StopAnimation( const OutputDevice* pOut, tools::Long 
nRendererId )
 {
     if (mxSimpleCache)
-        mxSimpleCache->maGraphic.StopAnimation(pOut, nExtraData);
+        mxSimpleCache->maGraphic.StopAnimation(pOut, nRendererId);
 }
 
 const Graphic& GraphicObject::GetGraphic() const

Reply via email to