From 784f330838a9b6cce79d8ea86f3aecc65460fe88 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 2 Apr 2020 14:35:30 -0700 Subject: [PATCH] Add assignment operator to wxAnimation --- include/wx/animate.h | 2 ++ src/common/animatecmn.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/wx/animate.h b/include/wx/animate.h index 98c1a8e5ef..919e4ff23e 100644 --- a/include/wx/animate.h +++ b/include/wx/animate.h @@ -71,6 +71,8 @@ public: wxAnimationImplType implType = wxANIMATION_IMPL_TYPE_NATIVE); wxAnimation(const wxAnimation& other); + wxAnimation& operator=(const wxAnimation& other); + wxAnimationImpl* GetImpl() const { return static_cast(m_refData); } diff --git a/src/common/animatecmn.cpp b/src/common/animatecmn.cpp index 37e4fb55f5..44e4689504 100644 --- a/src/common/animatecmn.cpp +++ b/src/common/animatecmn.cpp @@ -63,6 +63,16 @@ wxAnimation::wxAnimation(const wxAnimation& other) Ref(other); } +wxAnimation& wxAnimation::operator=(const wxAnimation& other) +{ + if (this != &other) + { + UnRef(); + Ref(other); + } + return *this; +} + int wxAnimation::GetDelay(unsigned int frame) const { wxCHECK_MSG( IsOk(), -1, wxT("invalid animation") );