mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-04 06:29:07 +02:00
Remove unnecessary const_cast
This commit is contained in:
parent
dffe3155b0
commit
92b857d551
@ -1081,10 +1081,7 @@ int LabelTrackView::GetSelectedIndex( AudacityProject &project ) const
|
|||||||
// may make delayed update of mutable mSelIndex after track selection change
|
// may make delayed update of mutable mSelIndex after track selection change
|
||||||
auto track = FindLabelTrack();
|
auto track = FindLabelTrack();
|
||||||
if ( track->GetSelected() ||
|
if ( track->GetSelected() ||
|
||||||
TrackFocus::Get(
|
TrackFocus::Get( project ).Get() == track.get()
|
||||||
// unhappy const_cast because because focus may be set if undefined
|
|
||||||
const_cast<AudacityProject&>( project )
|
|
||||||
).Get() == track.get()
|
|
||||||
)
|
)
|
||||||
return mSelIndex = std::max( -1,
|
return mSelIndex = std::max( -1,
|
||||||
std::min<int>( track->GetLabels().size() - 1, mSelIndex ) );
|
std::min<int>( track->GetLabels().size() - 1, mSelIndex ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user