* fix for crash of textmode IDE when loading CHM index that contains empty tags.

git-svn-id: trunk@20087 -
This commit is contained in:
marco 2012-01-15 15:42:07 +00:00
parent 480d075bb4
commit 70e6637b9e

View File

@ -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);