mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
commit
796e0b08c5
@ -876,13 +876,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
using (var fixCommonErrors = new FixCommonErrors())
|
||||
{
|
||||
fixCommonErrors.RunBatch(p.Subtitle, p.Format, p.Encoding, Configuration.Settings.Tools.BatchConvertLanguage);
|
||||
p.Subtitle = fixCommonErrors.FixedSubtitle;
|
||||
}
|
||||
using (var fixCommonErrors = new FixCommonErrors())
|
||||
{
|
||||
fixCommonErrors.RunBatch(p.Subtitle, p.Format, p.Encoding, Configuration.Settings.Tools.BatchConvertLanguage);
|
||||
p.Subtitle = fixCommonErrors.FixedSubtitle;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
fixCommonErrors.RunBatch(p.Subtitle, p.Format, p.Encoding, Configuration.Settings.Tools.BatchConvertLanguage);
|
||||
p.Subtitle = fixCommonErrors.FixedSubtitle;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
@ -941,8 +939,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
Paragraph current = p.Subtitle.GetParagraphOrDefault(i);
|
||||
Paragraph next = p.Subtitle.GetParagraphOrDefault(i + 1);
|
||||
if (next.StartTime.TotalMilliseconds - current.EndTime.TotalMilliseconds < minumumMillisecondsBetweenLines)
|
||||
current.EndTime.TotalMilliseconds = next.StartTime.TotalMilliseconds - minumumMillisecondsBetweenLines;
|
||||
var gapsBetween = next.StartTime.TotalMilliseconds - current.EndTime.TotalMilliseconds;
|
||||
if (gapsBetween < minumumMillisecondsBetweenLines)
|
||||
current.EndTime.TotalMilliseconds = gapsBetween;
|
||||
}
|
||||
}
|
||||
e.Result = p;
|
||||
|
@ -191,10 +191,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
else
|
||||
{
|
||||
int index = newText.IndexOf(findWhat, StringComparison.OrdinalIgnoreCase);
|
||||
hit = index >= 0;
|
||||
while (index >= 0)
|
||||
{
|
||||
newText = newText.Substring(0, index) + replaceWith + newText.Remove(0, index + findWhat.Length);
|
||||
hit = true;
|
||||
newText = newText.Remove(index, findWhat.Length).Insert(index, replaceWith);
|
||||
index = newText.IndexOf(findWhat, index + replaceWith.Length, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
@ -614,6 +614,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
}
|
||||
}
|
||||
Console.WriteLine(" done.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!targetFormatFound)
|
||||
|
Loading…
Reference in New Issue
Block a user