From 401c1a5f2bfb9ba9f4a46ea7887fa81b61a6726c Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Sat, 18 Aug 2001 22:08:28 +0000 Subject: [PATCH] Renamed methods to fit the GSTextConsumer protocol. Adopted to changes in header. Perliminary implementation for RTFDConsumer. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10724 72102866-910b-0410-8b05-ffd578937521 --- Source/Parsers/attributedStringConsumer.m | 28 +++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Source/Parsers/attributedStringConsumer.m b/Source/Parsers/attributedStringConsumer.m index 6842ad681..58d3a3ea4 100644 --- a/Source/Parsers/attributedStringConsumer.m +++ b/Source/Parsers/attributedStringConsumer.m @@ -225,7 +225,7 @@ readNSString (StringContext *ctxt) @implementation RTFConsumer -+ (NSAttributedString*) parseRTFD: (NSFileWrapper *)wrapper ++ (NSAttributedString*) parseFile: (NSFileWrapper *)wrapper documentAttributes: (NSDictionary **)dict { RTFConsumer *consumer = [RTFConsumer new]; @@ -255,7 +255,7 @@ readNSString (StringContext *ctxt) return text; } -+ (NSAttributedString*) parseRTF: (NSData *)rtfData ++ (NSAttributedString*) parseData: (NSData *)rtfData documentAttributes: (NSDictionary **)dict { RTFConsumer *consumer = [RTFConsumer new]; @@ -292,6 +292,30 @@ readNSString (StringContext *ctxt) @end +@implementation RTFDConsumer + ++ (NSAttributedString*) parseFile: (NSFileWrapper *)wrapper + documentAttributes: (NSDictionary **)dict +{ + return [super parseFile: wrapper + documentAttributes: dict]; +} + ++ (NSAttributedString*) parseData: (NSData *)rtfData + documentAttributes: (NSDictionary **)dict +{ + NSAttributedString *str; + NSFileWrapper *wrapper = [[NSFileWrapper alloc] + initWithSerializedRepresentation: rtfData]; + + str = [self parseFile: wrapper documentAttributes: dict]; + RELEASE (wrapper); + + return str; +} + +@end + @implementation RTFConsumer (Private) - (NSDictionary*) documentAttributes