mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 09:06:02 +02:00
* Fixed bug #14858 where chmsitemap could not properly read a file
git-svn-id: trunk@13947 -
This commit is contained in:
parent
2dd66cc265
commit
dd72603442
@ -124,6 +124,7 @@ type
|
|||||||
FUseFolderImages: Boolean;
|
FUseFolderImages: Boolean;
|
||||||
FWindowName: String;
|
FWindowName: String;
|
||||||
FLevel: Integer;
|
FLevel: Integer;
|
||||||
|
FLevelForced: Boolean;
|
||||||
FWindowStyles: LongInt;
|
FWindowStyles: LongInt;
|
||||||
procedure SetItems(const AValue: TChmSiteMapItems);
|
procedure SetItems(const AValue: TChmSiteMapItems);
|
||||||
protected
|
protected
|
||||||
@ -202,7 +203,7 @@ begin
|
|||||||
else begin // looking for /HTML
|
else begin // looking for /HTML
|
||||||
if TagName = '/HTML' then Exclude(FSiteMapTags, smtHTML);
|
if TagName = '/HTML' then Exclude(FSiteMapTags, smtHTML);
|
||||||
end;}
|
end;}
|
||||||
|
|
||||||
//if (smtHTML in FSiteMapTags) then begin
|
//if (smtHTML in FSiteMapTags) then begin
|
||||||
if not (smtBODY in FSiteMapTags) then begin
|
if not (smtBODY in FSiteMapTags) then begin
|
||||||
if TagName = 'BODY' then Include(FSiteMapTags, smtBODY);
|
if TagName = 'BODY' then Include(FSiteMapTags, smtBODY);
|
||||||
@ -210,7 +211,7 @@ begin
|
|||||||
else begin
|
else begin
|
||||||
if TagName = '/BODY' then Exclude(FSiteMapTags, smtBODY);
|
if TagName = '/BODY' then Exclude(FSiteMapTags, smtBODY);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (smtBODY in FSiteMapTags) then begin
|
if (smtBODY in FSiteMapTags) then begin
|
||||||
//WriteLn('GOT TAG: ', AActualTag);
|
//WriteLn('GOT TAG: ', AActualTag);
|
||||||
if TagName = 'UL' then begin
|
if TagName = 'UL' then begin
|
||||||
@ -221,16 +222,26 @@ begin
|
|||||||
//WriteLN('Dec Level');
|
//WriteLN('Dec Level');
|
||||||
DecreaseULevel;
|
DecreaseULevel;
|
||||||
end
|
end
|
||||||
|
else if (TagName = 'LI') and (FLevel = 0) then
|
||||||
|
FLevelForced := True
|
||||||
else if TagName = 'OBJECT' then begin
|
else if TagName = 'OBJECT' then begin
|
||||||
Include(FSiteMapBodyTags, smbtOBJECT);
|
Include(FSiteMapBodyTags, smbtOBJECT);
|
||||||
|
if FLevelForced then
|
||||||
|
IncreaseULevel;
|
||||||
If FLevel > 0 then // if it is zero it is the site properties
|
If FLevel > 0 then // if it is zero it is the site properties
|
||||||
NewSiteMapItem;
|
NewSiteMapItem;
|
||||||
end
|
end
|
||||||
else if TagName = '/OBJECT' then begin
|
else if TagName = '/OBJECT' then begin
|
||||||
Exclude(FSiteMapBodyTags, smbtOBJECT);
|
Exclude(FSiteMapBodyTags, smbtOBJECT);
|
||||||
|
if FLevelForced then
|
||||||
|
begin
|
||||||
|
DecreaseULevel;
|
||||||
|
FLevelForced := False;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else begin // we are the properties of the object tag
|
else begin // we are the properties of the object tag
|
||||||
if (smbtOBJECT in FSiteMapBodyTags) then begin
|
if (FLevel > 0 ) and (smbtOBJECT in FSiteMapBodyTags) then begin
|
||||||
|
|
||||||
if LowerCase(GetTagName(AActualTag)) = 'param' then begin
|
if LowerCase(GetTagName(AActualTag)) = 'param' then begin
|
||||||
|
|
||||||
TagAttributeName := GetVal(AActualTag, 'name');
|
TagAttributeName := GetVal(AActualTag, 'name');
|
||||||
|
Loading…
Reference in New Issue
Block a user