1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 00:03:52 +02:00

Move the recent const_casts elsewhere

This commit is contained in:
Paul Licameli
2016-02-29 19:54:21 -05:00
parent 4173bb1a37
commit 7aee5d09d8
3 changed files with 13 additions and 13 deletions

View File

@@ -837,22 +837,19 @@ void TrackList::AddToHead(Track * t)
ResizedEvent(n);
}
void TrackList::Replace(const Track * t, const Track * with, bool deletetrack)
void TrackList::Replace(Track * t, Track * with, bool deletetrack)
{
Track *const mutableT = const_cast<Track*>(t);
Track *const mutableWith = const_cast<Track*>(with);
if (mutableT && with) {
if (t && with) {
TrackListNode *node =
const_cast<TrackListNode *>(mutableT->GetNode());
const_cast<TrackListNode *>(t->GetNode());
mutableT->SetOwner(NULL, NULL);
t->SetOwner(NULL, NULL);
if (deletetrack) {
delete t;
}
node->t = mutableWith;
mutableWith->SetOwner(this, node);
node->t = with;
with->SetOwner(this, node);
RecalcPositions(node);
UpdatedEvent(node);
ResizedEvent(node);