mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Adopted to new RTF interface. Implemented attachment creation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6700 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9dc5eb4326
commit
0851f1ed7c
1 changed files with 12 additions and 13 deletions
|
@ -121,8 +121,14 @@ paraBreakCSet()
|
|||
|
||||
+ (NSAttributedString *)attributedStringWithAttachment:(NSTextAttachment *)attachment
|
||||
{
|
||||
// FIXME: Still missing
|
||||
return nil;
|
||||
unichar ch = NSAttachmentCharacter;
|
||||
NSString *string = [NSString stringWithCharacters: &ch
|
||||
length: 1];
|
||||
NSDictionary *attributes = [NSDictionary dictionaryWithObject: attachment
|
||||
forKey: NSAttachmentAttributeName];
|
||||
|
||||
return [[self alloc] initWithString: string
|
||||
attributes: attributes];
|
||||
}
|
||||
|
||||
- (BOOL) containsAttachments
|
||||
|
@ -406,18 +412,11 @@ documentAttributes: (NSDictionary**)dict
|
|||
- (id) initWithRTF: (NSData*)data
|
||||
documentAttributes: (NSDictionary**)dict
|
||||
{
|
||||
NSString *rtfString = [[NSString alloc]
|
||||
initWithData: data
|
||||
encoding: NSASCIIStringEncoding];
|
||||
NSMutableAttributedString *result = [[NSMutableAttributedString alloc] init];
|
||||
NSAttributedString *new = parseRTFintoAttributedString(data, dict);
|
||||
|
||||
parseRTFintoAttributedString(rtfString, result, dict);
|
||||
|
||||
self = [self initWithAttributedString: result];
|
||||
RELEASE(rtfString);
|
||||
RELEASE(result);
|
||||
|
||||
return self;
|
||||
// We do not return self but the newly created object
|
||||
RELEASE(self);
|
||||
return RETAIN(new);
|
||||
}
|
||||
|
||||
- (id) initWithHTML: (NSData*)data
|
||||
|
|
Loading…
Reference in a new issue