diff --git a/ChangeLog b/ChangeLog index b1dbde6e4..69d959dac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,8 @@ * Tools/AGSParser.[hm]: Add mechanism to return list of source files on which a document depends. * Tools/gsdoc-0_6_7.dtd: Permit wider use of index element. - * Tools/AGSHtml.m: ditto + * Tools/AGSHtml.m: ditto, and support indexing of category methods + along with class methods. * Source/GNUmakefile (Base_AGSDOC_FLAGS): Remove the SourceDirectory option ... now assumed to be the current directory for simplicity. * Source/Base.gsdoc: Add class and protocol indexes. diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index a3fd4dd60..8bbe4e3ab 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -797,10 +797,34 @@ static NSMutableSet *textNodes = nil; { NSString *ref = [a objectAtIndex: i]; NSDictionary *units = [dict objectForKey: ref]; - NSArray *b = [units allKeys]; + NSMutableArray *b = [[units allKeys] mutableCopy]; unsigned j; - b = [b sortedArrayUsingSelector: @selector(compare:)]; + if (unit != nil) + { + /* + * Remove any listing for methods not in the + * current unit or in categories of the + * current class. + */ + for (j = 0; j < [b count]; j++) + { + NSString *u = [b objectAtIndex: j]; + + if ([unit isEqual: u] == NO) + { + if ([unit hasSuffix: @")"] == NO + && [u hasPrefix: unit] == YES + && [u characterAtIndex: [unit length]] + == '(') + { + continue; + } + [b removeObjectAtIndex: j--]; + } + } + } + [b sortUsingSelector: @selector(compare:)]; for (j = 0; j < [b count]; j++) { NSString *u = [b objectAtIndex: j]; @@ -810,8 +834,9 @@ static NSMutableSet *textNodes = nil; [buf appendFormat: @"
  • ", file, type, u, sep, ref]; - [buf appendFormat: @"%@ in %@
  • \n", ref, u]; + [buf appendFormat: @"%@ in %@\n", ref, u]; } + RELEASE(b); } else {