Browse Source

* Various small changes. LCL compiles again, but is 10% smaller.
tree inheritance still not fully linked.

git-svn-id: trunk@24276 -

marco 12 years ago
parent
commit
b2f861420c
3 changed files with 34 additions and 12 deletions
  1. 3 1
      utils/fpdoc/dglobals.pp
  2. 27 11
      utils/fpdoc/dw_html.pp
  3. 4 0
      utils/fpdoc/dw_htmlchm.inc

+ 3 - 1
utils/fpdoc/dglobals.pp

@@ -1066,6 +1066,8 @@ begin
     for i := 0 to Package.Modules.Count - 1 do
     begin
       Module := TPasModule(Package.Modules[i]);
+      if not assigned(Module.InterfaceSection) then
+        continue;
       for j := 0 to Module.InterfaceSection.Classes.Count - 1 do
       begin
         ClassDecl := TPasClassType(Module.InterfaceSection.Classes[j]);
@@ -1520,7 +1522,7 @@ begin
           break;
         CurPackage := CurPackage.NextSibling;
       end;
-      if not Assigned(Result) then
+      if not Assigned(Result) and assigned(CurModule.InterfaceSection) then
       begin
         { Okay, then we have to try all imported units of the current module }
         UnitList := CurModule.InterfaceSection.UsesList;

+ 27 - 11
utils/fpdoc/dw_html.pp

@@ -552,6 +552,8 @@ constructor THTMLWriter.Create(APackage: TPasPackage; AEngine: TFPDocEngine);
     ALink : DOMString;
     DidAutolink: Boolean;
   begin
+    if not assigned(Amodule.Interfacesection) then
+      exit; 
     AddPage(AModule, 0);
     AddPage(AModule,IndexSubIndex);
     AddTopicPages(AModule);
@@ -2454,7 +2456,7 @@ begin
     For I:=0 to Package.Modules.Count-1 do
       begin
       M:=TPasModule(Package.Modules[i]);
-      if Not (M is TPasExternalModule) then
+      if Not (M is TPasExternalModule) and assigned(M.InterfaceSection) then
         Self.AddElementsFromList(L,M.InterfaceSection.Classes,True)
       end;
     AppendMenuBar(ClassHierarchySubIndex);
@@ -2632,12 +2634,15 @@ end;
 procedure THTMLWriter.AddModuleIdentifiers(AModule : TPasModule; L : TStrings);
 
 begin
-  AddElementsFromList(L,AModule.InterfaceSection.Consts);
-  AddElementsFromList(L,AModule.InterfaceSection.Types);
-  AddElementsFromList(L,AModule.InterfaceSection.Functions);
-  AddElementsFromList(L,AModule.InterfaceSection.Classes);
-  AddElementsFromList(L,AModule.InterfaceSection.Variables);
-  AddElementsFromList(L,AModule.InterfaceSection.ResStrings);
+  if assigned(AModule.InterfaceSection) Then
+   begin
+      AddElementsFromList(L,AModule.InterfaceSection.Consts);
+      AddElementsFromList(L,AModule.InterfaceSection.Types);
+      AddElementsFromList(L,AModule.InterfaceSection.Functions);
+      AddElementsFromList(L,AModule.InterfaceSection.Classes);
+      AddElementsFromList(L,AModule.InterfaceSection.Variables);
+      AddElementsFromList(L,AModule.InterfaceSection.ResStrings);
+   end;
 end;
 
 
@@ -3146,6 +3151,8 @@ var
     ThisInterface,
     ThisClass: TPasClassType;
     HaveSeenTObject: Boolean;
+    LName     : String;
+    ThisNode  : TPasUnresolvedTypeRef;
   begin
     AppendMenuBar(-1);
     AppendTitle(AClass.Name);
@@ -3321,15 +3328,24 @@ var
     AppendText(CreateH2(BodyElement), SDocInheritance);
     TableEl := CreateTable(BodyElement);
     HaveSeenTObject := AClass.ObjKind <> okClass;
-    ThisClass := AClass;
+    // we try to track classes. But imported classes
+    // are TLinkNode's not the TPasClassType generated by the parser.
+    ThisClass := AClass; ThisNode := Nil;
     while True do
     begin
       TREl := CreateTR(TableEl);
       TDEl := CreateTD_vtop(TREl);
       TDEl['align'] := 'center';
       CodeEl := CreateCode(CreatePara(TDEl));
-      AppendHyperlink(CodeEl, ThisClass);
-      if ThisClass.Interfaces.count>0 then
+      if Assigned(ThisClass) then
+        LName:=ThisClass.Name
+      Else
+        LName:=ThisNode.Name;
+      if Assigned(ThisClass) Then
+        AppendHyperlink(CodeEl, ThisClass)
+      else
+        AppendHyperlink(CodeEl, ThisNode);
+      if Assigned(ThisClass) and (ThisClass.Interfaces.count>0) then
         begin
           for i:=0 to ThisClass.interfaces.count-1 do
             begin
@@ -3339,7 +3355,7 @@ var
             end;
         end;
       AppendShortDescrCell(TREl, ThisClass);
-      if HaveSeenTObject or (CompareText(ThisClass.Name, 'TObject') = 0) then
+      if HaveSeenTObject or (CompareText(LName, 'TObject') = 0) then
         HaveSeenTObject := True
       else
       begin

+ 4 - 0
utils/fpdoc/dw_htmlchm.inc

@@ -175,6 +175,8 @@ begin
     for i := 0 to Package.Modules.Count - 1 do
     begin
       AModule := TPasModule(Package.Modules[i]);
+      If not assigned(AModule.InterfaceSection) Then
+         Continue;
       ObjUnitItem := ObjByUnitItem.Children.NewItem;
       ObjUnitItem.Text := AModule.Name;
       RoutinesUnitItem := RoutinesByUnitItem.Children.NewItem;
@@ -292,6 +294,8 @@ begin
     for i := 0 to Package.Modules.Count - 1 do
     begin
       AModule := TPasModule(Package.Modules[i]);
+      if not assigned(AModule.InterfaceSection) then
+        continue;
       ParentItem := Index.Items.NewItem;
       ParentItem.Text := AModule.Name;
       ParentItem.Local := FixHTMLpath(Allocator.GetFilename(AModule, 0));