1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 23:29:41 +02:00

Enable support for move sematics for EnvelopeHandle and BackgroundHandle

(cherry picked from audacity commit 63ce4db94624313bdbf12eec27b81ecdd04f30e1)

Signed-off-by: akleja <storspov@gmail.com>
This commit is contained in:
Vitaly Sverchinsky 2021-08-06 19:46:32 +03:00 committed by akleja
parent c410309ef4
commit 376f6acb90
3 changed files with 10 additions and 8 deletions

View File

@ -37,6 +37,9 @@ class BackgroundHandle : public UIHandle
public:
BackgroundHandle() {}
BackgroundHandle(BackgroundHandle&&) = default;
BackgroundHandle& operator=(BackgroundHandle&&) = default;
static HitTestPreview HitPreview()
{
static wxCursor arrowCursor{ wxCURSOR_ARROW };
@ -108,12 +111,8 @@ std::vector<UIHandlePtr> BackgroundCell::HitTest
(const TrackPanelMouseState &,
const AudacityProject *)
{
std::vector<UIHandlePtr> results;
auto result = mHandle.lock();
if (!result)
result = std::make_shared<BackgroundHandle>();
results.push_back(result);
return results;
auto result = AssignUIHandlePtr(mHandle, std::make_shared<BackgroundHandle>());
return { result };
}
std::shared_ptr<Track> BackgroundCell::DoFindTrack()

View File

@ -43,9 +43,9 @@ EnvelopeHandle::~EnvelopeHandle()
{}
UIHandlePtr EnvelopeHandle::HitAnywhere
(std::weak_ptr<EnvelopeHandle> & WXUNUSED(holder), Envelope *envelope, bool timeTrack)
(std::weak_ptr<EnvelopeHandle> &holder, Envelope *envelope, bool timeTrack)
{
auto result = std::make_shared<EnvelopeHandle>( envelope );
auto result = AssignUIHandlePtr(holder, std::make_shared<EnvelopeHandle>(envelope));
result->mTimeTrack = timeTrack;
return result;
}

View File

@ -38,6 +38,9 @@ class TENACITY_DLL_API EnvelopeHandle final : public UIHandle
public:
explicit EnvelopeHandle( Envelope *pEnvelope );
EnvelopeHandle(EnvelopeHandle&&) = default;
EnvelopeHandle& operator=(EnvelopeHandle&&) = default;
virtual ~EnvelopeHandle();