mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 03:33:18 +01:00
[refact] - Minor update (Idx.cs)
This commit is contained in:
parent
a9ed730b12
commit
cabb63ed77
@ -83,11 +83,12 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
|||||||
_errorCount = 0;
|
_errorCount = 0;
|
||||||
|
|
||||||
subtitle.Paragraphs.Clear();
|
subtitle.Paragraphs.Clear();
|
||||||
|
char[] splitChars = { ',', ':' };
|
||||||
foreach (string line in lines)
|
foreach (string line in lines)
|
||||||
{
|
{
|
||||||
if (_regexTimeCodes.IsMatch(line))
|
if (_regexTimeCodes.IsMatch(line))
|
||||||
{
|
{
|
||||||
Paragraph p = GetTimeCodes(line);
|
Paragraph p = GetParagraph(line.Split(splitChars, StringSplitOptions.RemoveEmptyEntries));
|
||||||
if (p != null)
|
if (p != null)
|
||||||
subtitle.Paragraphs.Add(p);
|
subtitle.Paragraphs.Add(p);
|
||||||
else
|
else
|
||||||
@ -108,11 +109,9 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Paragraph GetTimeCodes(string line)
|
private static Paragraph GetParagraph(string[] parts)
|
||||||
{
|
{
|
||||||
// timestamp: 00:00:01:401, filepos: 000000000
|
// timestamp: 00:00:01:401, filepos: 000000000
|
||||||
|
|
||||||
string[] parts = line.Split(new[] { ',', ':' }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
if (parts.Length == 7)
|
if (parts.Length == 7)
|
||||||
{
|
{
|
||||||
int hours;
|
int hours;
|
||||||
|
Loading…
Reference in New Issue
Block a user