Browse Source

* toplevel name (e.g. "active") is now also redirected.
* cleaned redirection up a bit,

git-svn-id: trunk@42141 -

marco 6 years ago
parent
commit
3d8c5d6eb8
1 changed files with 18 additions and 22 deletions
  1. 18 22
      utils/fpdoc/dw_htmlchm.inc

+ 18 - 22
utils/fpdoc/dw_htmlchm.inc

@@ -289,7 +289,7 @@ var
   ParentElement: TPasElement;
   ParentElement: TPasElement;
   MemberItem: TChmSiteMapItem;
   MemberItem: TChmSiteMapItem;
   Stream: TMemoryStream;
   Stream: TMemoryStream;
-  s,s2: String;
+  RedirectUrl,Urls: String;
 
 
 begin
 begin
   DoLog('Generating Index...');
   DoLog('Generating Index...');
@@ -317,15 +317,23 @@ begin
         for k := 0 to TPasClassType(ParentElement).Members.Count-1 do
         for k := 0 to TPasClassType(ParentElement).Members.Count-1 do
         begin
         begin
           TmpElement := TPasElement(TPasClassType(ParentElement).Members.Items[k]);
           TmpElement := TPasElement(TPasClassType(ParentElement).Members.Items[k]);
-          s:=''; 
-          if TmpElement is TPasEnumValue then
-             s := UTF8Encode(ResolveLinkIDAbs(tmpElement.Parent.PathName))
-           else
-             s := UTF8Encode(ResolveLinkIDAbs(tmpElement.PathName));
-           if Engine.HidePrivate and(TmpElement.Visibility = visPrivate) then
+          if Engine.HidePrivate and(TmpElement.Visibility = visPrivate) then
             continue;
             continue;
           if Engine.HideProtected and(TmpElement.Visibility = visProtected) then
           if Engine.HideProtected and(TmpElement.Visibility = visProtected) then
             continue;
             continue;
+          Urls:=FixHTMLpath(Allocator.GetFilename(TmpElement, 0));
+          RedirectUrl:='';
+          if TmpElement is TPasEnumValue then
+             RedirectUrl := UTF8Encode(ResolveLinkIDAbs(tmpElement.Parent.PathName))
+           else
+             RedirectUrl := UTF8Encode(ResolveLinkIDAbs(tmpElement.PathName));
+
+          if(trim(RedirectUrl)<>'') and (RedirectUrl<>urls) then
+            begin
+              writeln('Hint: Index Resolved:',urls,' to ',RedirectUrl);
+              urls:=RedirectUrl;
+            end;
+
           TmpItem := ParentItem.Children.NewItem;
           TmpItem := ParentItem.Children.NewItem;
           case ElementType(TmpElement) of
           case ElementType(TmpElement) of
             cmtProcedure   : TmpItem.Text := TmpElement.Name + ' procedure';
             cmtProcedure   : TmpItem.Text := TmpElement.Name + ' procedure';
@@ -337,13 +345,7 @@ begin
             cmtInterface   : TmpItem.Text := TmpElement.Name + ' interface';
             cmtInterface   : TmpItem.Text := TmpElement.Name + ' interface';
             cmtUnknown     : TmpItem.Text := TmpElement.Name;
             cmtUnknown     : TmpItem.Text := TmpElement.Name;
           end;
           end;
-          TmpItem.addLocal(FixHTMLpath(Allocator.GetFilename(TmpElement, 0)));
-          if (trim(s)<>'') and (tmpitem.local<>s) then
-            begin
-              writeln('Hint: Index: Resolved:',tmpitem.local,' to ',s);
-              tmpitem.addLocal(s);
-            end;
-
+          TmpItem.addLocal(Urls);
           {
           {
           ParentElement = Class
           ParentElement = Class
              TmpElement = Member
              TmpElement = Member
@@ -351,17 +353,11 @@ begin
           MemberItem := nil;
           MemberItem := nil;
           MemberItem := GetAlphaItem(Index.Items, TmpElement.Name);
           MemberItem := GetAlphaItem(Index.Items, TmpElement.Name);
           // ahh! if MemberItem.Local is empty MemberType is not shown!
           // ahh! if MemberItem.Local is empty MemberType is not shown!
-          MemberItem.addLocal(FixHTMLpath(Allocator.GetFilename(TmpElement, 0)));
+          MemberItem.addLocal(Urls);
 
 
           TmpItem := MemberItem.Children.NewItem;
           TmpItem := MemberItem.Children.NewItem;
           TmpItem.Text := ParentElement.Name;
           TmpItem.Text := ParentElement.Name;
-          s2:=Allocator.GetFilename(TmpElement, 0);
-          tmpitem.addlocal(s2); 
-          if(trim(s)<>'') and (s<>s2) then
-            begin
-              writeln('Hint: Index2 Resolved:',tmpitem.local,' to ',s);
-              TmpItem.AddLocal(s);
-            end;
+          TmpItem.AddLocal(Urls);
         end;
         end;
       end;
       end;
       // routines
       // routines