mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 23:39:39 +02:00
* ProjectDir changes broke adding index and toc to latex CHMs
git-svn-id: trunk@49617 -
This commit is contained in:
parent
db8c723b9d
commit
622554b59f
@ -1236,14 +1236,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChmProject.LoadSitemaps;
|
procedure TChmProject.LoadSitemaps;
|
||||||
|
|
||||||
|
function tryfn(fn: string;var fnout : string):boolean;
|
||||||
|
begin
|
||||||
|
result:=true;
|
||||||
|
fnout:= IncludeTrailingPathDelimiter(ProjectDir()) + ExtractFileName(fn);
|
||||||
|
if not FileExists(fnout) then
|
||||||
|
begin
|
||||||
|
fnout:=fn;
|
||||||
|
if not FileExists(fnout) then
|
||||||
|
result:=false;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
FullFileName: string;
|
FullFileName: string;
|
||||||
// #IDXHDR (merged files) goes into the system file, and need to keep TOC sitemap around
|
// #IDXHDR (merged files) goes into the system file, and need to keep TOC sitemap around
|
||||||
begin
|
begin
|
||||||
if FTableOfContentsFileName<>'' then
|
if FTableOfContentsFileName<>'' then
|
||||||
begin
|
begin
|
||||||
FullFileName := IncludeTrailingPathDelimiter(ProjectDir()) + ExtractFileName(FTableOfContentsFileName);
|
if tryfn(FTableOfContentsFileName,FullFileName) then
|
||||||
if FileExists(FullFileName) then
|
|
||||||
begin
|
begin
|
||||||
FreeAndNil(FTocStream);
|
FreeAndNil(FTocStream);
|
||||||
FTocStream:=TMemoryStream.Create;
|
FTocStream:=TMemoryStream.Create;
|
||||||
@ -1267,8 +1279,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if FIndexFileName<>'' then
|
if FIndexFileName<>'' then
|
||||||
begin
|
begin
|
||||||
FullFileName := IncludeTrailingPathDelimiter(ProjectDir()) + ExtractFileName(FIndexFileName);
|
if tryfn(FIndexFileName,FullFileName) then
|
||||||
if FileExists(FullFileName) then
|
|
||||||
begin
|
begin
|
||||||
FreeAndNil(FIndexStream);
|
FreeAndNil(FIndexStream);
|
||||||
FIndexStream:=TMemoryStream.Create;
|
FIndexStream:=TMemoryStream.Create;
|
||||||
|
Loading…
Reference in New Issue
Block a user