mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
* 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:
parent
1bc738ec3e
commit
eb15c615d1
2 changed files with 32 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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.",
|
||||
|
|
Loading…
Reference in a new issue