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

Ensure we cannot create invalid subtitles (with empty lines)

parent 8fe8439b
......@@ -238,7 +238,6 @@ avfilter.perspective
avfilter.pseudocolor
avfilter.rotate
avfilter.shuffleframes
avfilter.subtitles
avfilter.swaprect
avfilter.tlut2
avfilter.vignette
......
......@@ -170,7 +170,9 @@ void SubtitleEdit::setModel(std::shared_ptr<SubtitleModel> model)
void SubtitleEdit::updateSubtitle()
{
if (m_activeSub > -1 && m_model) {
m_model->setText(m_activeSub, subText->toPlainText());
QString txt = subText->toPlainText().trimmed();
txt.replace(QLatin1String("\n\n"), QStringLiteral("\n"));
m_model->setText(m_activeSub, txt);
}
}
......
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