Commit a12b054f authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix crash on locked subtitle select/move

parent 94c148c6
Pipeline #44236 passed with stage
in 10 minutes and 2 seconds
......@@ -1158,7 +1158,7 @@ int TimelineModel::suggestSubtitleMove(int subId, int position, int cursorPositi
Q_ASSERT(isSubTitle(subId));
int currentPos = getSubtitlePosition(subId);
int offset = 0;
if (currentPos == position) {
if (currentPos == position || m_subtitleModel->isLocked()) {
return position;
}
int newPos = position;
......@@ -2157,6 +2157,11 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
sorted_subtitles.push_back({affectedItemId, m_allSubtitles.at(affectedItemId)});
}
}
if (!sorted_subtitles.empty() && m_subtitleModel->isLocked()) {
// Group with a locked subtitle, abort
return false;
}
// Sort clips first
std::sort(sorted_clips.begin(), sorted_clips.end(), [delta_pos](const std::pair<int, int> &clipId1, const std::pair<int, int> &clipId2) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment