Skip to content

Commit

Permalink
uSubripFile: compatibility with 0690f23
Browse files Browse the repository at this point in the history
  • Loading branch information
m-audio91 committed Oct 2, 2017
1 parent 0690f23 commit 368004d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions usubripfile.pas
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface

{ TCustomSubripFile }

TCustomSubripFile = specialize TGenericSubtitleFile<TPlainSubtitleDialog>;
TCustomSubripFile = specialize TGenericSubtitleFile<TPlainSubtitleEvent>;

{ TSubripFile }

Expand All @@ -62,7 +62,7 @@ procedure TSubripFile.LoadFromString(const AContents: String);
var
sa: TStringArray;
sl: TStringList;
Dlg: TPlainSubtitleDialog;
Dlg: TPlainSubtitleEvent;
i,j,k: Integer;
begin
if AContents = EmptyStr then Exit;
Expand All @@ -75,7 +75,7 @@ procedure TSubripFile.LoadFromString(const AContents: String);
finally
sl.Free;
end;
Dialogs.Capacity := Length(sa) div 3;
Events.Capacity := Length(sa) div 3;
i := 0;
while i >= 0 do
begin
Expand All @@ -91,7 +91,7 @@ procedure TSubripFile.LoadFromString(const AContents: String);
Dlg.Text := Dlg.Text +sa[k] +LineEnding;
Inc(k);
until (k > High(sa)) or (k >= j-1);
Dialogs.Add(Dlg);
Events.Add(Dlg);
end;
end;
end;
Expand All @@ -101,11 +101,11 @@ procedure TSubripFile.SaveToString(out AContents: String);
i: Integer;
begin
AContents := EmptyStr;
for i := 0 to Dialogs.Count-1 do
for i := 0 to Events.Count-1 do
begin
AContents := AContents +(i+1).ToString +LineEnding
+Dialogs[i].TimeSlice.ValueAsString +LineEnding
+Dialogs[i].Text;
+Events[i].TimeSlice.ValueAsString +LineEnding
+Events[i].Text;
end;
end;

Expand Down

0 comments on commit 368004d

Please sign in to comment.