Skip to content

Commit

Permalink
uSubripFile: compatiblity with newes uGenericSubtitleFile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-audio91 committed Sep 29, 2017
1 parent 102bbf9 commit 35a81b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions usubripfile.pas
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,23 @@ procedure TSubripFile.LoadFromString(const AContents: String);
finally
sl.Free;
end;
Capacity := Length(sa) div 3;
Dialogs.Capacity := Length(sa) div 3;
i := 0;
while i >= 0 do
begin
i := FindInArray(sa, SubripTimeSliceSep, i+1);
if i >= 0 then
begin
FTimeSlice.ValueAsString := sa[i];
Dlg.TimeSlice := FTimeSlice;
TimeSlice.ValueAsString := sa[i];
Dlg.TimeSlice := TimeSlice;
Dlg.Text := EmptyStr;
k := i+1;
j := FindInArray(sa, SubripTimeSliceSep, k);
repeat
Dlg.Text := Dlg.Text +sa[k] +LineEnding;
Inc(k);
until (k > High(sa)) or (k >= j-1);
AddDialog(Dlg);
Dialogs.Add(Dlg);
end;
end;
end;
Expand All @@ -101,7 +101,7 @@ procedure TSubripFile.SaveToString(out AContents: String);
i: Integer;
begin
AContents := EmptyStr;
for i := 0 to Count-1 do
for i := 0 to Dialogs.Count-1 do
begin
AContents := AContents +(i+1).ToString +LineEnding;
AContents := AContents +Dialogs[i].TimeSlice.ValueAsString +LineEnding;
Expand All @@ -112,7 +112,7 @@ procedure TSubripFile.SaveToString(out AContents: String);
constructor TSubripFile.Create;
begin
inherited Create;
FTimeSlice.Initialize(3, ':', ',', SubripTimeSliceSep);
TimeSlice.Initialize(3, ':', ',', SubripTimeSliceSep);
end;

end.
Expand Down

0 comments on commit 35a81b9

Please sign in to comment.