From 4b89814e3af585af42586dbfd2e33b5b9ccac373 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 25 Jul 2010 01:24:31 +0200 Subject: [PATCH] TrackContentObject: keep position in paste() When calling TrackContentObject::paste(), only the content should be pasted, not the position. This fixes pasting for example note patterns and is also a more generic solution for the bug fixed in commit 4ec5c6afe1326397599e233ed6d278520ebad30e. Closes #3005649. (cherry picked from commit 5306f7b0ca358529b2023c24812782a8749c79b2) --- src/core/track.cpp | 2 ++ src/tracks/bb_track.cpp | 10 +--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/core/track.cpp b/src/core/track.cpp index bc63a7b40..47c87a293 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -249,7 +249,9 @@ void trackContentObject::paste() { if( Clipboard::getContent( nodeName() ) != NULL ) { + const midiTime pos = startPosition(); restoreState( *( Clipboard::getContent( nodeName() ) ) ); + movePosition( pos ); } } diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index ee5356edc..db258a7f8 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -462,15 +462,7 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this ) it != tl.end(); ++it ) { ( *it )->getTCO( src )->copy(); - - trackContentObject * d = ( *it )->getTCO( dst ); - // important: remember position of destination TCO as pasting - // settings from source TCO will also restore the position of - // source TCO - const midiTime pos = d->startPosition(); - d->paste(); - // and move back to where it belongs! - d->movePosition( pos ); + ( *it )->getTCO( dst )->paste(); } setName( tr( "Clone of %1" ).arg( _this.parentNode().toElement().attribute( "name" ) ) );