From ae79badcb457ab269578320e921c3ae0e680de9a Mon Sep 17 00:00:00 2001 From: BusinessmanProgrammerSteve Date: Fri, 6 Aug 2010 07:52:54 +0000 Subject: [PATCH] Fixes remaining issue regarding AudacityProject::OnPaste() raised in bug 177, closes a loophole for applying linking behavior. --- src/Menus.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Menus.cpp b/src/Menus.cpp index 8f689ea89..ac67f0d4e 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -3262,8 +3262,12 @@ void AudacityProject::OnPaste() // is of different type than the first selected track if (!c){ c = tmpC; - while (n && (c->GetKind() != n->GetKind())) + while (n && (c->GetKind() != n->GetKind() || !n->GetSelected())) { + // Must perform sync-adjustment before incrementing n + if (n->IsSynchroSelected()) { + n->SyncAdjust(t1, t0+msClipLen); + } n = iter.Next(); } if (!n) c = NULL; @@ -3299,10 +3303,6 @@ void AudacityProject::OnPaste() if (c->GetKind() == Track::Wave && n && n->GetKind() == Track::Wave) { - // If not the first in group we set useHandlePaste to true. - // Vaughan, 2010-08-05: - // useHandlePaste is clearly out of date, and - // not sure this comment actually applies here. Martyn? bPastedSomething |= ((WaveTrack*)n)->ClearAndPaste(t0, t1, (WaveTrack*)c, true, true); } @@ -3472,7 +3472,6 @@ bool AudacityProject::HandlePasteNothingSelected() return false; else { - bool bSuccess = true; TrackListIterator iterClip(msClipboard); Track* pClip = iterClip.First(); if (!pClip)