mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
make proper references for informal protocols
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20086 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e9f7cbc9ab
commit
152ba2331a
1 changed files with 31 additions and 28 deletions
|
@ -201,25 +201,9 @@ static NSString *mainFont = nil;
|
|||
}
|
||||
else if (u == nil)
|
||||
{
|
||||
if (category == nil)
|
||||
{
|
||||
u = unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
u = classname;
|
||||
}
|
||||
s = [localRefs unitRef: r type: t unit: &u];
|
||||
if (s == nil)
|
||||
{
|
||||
if (category == nil)
|
||||
{
|
||||
u = unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
u = classname;
|
||||
}
|
||||
s = [globalRefs unitRef: r type: t unit: &u];
|
||||
}
|
||||
}
|
||||
|
@ -363,8 +347,19 @@ static NSString *mainFont = nil;
|
|||
{
|
||||
[buf appendFormat: @"target=\"%@\" ", target];
|
||||
}
|
||||
[buf appendFormat: @"href=\"%@.html#%@$%@\">%@</a>",
|
||||
file, type, ref, text];
|
||||
if (([type isEqual: @"protocol"] == YES)
|
||||
&& ([text hasPrefix: @"("] == NO))
|
||||
{
|
||||
// it's an informal protocol, detected earlier as an
|
||||
// unimplemented category of NSObject; make proper link
|
||||
[buf appendFormat: @"href=\"%@.html#%@$NSObject%@\">(%@)</a>",
|
||||
file, @"category", ref, text];
|
||||
}
|
||||
else
|
||||
{
|
||||
[buf appendFormat: @"href=\"%@.html#%@$%@\">%@</a>",
|
||||
file, type, ref, text];
|
||||
}
|
||||
if (!isBareStyle)
|
||||
{
|
||||
[buf appendString: @"</li>"];
|
||||
|
@ -398,11 +393,7 @@ static NSString *mainFont = nil;
|
|||
{
|
||||
sep = @"*"; // List ivars in class
|
||||
}
|
||||
else if (category != nil)
|
||||
{
|
||||
u = classname; // List methods in category
|
||||
}
|
||||
else if (classname != nil)
|
||||
else if (classname != nil && category == nil)
|
||||
{
|
||||
NSArray *catNames;
|
||||
|
||||
|
@ -475,14 +466,14 @@ static NSString *mainFont = nil;
|
|||
/*
|
||||
* 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.
|
||||
* actually a formal 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: @")"];
|
||||
|
||||
if (NSMaxRange(r) == [text length]) // A protocol
|
||||
if (NSMaxRange(r) == [text length]) // A formal protocol
|
||||
{
|
||||
text = [text stringByReplacingString: @"("
|
||||
withString: @"<"];
|
||||
|
@ -512,8 +503,20 @@ static NSString *mainFont = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
[buf appendFormat: @"href=\"%@.html#%@$%@\">%@</a>",
|
||||
file, type, ref, text];
|
||||
if (([type isEqual: @"protocol"] == YES)
|
||||
&& ([text hasPrefix: @"<"] == NO))
|
||||
{
|
||||
// it's an informal protocol, detected earlier as an
|
||||
// unimplemented category of NSObject; make proper link
|
||||
text = [text stringByDeletingPrefix: @"NSObject"];
|
||||
[buf appendFormat: @"href=\"%@.html#%@$%@\">%@</a>",
|
||||
file, @"category", ref, text];
|
||||
}
|
||||
else
|
||||
{
|
||||
[buf appendFormat: @"href=\"%@.html#%@$%@\">%@</a>",
|
||||
file, type, ref, text];
|
||||
}
|
||||
}
|
||||
if (!isBareStyle)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue