Fix a bug in "Extend to next or Max"

This commit is contained in:
OmrSi 2020-09-08 04:29:02 +03:00
parent 4d271e42a5
commit 6769ee0fd9

View File

@ -14655,13 +14655,13 @@ namespace Nikse.SubtitleEdit.Forms
var idx = SubtitleListview1.SelectedItems[0].Index;
var p = _subtitle.Paragraphs[idx];
var next = _subtitle.GetParagraphOrDefault(idx + 1);
if (next == null || next.StartTime.TotalMilliseconds > p.EndTime.TotalMilliseconds + Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds + Configuration.Settings.General.MinimumMillisecondsBetweenLines)
if (next == null || next.StartTime.TotalMilliseconds > p.StartTime.TotalMilliseconds + Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds + Configuration.Settings.General.MinimumMillisecondsBetweenLines)
{
MakeHistoryForUndo(string.Format(_language.BeforeX, Configuration.Settings.Language.Settings.AdjustExtendCurrentSubtitle));
historyAdded = true;
p.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds + Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds;
}
else if (next != null && next.StartTime.TotalMilliseconds > p.EndTime.TotalMilliseconds)
else
{
MakeHistoryForUndo(string.Format(_language.BeforeX, Configuration.Settings.Language.Settings.AdjustExtendCurrentSubtitle));
historyAdded = true;
@ -14674,7 +14674,7 @@ namespace Nikse.SubtitleEdit.Forms
if (original != null)
{
var originalNext = _subtitleAlternate.GetParagraphOrDefault(_subtitleAlternate.GetIndex(original) + 1);
if (originalNext == null || originalNext.StartTime.TotalMilliseconds > original.EndTime.TotalMilliseconds + Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds + Configuration.Settings.General.MinimumMillisecondsBetweenLines)
if (originalNext == null || originalNext.StartTime.TotalMilliseconds > original.StartTime.TotalMilliseconds + Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds + Configuration.Settings.General.MinimumMillisecondsBetweenLines)
{
if (!historyAdded)
{
@ -14683,7 +14683,7 @@ namespace Nikse.SubtitleEdit.Forms
original.EndTime.TotalMilliseconds = original.StartTime.TotalMilliseconds + Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds;
}
else if (originalNext != null && originalNext.StartTime.TotalMilliseconds > original.EndTime.TotalMilliseconds)
else
{
if (!historyAdded)
{