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

Fix crash cutting a grouped subtitle

parent cef3b29a
......@@ -502,7 +502,7 @@ bool SubtitleModel::cutSubtitle(int position)
{
Fun redo = []() { return true; };
Fun undo = []() { return true; };
if (cutSubtitle(position, undo, redo)) {
if (cutSubtitle(position, undo, redo) > -1) {
pCore->pushUndo(undo, redo, i18n("Cut clip"));
return true;
}
......
......@@ -127,7 +127,8 @@ bool TimelineFunctions::processClipCut(const std::shared_ptr<TimelineItemModel>
return false;
}
if (isSubtitle) {
return timeline->cutSubtitle(position, undo, redo);
newId = timeline->cutSubtitle(position, undo, redo);
return newId > -1;
}
PlaylistState::ClipState state = timeline->m_allClips[clipId]->clipState();
// Check if clip has an end Mix
......
......@@ -1170,12 +1170,12 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
return res;
}
bool TimelineModel::cutSubtitle(int position, Fun &undo, Fun &redo)
int TimelineModel::cutSubtitle(int position, Fun &undo, Fun &redo)
{
if (m_subtitleModel) {
return m_subtitleModel->cutSubtitle(position, undo, redo);
}
return false;
return -1;
}
bool TimelineModel::requestSubtitleMove(int clipId, int position, bool updateView, bool logUndo, bool invalidateTimeline)
......
......@@ -368,7 +368,7 @@ public:
Q_INVOKABLE bool requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks = true, bool updateView = true, bool logUndo = true, bool invalidateTimeline = false, bool revertMove = false);
Q_INVOKABLE bool requestSubtitleMove(int clipId, int position, bool updateView = true, bool logUndo = true, bool invalidateTimeline = false);
bool requestSubtitleMove(int clipId, int position, bool updateView, bool first, bool last, bool invalidateTimeline, Fun &undo, Fun &redo);
bool cutSubtitle(int position, Fun &undo, Fun &redo);
int cutSubtitle(int position, Fun &undo, Fun &redo);
bool requestClipMix(const QString &mixId, std::pair<int, int> clipIds, std::pair<int, int> mixDurations, int trackId, int position, bool updateView, bool invalidateTimeline, bool finalMove, Fun &undo, Fun &redo, bool groupMove);
/** @brief Move a composition to a specific position This action is undoable
......
Supports Markdown
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