mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 15:06:15 +02:00
Fixed a bug in chmfilewriter.pas where an uninitialized variable was used. I eliminated the variable.
git-svn-id: trunk@11995 -
This commit is contained in:
parent
1ed71f011c
commit
ecef0ed86a
@ -36,7 +36,6 @@ type
|
||||
|
||||
TChmProject = class
|
||||
private
|
||||
FWriter: TChmWriter;
|
||||
FAutoFollowLinks: Boolean;
|
||||
FDefaultFont: String;
|
||||
FDefaultPage: String;
|
||||
@ -86,7 +85,6 @@ begin
|
||||
Result := False; // Return true to abort compressing files
|
||||
|
||||
TMemoryStream(Stream).LoadFromFile(ProjectDir+DataName);
|
||||
WriteLn('Reading: ', DataName);
|
||||
// clean up the filename
|
||||
FileName := StringReplace(ExtractFileName(DataName), '\', '/', [rfReplaceAll]);
|
||||
FileName := StringReplace(FileName, '//', '/', [rfReplaceAll]);
|
||||
@ -99,16 +97,18 @@ procedure TChmProject.LastFileAdded(Sender: TObject);
|
||||
var
|
||||
IndexStream: TFileStream;
|
||||
TOCStream: TFileStream;
|
||||
Writer: TChmWriter;
|
||||
begin
|
||||
// Assign the TOC and index files
|
||||
Writer := TChmWriter(Sender);
|
||||
if (IndexFileName <> '') and FileExists(IndexFileName) then begin
|
||||
IndexStream := TFileStream.Create(IndexFileName, fmOpenRead);
|
||||
FWriter.AppendIndex(IndexStream);
|
||||
Writer.AppendIndex(IndexStream);
|
||||
IndexStream.Free;
|
||||
end;
|
||||
if (TableOfContentsFileName <> '') and FileExists(TableOfContentsFileName) then begin
|
||||
TOCStream := TFileStream.Create(TableOfContentsFileName, fmOpenRead);
|
||||
FWriter.AppendTOC(TOCStream);
|
||||
Writer.AppendTOC(TOCStream);
|
||||
TOCStream.Free;
|
||||
end;
|
||||
|
||||
@ -194,6 +194,7 @@ begin
|
||||
TOCStream := nil;
|
||||
|
||||
Writer := TChmWriter.Create(AOutStream, False);
|
||||
|
||||
// our callback to get data
|
||||
Writer.OnGetFileData := @GetData;
|
||||
Writer.OnLastFile := @LastFileAdded;
|
||||
|
Loading…
Reference in New Issue
Block a user