Skip to content

Commit

Permalink
Fix regressions in LMMS#6477 (LMMS#6826)
Browse files Browse the repository at this point in the history
* Fix if statement in ClipView

* Move controllers.begin() to be the first argument
It was the second argument, which means it could've
returned negatives for random access iterators.
  • Loading branch information
sakertooth authored Aug 23, 2023
1 parent 9a0add4 commit da14de9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui/clips/ClipView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ DataFile ClipView::createClipDataFiles(
// Add extra metadata needed for calculations later

const auto initialTrackIt = std::find(tc->tracks().begin(), tc->tracks().end(), t);
if (initialTrackIt != tc->tracks().end())
if (initialTrackIt == tc->tracks().end())
{
printf("Failed to find selected track in the TrackContainer.\n");
return dataFile;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/modals/ControllerConnectionDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent,

if (it != controllers.end())
{
int idx = std::distance(it, controllers.begin());
int idx = std::distance(controllers.begin(), it);
m_userGroupBox->model()->setValue( true );
m_userController->model()->setValue( idx );
}
Expand Down

0 comments on commit da14de9

Please sign in to comment.