diff --git a/ChangeLog b/ChangeLog index f186f8403..a9c0a61a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-11-10 Richard Frith-Macdonald + + * Tools/AGSHtml.m: Fix based on email by Chris Vetter to correct + presentation of protocol names in index pages. + 2003-11-10 David Ayers Based on patches by Philip Moetteli . diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index b96638688..bb6586c8b 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -434,13 +434,26 @@ static NSMutableSet *textNodes = nil; NSString *text = ref; /* - * If a reference to a method contains a leading catergory name, - * we don't want it in the visiable method name. + * If a reference to a method contains a leading category name, + * we don't want it in the visible method name, however if it's + * actually a protocol name, we need to make it look right by + * changing the round brackets to angle brackets. */ if ([text hasPrefix: @"("] == YES) { NSRange r = [text rangeOfString: @")"]; - text = [text substringFromIndex: NSMaxRange(r)]; + + if (NSMaxRange(r) == [text length]) // A protocol + { + text = [text stringByReplacingString: @"(" + withString: @"<"]; + text = [text stringByReplacingString: @")" + withString: @">"]; + } + else // Category name in brackets followed by class name + { + text = [text substringFromIndex: NSMaxRange(r)]; + } } [buf appendString: indent];