include/vcl/animate/Animation.hxx |    6 +++---
 vcl/source/animate/Animation.cxx  |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 68fe430723368bdb0be91b7eef0bc3e3d294caa5
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Mar 23 15:59:39 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Mar 23 20:32:30 2023 +0000

    rename mnAnimCount to gAnimationRendererCount
    
    to better distinguish it from nAnimCount
    
    Change-Id: I2fc5912964e8d48a991dfe0d755e5ce27d9e0905
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149458
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/include/vcl/animate/Animation.hxx 
b/include/vcl/animate/Animation.hxx
index 11bb3c894058..cd8c464c0525 100644
--- a/include/vcl/animate/Animation.hxx
+++ b/include/vcl/animate/Animation.hxx
@@ -90,12 +90,12 @@ public:
     friend SvStream& WriteAnimation(SvStream& rOStream, const Animation& 
rAnimation);
 
 public:
-    SAL_DLLPRIVATE static void ImplIncAnimCount() { mnAnimCount++; }
-    SAL_DLLPRIVATE static void ImplDecAnimCount() { mnAnimCount--; }
+    SAL_DLLPRIVATE static void ImplIncAnimCount() { gAnimationRendererCount++; 
}
+    SAL_DLLPRIVATE static void ImplDecAnimCount() { gAnimationRendererCount--; 
}
     SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnFrameIndex; }
 
 private:
-    SAL_DLLPRIVATE static sal_uLong mnAnimCount;
+    SAL_DLLPRIVATE static sal_uLong gAnimationRendererCount;
 
     std::vector<std::unique_ptr<AnimationFrame>> maFrames;
     std::vector<std::unique_ptr<AnimationRenderer>> maRenderers;
diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx
index 9c188e417951..9f890c6568d3 100644
--- a/vcl/source/animate/Animation.cxx
+++ b/vcl/source/animate/Animation.cxx
@@ -31,7 +31,7 @@
 
 #include <animate/AnimationRenderer.hxx>
 
-sal_uLong Animation::mnAnimCount = 0;
+sal_uLong Animation::gAnimationRendererCount = 0;
 
 Animation::Animation()
     : maTimer("vcl::Animation")
commit f70314c8d438efe6d26460cfbeb2e7fd955346cd
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Mar 23 15:35:49 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Mar 23 20:32:20 2023 +0000

    crashreporting: BitmapEx::operator=(BitmapEx const &) crashes
    
    e.g.
    
https://crashreport.libreoffice.org/stats/crash_details/b68d5267-16b1-4ee9-bd42-bdcecdb7043c
    
    this went wrong with:
    
    commit 91bc1e6a8c92a7c895f0ba9dcad9ac4d35f3f791
    Date:   Sat Jun 25 10:21:17 2022 +1000
    
        vcl: extract function Animation::RenderNextFrameInAllRenderers()
    
        Change-Id: Iaccf12b251ffe06e24813c48ba3a169d0eaaa61c
        Reviewed-on: https://gerrit.libreoffice.org/c/core/+/76416
    
    which substituted mnAnimCount with nAnimCount which is a subtle one char
    difference, but mnAnimCount is a different thing entirely than the (then
    local variable) nAnimCount. mnAnimCount is the count of animations
    active, not the number of animation frames in a specific animation.
    
    orig code was const size_t nAnimCount = maFrames.size();
    so replace mnAnimCount here with maFrames.size() to get back to the
    original logic
    
    Change-Id: I11d1797eb0b9ef61addb3769d12d8364872071df
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149457
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx
index 5d4a208a6b30..9c188e417951 100644
--- a/vcl/source/animate/Animation.cxx
+++ b/vcl/source/animate/Animation.cxx
@@ -328,7 +328,7 @@ void Animation::RenderNextFrameInAllRenderers()
         {
             Stop();
             mbLoopTerminated = true;
-            mnFrameIndex = mnAnimCount - 1;
+            mnFrameIndex = maFrames.size() - 1;
             maBitmapEx = maFrames[mnFrameIndex]->maBitmapEx;
             return;
         }

Reply via email to