* TextConverters/RTF/RTFProducer.m: Writing of NSLinkAttributeName; reading

is still to be implemented.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33440 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-07-03 19:37:43 +00:00
parent 1bc738ec3e
commit eb15c615d1
2 changed files with 32 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2011-07-03 Eric Wasylishen <ewasylishen@gmail.com>
* TextConverters/RTF/RTFProducer.m: Writing of NSLinkAttributeName; reading
is still to be implemented.
2011-07-03 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSMenuView.m: Allow any mouse up (left/right/other)

View file

@ -708,6 +708,10 @@
else if ([attributeName isEqualToString: NSFontAttributeName])
{
}
else if ([attributeName isEqualToString: NSLinkAttributeName])
{
[result appendString: @"}}"];
}
else
{
NSLog(@"(removal) Missing handling of '%@' attributes.",
@ -1083,6 +1087,29 @@
}
}
}
else if ([attributeName isEqualToString: NSLinkAttributeName])
{
id dest = [attributesToAdd objectForKey:
NSLinkAttributeName];
NSString *destString = @"";
if ([dest isKindOfClass: [NSURL class]])
{
destString = [dest absoluteString];
}
else if ([dest isKindOfClass: [NSString class]])
{
destString = [[NSURL URLWithString: dest] absoluteString];
}
// NOTE: RTF control characters (backslash, curly braces)
// will be escaped by -absoluteString, so the result is safe to
// concatenate into the RTF stream
[result appendString:
[NSString stringWithFormat: @"{\\field{\\*\\fldinst HYPERLINK \"%@\"}{\\fldrslt ", dest]];
}
else
{
NSLog(@"(addition) Missing handling of '%@' attributes.",