mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 13:29:18 +02:00
* fix for crash of textmode IDE when loading CHM index that contains empty tags.
git-svn-id: trunk@20087 -
This commit is contained in:
parent
480d075bb4
commit
70e6637b9e
@ -121,6 +121,7 @@ var
|
||||
i,j : integer;
|
||||
item : TChmSiteMapItem;
|
||||
tli: integer;
|
||||
s : String;
|
||||
begin
|
||||
result:=false;
|
||||
if floaded then exit;
|
||||
@ -160,12 +161,16 @@ begin
|
||||
for i:=0 to findex.items.count-1 do
|
||||
begin
|
||||
item:=findex.items.item[i];
|
||||
if (length(item.local)>0) and (item.local[1]<>'/') then
|
||||
tli:=TopicLinks^.AddItem('/'+item.local)
|
||||
else
|
||||
tli:=TopicLinks^.AddItem(item.local);
|
||||
TLI:=EncodeHTMLCtx(ID,TLI+1);
|
||||
IndexEntries^.Insert(NewIndexEntry( FormatAlias(item.text),ID,TLI));
|
||||
s:=formatalias(item.text);
|
||||
if s<>'' then
|
||||
begin
|
||||
if (length(item.local)>0) and (item.local[1]<>'/') then
|
||||
tli:=TopicLinks^.AddItem('/'+item.local)
|
||||
else
|
||||
tli:=TopicLinks^.AddItem(item.local);
|
||||
TLI:=EncodeHTMLCtx(ID,TLI+1);
|
||||
IndexEntries^.Insert(NewIndexEntry( FormatAlias(item.text),ID,TLI));
|
||||
end;
|
||||
end;
|
||||
{$ifdef wdebug}
|
||||
debugmessageS({$i %file%},'TCHMWrapper: endloadindex ',{$i %line%},'1',0,0);
|
||||
|
Loading…
Reference in New Issue
Block a user