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
4ec5c6afe1.

Closes #3005649.
This commit is contained in:
Tobias Doerffel
2010-07-25 01:24:31 +02:00
parent 3b642271a8
commit 5306f7b0ca
2 changed files with 3 additions and 9 deletions

View File

@@ -249,7 +249,9 @@ void trackContentObject::paste()
{
if( Clipboard::getContent( nodeName() ) != NULL )
{
const midiTime pos = startPosition();
restoreState( *( Clipboard::getContent( nodeName() ) ) );
movePosition( pos );
}
}

View File

@@ -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" ) ) );