Fix a bug with #4657 - thx Leon :)

This commit is contained in:
niksedk 2022-09-22 18:58:34 +02:00
parent a83eb5cb2e
commit f7d5679196
3 changed files with 17 additions and 3 deletions

View File

@ -2525,6 +2525,8 @@ can edit in same subtitle file (collaboration)</Information>
<MergeSelectedLinesAndUnbreakCjk>Merge selected lines and unbreak without space (CJK)</MergeSelectedLinesAndUnbreakCjk>
<MergeSelectedLinesOnlyFirstText>Merge selected lines, keep only first non-empty text</MergeSelectedLinesOnlyFirstText>
<MergeSelectedLinesBilingual>Merge selected lines bilingual</MergeSelectedLinesBilingual>
<MergeWithPreviousBilingual>Merge with prevous bilingual</MergeWithPreviousBilingual>
<MergeWithNextBilingual>Merge with next bilingual</MergeWithNextBilingual>
<SplitSelectedLineBilingual>Split selected line bilingual</SplitSelectedLineBilingual>
<ToggleTranslationMode>Toggle translator mode</ToggleTranslationMode>
<SwitchOriginalAndTranslation>Switch original and translation</SwitchOriginalAndTranslation>

View File

@ -11933,10 +11933,16 @@ namespace Nikse.SubtitleEdit.Forms
next++;
}
var arr = _subtitle.Paragraphs[index].Text.Trim().SplitToLines();
var p = _subtitle.GetParagraphOrDefault(index);
if (p == null)
{
return;
}
var arr = p.Text.Trim().SplitToLines();
if (arr.Count > 0)
{
int mid = arr.Count / 2;
var mid = arr.Count / 2;
for (var i = 0; i < arr.Count; i++)
{
var l = arr[i];
@ -11951,7 +11957,7 @@ namespace Nikse.SubtitleEdit.Forms
}
}
durationMilliseconds += _subtitle.Paragraphs[index].Duration.TotalMilliseconds;
durationMilliseconds += p.Duration.TotalMilliseconds;
}
if (sb1.Length > 150 || sb2.Length > 150)

View File

@ -6928,6 +6928,12 @@ namespace Nikse.SubtitleEdit.Logic
case "Settings/MergeSelectedLinesBilingual":
language.Settings.MergeSelectedLinesBilingual = reader.Value;
break;
case "Settings/MergeWithPreviousBilingual":
language.Settings.MergeWithPreviousBilingual = reader.Value;
break;
case "Settings/MergeWithNextBilingual":
language.Settings.MergeWithNextBilingual = reader.Value;
break;
case "Settings/SplitSelectedLineBilingual":
language.Settings.SplitSelectedLineBilingual = reader.Value;
break;