mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-01 16:19:43 +02:00
Bug 2496 - Label edit typing prepends selected text
Problem: labelStruct, a copy of the label is initialized before call to RemoveSelectedText() which acts on the real label. So when the label is updated using labelStruct, the selected text has not been removed. Fix: Initialize labelStruct after the call to RemoveSelectedText().
This commit is contained in:
parent
b12fafbea0
commit
975ee0cc07
@ -1637,14 +1637,14 @@ bool LabelTrackView::DoChar(
|
||||
// Now we are definitely in a label; append the incoming character
|
||||
//
|
||||
|
||||
const auto &mLabels = pTrack->GetLabels();
|
||||
auto labelStruct = mLabels[mSelIndex];
|
||||
auto &title = labelStruct.title;
|
||||
|
||||
// Test if cursor is in the end of string or not
|
||||
if (mInitialCursorPos != mCurrentCursorPos)
|
||||
RemoveSelectedText();
|
||||
|
||||
const auto& mLabels = pTrack->GetLabels();
|
||||
auto labelStruct = mLabels[mSelIndex];
|
||||
auto& title = labelStruct.title;
|
||||
|
||||
if (mCurrentCursorPos < (int)title.length()) {
|
||||
// Get substring on the righthand side of cursor
|
||||
wxString rightPart = title.Mid(mCurrentCursorPos);
|
||||
|
Loading…
x
Reference in New Issue
Block a user