Remove unnecessary parts of fix for bug 2501...
... Don't need to put the project in a strange state where Undo commands are ignored until labels are de-selected
This commit is contained in:
parent
c9d37675f7
commit
35e9afe34d
|
@ -183,13 +183,6 @@ void OnUndo(const CommandContext &context)
|
|||
return;
|
||||
}
|
||||
|
||||
for (auto lt : tracks.Selected< LabelTrack >()) {
|
||||
auto &view = LabelTrackView::Get( *lt );
|
||||
if (!view.Undo( project )) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
undoManager.Undo(
|
||||
[&]( const UndoStackElem &elem ){
|
||||
ProjectHistory::Get( project ).PopState( elem.state ); } );
|
||||
|
|
|
@ -64,21 +64,6 @@ LabelTrackView::Index &LabelTrackView::Index::operator =(int index)
|
|||
return *this;
|
||||
}
|
||||
|
||||
|
||||
LabelTrackView::Index &LabelTrackView::Index::operator +(int index)
|
||||
{
|
||||
mModified = false;
|
||||
mIndex += index;
|
||||
return *this;
|
||||
}
|
||||
|
||||
LabelTrackView::Index &LabelTrackView::Index::operator -(int index)
|
||||
{
|
||||
mModified = false;
|
||||
mIndex -= index;
|
||||
return *this;
|
||||
}
|
||||
|
||||
LabelTrackView::Index &LabelTrackView::Index::operator ++()
|
||||
{
|
||||
mModified = false;
|
||||
|
@ -1019,22 +1004,6 @@ bool LabelTrackView::IsTextSelected( AudacityProject &project ) const
|
|||
return true;
|
||||
}
|
||||
|
||||
bool LabelTrackView::Undo( AudacityProject &project )
|
||||
{
|
||||
if (HasSelection( project )) {
|
||||
const auto pTrack = FindLabelTrack();
|
||||
const auto &mLabels = pTrack->GetLabels();
|
||||
auto labelStruct = mLabels[mSelIndex];
|
||||
auto &title = labelStruct.title;
|
||||
if (title.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
return mSelIndex.IsModified();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Cut the selected text in the text box
|
||||
/// @return true if text is selected in text box, false otherwise
|
||||
bool LabelTrackView::CutSelectedText( AudacityProject &project )
|
||||
|
|
|
@ -112,8 +112,6 @@ public:
|
|||
int GetSelectedIndex( AudacityProject &project ) const;
|
||||
void SetSelectedIndex( int index );
|
||||
|
||||
bool Undo( AudacityProject &project );
|
||||
|
||||
bool CutSelectedText( AudacityProject &project );
|
||||
bool CopySelectedText( AudacityProject &project );
|
||||
bool PasteSelectedText(
|
||||
|
@ -131,8 +129,6 @@ private:
|
|||
Index(int index);
|
||||
operator int() const;
|
||||
Index &operator =(int index);
|
||||
Index &operator +(int index);
|
||||
Index &operator -(int index);
|
||||
Index &operator ++();
|
||||
Index &operator --();
|
||||
|
||||
|
@ -141,7 +137,6 @@ private:
|
|||
|
||||
private:
|
||||
int mIndex;
|
||||
int mFlag;
|
||||
bool mModified;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue