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:
Fred Kiefer 2000-06-16 17:04:57 +00:00
parent 9dc5eb4326
commit 0851f1ed7c

View file

@ -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