Merge pull request #2023 from ivandrofly/macsub-fixpatch

[MacSub] - Fix numbering paragraph.
This commit is contained in:
Nikolaj Olsson 2016-10-26 14:45:27 +02:00 committed by GitHub
commit be5cc67d4c

View File

@ -55,7 +55,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
_errorCount = 0; _errorCount = 0;
char[] trimChar = { '/' }; char[] trimChar = { '/' };
var p = new Paragraph(); var p = new Paragraph();
for (int i = 0; i < lines.Count; i++) for (int i = 0, lineNumber = 1; i < lines.Count; i++)
{ {
string line = lines[i].Trim(); string line = lines[i].Trim();
string nextLine = null; string nextLine = null;
@ -86,7 +86,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
if ((nextLine == null) || (nextLine.Length > 0 && nextLine[0] == '/')) if ((nextLine == null) || (nextLine.Length > 0 && nextLine[0] == '/'))
{ {
expecting = Expecting.EndFrame; expecting = Expecting.EndFrame;
p.Number = i; p.Number = lineNumber++;
} }
break; break;