diff --git a/src/Project.cpp b/src/Project.cpp index 236f7c8d9..bbeb92877 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -4739,26 +4739,6 @@ void AudacityProject::ClearClipboard() } } -void AudacityProject::Clear() -{ - for (auto n : GetTracks()->Any()) { - if (n->GetSelected() || n->IsSyncLockSelected()) { - n->Clear(mViewInfo.selectedRegion.t0(), mViewInfo.selectedRegion.t1()); - } - } - - double seconds = mViewInfo.selectedRegion.duration(); - - mViewInfo.selectedRegion.collapseToT0(); - - PushState(wxString::Format(_("Deleted %.2f seconds at t=%.2f"), - seconds, - mViewInfo.selectedRegion.t0()), - _("Delete")); - - RedrawProject(); -} - // Utility function called by other zoom methods void AudacityProject::Zoom(double level) { diff --git a/src/Project.h b/src/Project.h index 9efd87d5d..4c3e6c72e 100644 --- a/src/Project.h +++ b/src/Project.h @@ -318,8 +318,6 @@ private: bool DoSave(bool fromSaveAs, bool bWantSaveCopy, bool bLossless = false); public: - void Clear();// clears a selection - const wxString &GetFileName() { return mFileName; } bool GetDirty() { return mDirty; } void SetProjectTitle( int number =-1); diff --git a/src/menus/EditMenus.cpp b/src/menus/EditMenus.cpp index a69f228a6..f463de620 100644 --- a/src/menus/EditMenus.cpp +++ b/src/menus/EditMenus.cpp @@ -364,9 +364,28 @@ void OnCut(const CommandContext &context) void OnDelete(const CommandContext &context) { auto &project = context.project; - project.Clear(); + auto &tracks = *project.GetTracks(); + auto &selectedRegion = project.GetViewInfo().selectedRegion; + + for (auto n : tracks.Any()) { + if (n->GetSelected() || n->IsSyncLockSelected()) { + n->Clear(selectedRegion.t0(), selectedRegion.t1()); + } + } + + double seconds = selectedRegion.duration(); + + selectedRegion.collapseToT0(); + + project.PushState(wxString::Format(_("Deleted %.2f seconds at t=%.2f"), + seconds, + selectedRegion.t0()), + _("Delete")); + + project.RedrawProject(); } + void OnCopy(const CommandContext &context) { auto &project = context.project;